Browse Source

[Hellfire bug] fix Fire Ring trap

MI_FireRing adds missiles MIS_FIREWALL with TARGET_BOTH and src equals
to either player ID, or -1 if Fire Ring is casted as trap. This has
consequences:
1.  Because TARGET_BOTH MonsterMHit was called, as it usually called for
Firewalls. During this calls reference to Player gets garbage data (id
-1). This may miscalculate:
    - no heal flags
    - knockback flags (already fixed in this PR)
    - unsquelch position.last
2. drops ear for firewall flame originating from Fire Ring from trap

Fix:
- Separated TARGET_BOTH from IsTrap for monsters to ensure TryHitMonster
will get passed TrapMissile (MonsterTrapHit) is called instead.
- added additional condition for earflag
pull/4802/head
k-bar 4 years ago committed by Anders Jenbo
parent
commit
842a6e3d7e
  1. 2
      Source/missiles.cpp

2
Source/missiles.cpp

@ -418,7 +418,7 @@ void CheckMissileCol(Missile &missile, int minDamage, int maxDamage, bool isDama
isPlayerHit = PlayerMHit(pid - 1, &monster, missile._midist, minDamage, maxDamage, missile._mitype, isDamageShifted, 0, &blocked);
}
} else {
int earflag = (missile._miAnimType == MFILE_FIREWAL || missile._miAnimType == MFILE_LGHNING) ? 1 : 0;
int earflag = (!missile.IsTrap() && (missile._miAnimType == MFILE_FIREWAL || missile._miAnimType == MFILE_LGHNING)) ? 1 : 0;
isPlayerHit = PlayerMHit(pid - 1, nullptr, missile._midist, minDamage, maxDamage, missile._mitype, isDamageShifted, earflag, &blocked);
}
}

Loading…
Cancel
Save