Spell Status Issue
Posted: Thu Apr 25, 2019 5:55 am
i have notice as well as others that spells on the hotbars dont always show like they should
ie
in queued state when should not be
dark when should be lit up etc
well this is apparently controlled by things like Unlockspell, lockspell, queue and unqueue
and those commands change the spell->status which is a bit map byte so the bit for queue appears to be bit 2 (value 4)
so if you have a status of 0 and want the spell to show queued you set status to 4
now here lies the problem
this modifie the status if the value is 4 it will ADD 4 to the current status, but wait theres more
if queuespell get called again it will add 4 more and make it status 8 which it should not be doing
should this not be doing something to set the bits adding or substacting a value
ie
in queued state when should not be
dark when should be lit up etc
well this is apparently controlled by things like Unlockspell, lockspell, queue and unqueue
and those commands change the spell->status which is a bit map byte so the bit for queue appears to be bit 2 (value 4)
so if you have a status of 0 and want the spell to show queued you set status to 4
now here lies the problem
Code: Select all
void Player::ModifySpellStatus(SpellBookEntry* spell, sint16 value, bool modify_recast, int16 recast) {
if (modify_recast) {
spell->recast = recast;
spell->recast_available = Timer::GetCurrentTime2() + (recast * 100);
}
if (modify_recast || spell->recast_available <= Timer::GetCurrentTime2() || value == 4)
spell->status += value;
}if queuespell get called again it will add 4 more and make it status 8 which it should not be doing
should this not be doing something to set the bits adding or substacting a value