Fix Eggmobile spawning Bowsers after hitting Fang with pinch phase laser
Fixes #288 (closed)
Explanation as to how it happens:
- When
A_Boss1Laseris called with var2 = 2 (for Eggmobile's pinch phase, it calls itself three times. - First of these three
A_Boss1Lasercalls,P_RailThinkeris 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
painstateisS_FANG_PAIN1, but it has a duration of 0, so in the same tic it then goes toS_FANG_PAIN2. -
S_FANG_PAIN2calls the actionA_Boss5CheckOnGroundwith avar1ofS_FANG_PATHINGSTART1. By some amazing coincidence,S_FANG_PATHINGSTART1happens to be the same value asMT_KOOPA. - This
var1value modifies the global variable also namedvar1(and likewise forvar2but this isn't a problem here). - The new value of the global variable
var1carries over to the end of the firstA_Boss1Lasercall, and into the secondA_Boss1Lasercall.var2is changed butvar1is left be assuming it was stillMT_LASER(obviously it isn't). - Eggmobile now fires
MT_KOOPAinstead ofMT_LASER!
Edited by Monster Iestyn