Skip to content

Mislead bug in BG2EE(at least) engine

If creature with high HitPoints cast Mislead on self, copy will has undefined HitPoints (on BG2EE is just zero).

Bug due programmer's error in BioWare's original CGameEffectCopySelf::ApplyEffect(), signed short m_baseStats.m_hitPoints multiply by 100, then divide by 50. If HitPoints above 327 (npc probably can achieves this such values at Legacy of Bhaal Mode) engine get "signed short overflow" because 328*100 impossible for signed short

Comments

  • kjeronkjeron Member Posts: 2,368
    No surprise, though interesting this specific case hasn't been noticed before. A lot of stats don't have any upper/lower bound. Current Hit Points doesn't, through either healing or damage, both just loop it back and forth from positive/negative at 0/32767/-32768. Do too much damage and it will heal, heal for too much and it will kill.

    Now, why it applies such an effect in the first place is the bigger issue.

    An easy fix for Mislead would be to just apply the correct healing effect in MISLEAD.SPL.
Sign In or Register to comment.