diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index 06681a1e12..7774c736d2 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -661,7 +661,7 @@ int DoActorBeginJump(DSWActor* actor) else actor->setStateGroup(NAME_Jump); - actor->user.__legacyState.StateFallOverride = nullptr; + actor->user.Flags2 &= ~SPR2_FALLOVERRIDE; //DO NOT CALL DoActorJump! DoActorStopFall can cause an infinite loop and //stack overflow if it is called. @@ -733,7 +733,7 @@ int DoActorBeginFall(DSWActor* actor) else actor->setStateGroup(NAME_Fall); - if (actor->user.__legacyState.StateFallOverride) + if (actor->user.Flags2 & SPR2_FALLOVERRIDE) { NewStateGroup(actor, actor->user.__legacyState.StateFallOverride); } diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 7b164acecd..64596c6186 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -711,8 +711,8 @@ struct USER struct LegacyState { FState* Rot; - FState* StateEnd; - FState* StateFallOverride; // a bit kludgy - override std fall state + FState* StateEnd; // make this a static class property, it's never use for anything else but statically set up data on actor spawn. + FState* StateFallOverride; // a bit kludgy - override std fall state (this one must also become a static class property.) ACTOR_ACTION_SET* ActorActionSet; int16_t RotNum; ATTRIBUTE* Attrib; @@ -972,6 +972,7 @@ enum SPR2_VIS_SHADING = BIT(23), // Sprite shading to go along with vis adjustments SPR2_DONT_TARGET_OWNER = BIT(24), SPR2_FLAMEDIE = BIT(25), // was previously 'flame == -2' + SPR2_FALLOVERRIDE = BIT(26), // use the FallOverride state }; diff --git a/source/games/sw/src/ripper.cpp b/source/games/sw/src/ripper.cpp index 9b70aab9d7..8d2ea82583 100644 --- a/source/games/sw/src/ripper.cpp +++ b/source/games/sw/src/ripper.cpp @@ -430,6 +430,7 @@ int SetupRipper(DSWActor* actor) actor->user.__legacyState.Attrib = &RipperAttrib; DoActorSetSpeed(actor, FAST_SPEED); actor->user.__legacyState.StateEnd = s_RipperDie; + actor->user.__legacyState.StateFallOverride = s_RipperHangFall; actor->spr.scale = DVector2(1, 1); if (actor->spr.pal == PALETTE_BROWN_RIPPER) @@ -575,7 +576,7 @@ int InitRipperHang(DSWActor* actor) } NewStateGroup(actor, s_RipperHangJump); - actor->user.__legacyState.StateFallOverride = s_RipperHangFall; + actor->user.Flags2 |= SPR2_FALLOVERRIDE; DoActorSetSpeed(actor, FAST_SPEED); PickJumpMaxSpeed(actor, -800); diff --git a/source/games/sw/src/ripper2.cpp b/source/games/sw/src/ripper2.cpp index f18e451f9b..388cab9914 100644 --- a/source/games/sw/src/ripper2.cpp +++ b/source/games/sw/src/ripper2.cpp @@ -455,6 +455,7 @@ int SetupRipper2(DSWActor* actor) actor->user.__legacyState.Attrib = &Ripper2Attrib; DoActorSetSpeed(actor, NORM_SPEED); actor->user.__legacyState.StateEnd = s_Ripper2Die; + actor->user.__legacyState.StateFallOverride = s_Ripper2HangFall; actor->clipdist = 32; // This actor is bigger, needs bigger box. actor->spr.scale = DVector2(0.859375, 0.859375); @@ -529,7 +530,7 @@ int InitRipper2Hang(DSWActor* actor) } NewStateGroup(actor, s_Ripper2HangJump); - actor->user.__legacyState.StateFallOverride = s_Ripper2HangFall; + actor->user.Flags2 |= SPR2_FALLOVERRIDE; DoActorSetSpeed(actor, FAST_SPEED); PickJumpMaxSpeed(actor, -(RandomRange(400)+100)); diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 741aa11515..023f200d9c 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -600,8 +600,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, USER& w, USER* def /* ("State", w.State, def->State) ("Rot", w.__legacyState.Rot, def->__legacyState.Rot) - ("StateEnd", w.__legacyState.StateEnd, def->__legacyState.StateEnd) - ("StateFallOverride", w.__legacyState.StateFallOverride, def->__legacyState.StateFallOverride) */ arc ("WallP", w.WallP, def->WallP)