Back to the Vavoom Forum Archives
Crimson Wizard
int prevMana; if (mana == HexenDefs::MANA_NONE) { return false; } if (mana == HexenDefs::MANA_BOTH) { // Give both types. Do this here to simplify other code. // Use bitwise or to make sure bot types are given. return GiveMana(HexenDefs::MANA_1, count) | GiveMana(HexenDefs::MANA_2, count); } if (mana < 0 || mana > HexenDefs::NUMMANA) { Error("Actor::GiveMana: bad type %i", mana); }The last condition is WRONG! It must be:
if (mana < 0 || mana >= HexenDefs::NUMMANA)Because Player.Mana[] has range of NUMMANA. In KA there already happened a bug because of this (plus mistake made by FB who sent forbidden value to this function <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> )
Janis Legzdinsh