danhakhavro 42 Posted April 17, 2021 Share Posted April 17, 2021 (edited) Hi, Today I installed the Owsap Align Bonus Affect feature. The installation was simple and everything was very well explained but I found a bug, when we die the bonus disappears and no longer appears. For those who do not know this "feature" give life points with the Karma. Like this: Preview And here the bug: Bug Preview Does anyone know where and how to solve this problem? The only code that can be relative is this one: char_battle.cpp #if defined(__ALIGNMENT_AFFECT__) void CHARACTER::AlignmentBonus() { if (IsPC() && (!GetDesc() || !GetDesc()->GetCharacter())) return; int iRealAlignment = m_iRealAlignment / 10; int iAlignmentBonus[MAX_ALIGNMENT_LEVEL][3] = { { ALIGNMENT_LEVEL1 /* 12000 */, POINT_MAX_HP, 2000 }, { ALIGNMENT_LEVEL2 /* 8000 */, POINT_MAX_HP, 1500 }, { ALIGNMENT_LEVEL3 /* 4000 */, POINT_MAX_HP, 1000 }, { ALIGNMENT_LEVEL4 /* 1000 */, POINT_MAX_HP, 500 }, }; for (int i = 0; i < MAX_ALIGNMENT_LEVEL; ++i) { if (iRealAlignment >= iAlignmentBonus[i][0]) { AddAffect(AFFECT_ALIGNMENT, iAlignmentBonus[i][1], iAlignmentBonus[i][2], AFF_NONE, INFINITE_AFFECT_DURATION, 0, true, true); return; } } RemoveAffect(AFFECT_ALIGNMENT); } #endif Thanks Edited August 28, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
PetePeter 36 Posted April 17, 2021 Share Posted April 17, 2021 Add it on "#define IS_NO_CLEAR_ON_DEATH_AFFECT(type)" inside char_affect.cpp 1 Link to comment Share on other sites More sharing options...
Honorable Member Solution Owsap 8175 Posted April 17, 2021 Honorable Member Solution Share Posted April 17, 2021 /// 1. @ game/char_affect.cpp // Search @ void CHARACTER::ClearAffect if (IS_NO_CLEAR_ON_DEATH_AFFECT(pkAff->dwType) || IS_NO_SAVE_AFFECT(pkAff->dwType)) { ++it; continue; } // Add below #if defined(__ALIGNMENT_AFFECT__) if (pkAff->dwType >= AFFECT_ALIGNMENT) { ++it; continue; } #endif 1 https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
danhakhavro 42 Posted April 17, 2021 Author Share Posted April 17, 2021 (edited) Perfect, now everything works fine! : D Thanks guys. Edited April 17, 2021 by danhakhavro Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now