Author Topic: [Bug v1.04] Debug check for magic duration wrong  (Read 1322 times)

peewee_RotA

  • Sr. Member
  • Posts: 260
  • Karma: +8/-0
    • View Profile
[Bug v1.04] Debug check for magic duration wrong
« on: February 13, 2014, 06:32:17 AM »
This only effects DEBUG builds. There is an incorrect Debug check that forces an exit if the spell duration is equal to max. The next line then sets any duration greater than max, to max. It should be <=, not <.

EFFECT.C
EffectAddPlayerEffect
Code: [Select]
DebugCheck (duration < MAX_EFFECT_DURATION);
//    DebugCheck (power < MAX_EFFECT_POWER);

if (duration > MAX_EFFECT_DURATION) duration = MAX_EFFECT_DURATION;

should be

Code: [Select]
DebugCheck (duration <= MAX_EFFECT_DURATION);
//    DebugCheck (power < MAX_EFFECT_POWER);

if (duration > MAX_EFFECT_DURATION) duration = MAX_EFFECT_DURATION;

Was able to cause a crash when modifying duration for certain spells. A check to force duration to stay at max failed the debug check. The biggest offender is Magic map who already stays on for max duration - 1.