Fix Eggmobile spawning Bowsers after hitting Fang with pinch phase laser
Fixes #288 (closed)
Explanation as to how it happens:
- When
A_Boss1Laser
is called with var2 = 2 (for Eggmobile's pinch phase, it calls itself three times. - First of these three
A_Boss1Laser
calls,P_RailThinker
is run (multiple times) to do movement and collision (includingP_CheckPosition
). - The laser collides with Fang during
P_CheckPosition
, Fang is hurt, goes topainstate
. - Fang's
painstate
isS_FANG_PAIN1
, but it has a duration of 0, so in the same tic it then goes toS_FANG_PAIN2
. -
S_FANG_PAIN2
calls the actionA_Boss5CheckOnGround
with avar1
ofS_FANG_PATHINGSTART1
. By some amazing coincidence,S_FANG_PATHINGSTART1
happens to be the same value asMT_KOOPA
. - This
var1
value modifies the global variable also namedvar1
(and likewise forvar2
but this isn't a problem here). - The new value of the global variable
var1
carries over to the end of the firstA_Boss1Laser
call, and into the secondA_Boss1Laser
call.var2
is changed butvar1
is left be assuming it was stillMT_LASER
(obviously it isn't). - Eggmobile now fires
MT_KOOPA
instead ofMT_LASER
!
Edited by Monster Iestyn