Back to the Vavoom Forum Archives


Forum

[Fixed] [Hexen] Player::GiveMana()

Thu, 11 May 2006 03:57:20

Crimson Wizard

Player::GiveMana() :
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: --> )
Thu, 11 May 2006 15:44:49

Janis Legzdinsh

Fixed.

Back to the Vavoom Forum Archives