diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index 5afbcc8b7..f50aa9685 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -184,7 +184,6 @@ int DoActorDie(DSWActor* actor, DSWActor* weapActor, int meansofdeath) actor->user.__legacyState.RotNum = 0; actor->clearActionFunc(); - //actor->user.__legacyState.ActorActionFunc = NullAnimator; if (!sw_ninjahack) actor->spr.Angles.Yaw = weapActor->spr.Angles.Yaw; break; @@ -532,7 +531,7 @@ void KeepActorOnFloor(DSWActor* actor) if ((sectp->extra & SECTFX_SINK) && depth > 35 && - actor->user.__legacyState.ActorActionSet && actor->user.__legacyState.ActorActionSet->Swim) + actor->hasState(NAME_Swim)) { if (actor->user.Flags & (SPR_SWIMMING)) { @@ -657,13 +656,11 @@ int DoActorBeginJump(DSWActor* actor) actor->user.jump_grav = ACTOR_GRAVITY; // Change sprites state to jumping - if (actor->user.__legacyState.ActorActionSet) - { - if (actor->user.Flags & (SPR_DEAD)) - actor->setStateGroup(NAME_DeathJump); - else - actor->setStateGroup(NAME_Jump); - } + if (actor->user.Flags & (SPR_DEAD)) + actor->setStateGroup(NAME_DeathJump); + else + actor->setStateGroup(NAME_Jump); + actor->user.__legacyState.StateFallOverride = nullptr; //DO NOT CALL DoActorJump! DoActorStopFall can cause an infinite loop and @@ -729,19 +726,16 @@ int DoActorBeginFall(DSWActor* actor) actor->user.jump_grav = ACTOR_GRAVITY; // Change sprites state to falling - if (actor->user.__legacyState.ActorActionSet) + if (actor->user.Flags & (SPR_DEAD)) { - if (actor->user.Flags & (SPR_DEAD)) - { - actor->setStateGroup(NAME_DeathFall); - } - else - actor->setStateGroup(NAME_Fall); + actor->setStateGroup(NAME_DeathFall); + } + else + actor->setStateGroup(NAME_Fall); - if (actor->user.__legacyState.StateFallOverride) - { - NewStateGroup(actor, actor->user.__legacyState.StateFallOverride); - } + if (actor->user.__legacyState.StateFallOverride) + { + NewStateGroup(actor, actor->user.__legacyState.StateFallOverride); } DoActorFall(actor); @@ -810,7 +804,7 @@ int DoActorStopFall(DSWActor* actor) actor->setStateGroup(NAME_Run); - if ((actor->user.track >= 0) && (actor->user.jump_speed) > 800 && (actor->user.__legacyState.ActorActionSet->Sit)) + if ((actor->user.track >= 0) && (actor->user.jump_speed) > 800 && (actor->hasState(NAME_Sit))) { actor->user.WaitTics = 80; actor->setStateGroup(NAME_Sit); @@ -1099,4 +1093,8 @@ bool DSWActor::hasState(FName label, int subl) void DSWActor::setActionDecide() { user.__legacyState.ActorActionFunc = DoActorDecide; } +void DSWActor::callStateAction() +{ + (*user.__legacyState.ActorActionFunc)(this); +} END_SW_NS diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index a0ecd0521..9e9a295f7 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -111,11 +111,9 @@ void DoActorSetSpeed(DSWActor* actor, uint8_t speed) actor->user.speed = speed; - int vel; + int vel = actor->user.__legacyState.Attrib->Speed[speed]; if (ActorFlaming(actor)) - vel = actor->user.__legacyState.Attrib->Speed[speed] + (actor->user.__legacyState.Attrib->Speed[speed] >> 1); - else - vel = actor->user.__legacyState.Attrib->Speed[speed]; + vel = (vel * 3) >> 1; actor->vel.X = vel * maptoworld; } @@ -556,7 +554,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor) actor->user.Flags &= ~(SPR_TARGETED); // as far as actor // knows, its not a // target any more - if (actor->user.__legacyState.ActorActionSet->Duck && RANDOM_P2(1024<<8)>>8 < 100) + if (actor->hasState(NAME_Duck) && RANDOM_P2(1024<<8)>>8 < 100) action = InitActorDuck; else { @@ -819,7 +817,7 @@ int InitActorMoveCloser(DSWActor* actor) if (!actor->checkStateGroup(NAME_Run)) actor->setStateGroup(NAME_Run); - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); return 0; } @@ -1183,7 +1181,7 @@ int InitActorAttack(DSWActor* actor) } // Hari Kari for Ninja's - if (actor->user.__legacyState.ActorActionSet->Death2) + if (actor->hasState(NAME_Death2)) { const int SUICIDE_HEALTH_VALUE = 38; @@ -1199,7 +1197,7 @@ int InitActorAttack(DSWActor* actor) } - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); return 0; } @@ -1332,7 +1330,7 @@ int InitActorFindPlayer(DSWActor* actor) int InitActorDuck(DSWActor* actor) { - if (!actor->user.__legacyState.ActorActionSet->Duck) + if (!actor->hasState(NAME_Duck)) { actor->setActionDecide(); return 0; @@ -1354,7 +1352,7 @@ int InitActorDuck(DSWActor* actor) } - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); return 0; } @@ -1693,7 +1691,7 @@ int InitActorReposition(DSWActor* actor) if (!(actor->user.Flags & SPR_SWIMMING)) actor->setStateGroup(NAME_Run); - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); return 0; } @@ -1737,7 +1735,7 @@ int InitActorPause(DSWActor* actor) { actor->user.__legacyState.ActorActionFunc = DoActorPause; - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); return 0; } diff --git a/source/games/sw/src/bunny.cpp b/source/games/sw/src/bunny.cpp index 2094db647..ad0bc46db 100644 --- a/source/games/sw/src/bunny.cpp +++ b/source/games/sw/src/bunny.cpp @@ -1297,7 +1297,7 @@ int DoBunnyMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); // stay on floor unless doing certain things if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING))) diff --git a/source/games/sw/src/coolg.cpp b/source/games/sw/src/coolg.cpp index bf533febd..dc094cb6a 100644 --- a/source/games/sw/src/coolg.cpp +++ b/source/games/sw/src/coolg.cpp @@ -735,7 +735,7 @@ int InitCoolgCircle(DSWActor* actor) actor->user.WaitTics = (RandomRange(3)+1) * 120; - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); return 0; } @@ -901,7 +901,7 @@ int DoCoolgMove(DSWActor* actor) ActorFollowTrack(actor, ACTORMOVETICS); else { - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); } if (RANDOM_P2(1024) < 32 && !(actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) diff --git a/source/games/sw/src/coolie.cpp b/source/games/sw/src/coolie.cpp index f6330fcea..bfb7bca3f 100644 --- a/source/games/sw/src/coolie.cpp +++ b/source/games/sw/src/coolie.cpp @@ -475,7 +475,7 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso // find the number of long range attacks for (wpn = wpn_cnt = 0; wpn < SIZ(actor->user.__legacyState.ActorActionSet->Attack); wpn++) { - if (actor->user.__legacyState.ActorActionSet->Attack[wpn]) + if (actor->hasState(NAME_Attack, wpn)) wpn_cnt++; else break; @@ -588,7 +588,7 @@ int DoCoolieMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); KeepActorOnFloor(actor); diff --git a/source/games/sw/src/eel.cpp b/source/games/sw/src/eel.cpp index 93435575e..9e1cc87a2 100644 --- a/source/games/sw/src/eel.cpp +++ b/source/games/sw/src/eel.cpp @@ -590,7 +590,7 @@ int DoEelMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); DoEelMatchPlayerZ(actor); diff --git a/source/games/sw/src/girlninj.cpp b/source/games/sw/src/girlninj.cpp index da583945c..dbb727e3c 100644 --- a/source/games/sw/src/girlninj.cpp +++ b/source/games/sw/src/girlninj.cpp @@ -769,7 +769,7 @@ int DoGirlNinjaMove(DSWActor* actor) ActorFollowTrack(actor, ACTORMOVETICS); else { - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); } // stay on floor unless doing certain things diff --git a/source/games/sw/src/goro.cpp b/source/games/sw/src/goro.cpp index 4d07b4140..255f50bd8 100644 --- a/source/games/sw/src/goro.cpp +++ b/source/games/sw/src/goro.cpp @@ -557,7 +557,7 @@ int DoGoroMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); KeepActorOnFloor(actor); diff --git a/source/games/sw/src/hornet.cpp b/source/games/sw/src/hornet.cpp index 31ff8aeb9..eee39e19f 100644 --- a/source/games/sw/src/hornet.cpp +++ b/source/games/sw/src/hornet.cpp @@ -450,7 +450,7 @@ int InitHornetCircle(DSWActor* actor) actor->user.WaitTics = (RandomRange(3)+1) * 60; - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); return 0; } @@ -616,7 +616,7 @@ int DoHornetMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); DoHornetMatchPlayerZ(actor); diff --git a/source/games/sw/src/jweapon.cpp b/source/games/sw/src/jweapon.cpp index a5822b16d..8f86f0e23 100644 --- a/source/games/sw/src/jweapon.cpp +++ b/source/games/sw/src/jweapon.cpp @@ -1268,7 +1268,6 @@ int PlayerInitChemBomb(PLAYER* pp) actorNew->vel.X *= 0.75; } -// actorNew->user.__legacyState.RotNum = 5; actorNew->user.Flags |= (SPR_XFLIP_TOGGLE); SetOwner(pp->actor, actorNew); diff --git a/source/games/sw/src/lava.cpp b/source/games/sw/src/lava.cpp index 0ff60f35c..fea09f48d 100644 --- a/source/games/sw/src/lava.cpp +++ b/source/games/sw/src/lava.cpp @@ -514,7 +514,7 @@ int DoLavaMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); KeepActorOnFloor(actor); diff --git a/source/games/sw/src/ninja.cpp b/source/games/sw/src/ninja.cpp index 914200637..4e24ba254 100644 --- a/source/games/sw/src/ninja.cpp +++ b/source/games/sw/src/ninja.cpp @@ -2031,7 +2031,7 @@ int DoNinjaMove(DSWActor* actor) ActorFollowTrack(actor, ACTORMOVETICS); else { - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); } // stay on floor unless doing certain things @@ -2532,7 +2532,7 @@ static saveable_data saveable_ninja_data[] = SAVE_DATA(NinjaAttrib), SAVE_DATA(InvisibleNinjaAttrib), - + SAVE_DATA(s_NinjaRun), SAVE_DATA(sg_NinjaRun), SAVE_DATA(s_NinjaStand), diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index f2b4561c2..98b1560c6 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -4883,12 +4883,12 @@ void DoPlayerWade(PLAYER* pp) if (pp->Flags & (PF_PLAYER_MOVED)) { - if (plActor->user.__legacyState.Rot != plActor->user.__legacyState.ActorActionSet->Run) + if (plActor->checkStateGroup(NAME_Run)) plActor->setStateGroup(NAME_Run); } else { - if (plActor->user.__legacyState.Rot != plActor->user.__legacyState.ActorActionSet->Stand) + if (plActor->checkStateGroup(NAME_Stand)) plActor->setStateGroup(NAME_Stand); } @@ -5973,7 +5973,6 @@ void DoPlayerDeathCheckKeys(PLAYER* pp) plActor->setStateGroup(NAME_Stand); plActor->spr.picnum = plActor->user.__legacyState.State->Pic; - plActor->spr.picnum = plActor->user.__legacyState.State->Pic; plActor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER); //DoSpawnTeleporterEffect(plActor); @@ -6543,12 +6542,12 @@ void DoPlayerRun(PLAYER* pp) { if (pp->Flags & (PF_PLAYER_MOVED)) { - if (plActor->user.__legacyState.Rot != plActor->user.__legacyState.ActorActionSet->Run) + if (plActor->checkStateGroup(NAME_Run)) plActor->setStateGroup(NAME_Run); } else { - if (plActor->user.__legacyState.Rot != plActor->user.__legacyState.ActorActionSet->Stand) + if (plActor->checkStateGroup(NAME_Stand)) plActor->setStateGroup(NAME_Stand); } } diff --git a/source/games/sw/src/ripper.cpp b/source/games/sw/src/ripper.cpp index 94263a557..0cdc31167 100644 --- a/source/games/sw/src/ripper.cpp +++ b/source/games/sw/src/ripper.cpp @@ -1294,7 +1294,7 @@ int DoRipperMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); DoActorSectorDamage(actor); return 0; diff --git a/source/games/sw/src/ripper2.cpp b/source/games/sw/src/ripper2.cpp index da8cea79c..85a3635ab 100644 --- a/source/games/sw/src/ripper2.cpp +++ b/source/games/sw/src/ripper2.cpp @@ -1307,7 +1307,7 @@ int DoRipper2Move(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); DoActorSectorDamage(actor); diff --git a/source/games/sw/src/serp.cpp b/source/games/sw/src/serp.cpp index 07f4cf866..e83ebd439 100644 --- a/source/games/sw/src/serp.cpp +++ b/source/games/sw/src/serp.cpp @@ -760,7 +760,7 @@ int DoSerpMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); // serp ring if (actor->spr.pal != 16) diff --git a/source/games/sw/src/skel.cpp b/source/games/sw/src/skel.cpp index 9e206d9ac..1e96c7bf3 100644 --- a/source/games/sw/src/skel.cpp +++ b/source/games/sw/src/skel.cpp @@ -636,7 +636,7 @@ int DoSkelMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); KeepActorOnFloor(actor); diff --git a/source/games/sw/src/sumo.cpp b/source/games/sw/src/sumo.cpp index fb0a1c063..148e742af 100644 --- a/source/games/sw/src/sumo.cpp +++ b/source/games/sw/src/sumo.cpp @@ -669,7 +669,7 @@ int DoSumoMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); KeepActorOnFloor(actor); diff --git a/source/games/sw/src/swactor.h b/source/games/sw/src/swactor.h index 15504edd9..67d44ba81 100644 --- a/source/games/sw/src/swactor.h +++ b/source/games/sw/src/swactor.h @@ -53,6 +53,7 @@ public: void setStateGroup(FName label, int substate = 0); // substate is only valid for Attack and CloseAttack bool checkStateGroup(FName label, int substate = 0); bool hasState(FName label, int substate = 0); + void callStateAction(); }; diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index d327f2c3f..db3fd4bcd 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -154,7 +154,7 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr { case BIT(TT_DUCK_N_SHOOT): { - if (!actor->user.__legacyState.ActorActionSet->Duck) + if (!actor->hasState(NAME_Duck)) return -1; end_point[1] = 0; @@ -164,7 +164,7 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr // for ladders only look at first track point case BIT(TT_LADDER): { - if (!actor->user.__legacyState.ActorActionSet->Climb) + if (!actor->hasState(NAME_Climb)) return -1; end_point[1] = 0; @@ -174,7 +174,7 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr case BIT(TT_JUMP_UP): case BIT(TT_JUMP_DOWN): { - if (!actor->user.__legacyState.ActorActionSet->Jump) + if (!actor->hasState(NAME_Jump)) return -1; end_point[1] = 0; @@ -183,7 +183,7 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr case BIT(TT_TRAVERSE): { - if (!actor->user.__legacyState.ActorActionSet->Crawl || !actor->user.__legacyState.ActorActionSet->Jump) + if (!actor->hasState(NAME_Crawl) || !!actor->hasState(NAME_Jump)) return -1; break; @@ -2901,7 +2901,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) break; case TRACK_ACTOR_JUMP: - if (actor->user.__legacyState.ActorActionSet->Jump) + if (actor->hasState(NAME_Jump)) { actor->spr.Angles.Yaw = tpoint->angle; @@ -2918,7 +2918,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) case TRACK_ACTOR_QUICK_JUMP: case TRACK_ACTOR_QUICK_SUPER_JUMP: - if (actor->user.__legacyState.ActorActionSet->Jump) + if (actor->hasState(NAME_Jump)) { int zdiff; HitInfo hit{}; @@ -2966,7 +2966,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) case TRACK_ACTOR_QUICK_JUMP_DOWN: - if (actor->user.__legacyState.ActorActionSet->Jump) + if (actor->hasState(NAME_Jump)) { actor->spr.Angles.Yaw = tpoint->angle; @@ -2990,7 +2990,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) case TRACK_ACTOR_QUICK_SCAN: - if (actor->user.__legacyState.ActorActionSet->Jump) + if (actor->hasState(NAME_Jump)) { ActorLeaveTrack(actor); return false; @@ -3067,7 +3067,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) } case TRACK_ACTOR_JUMP_IF_FORWARD: - if (actor->user.__legacyState.ActorActionSet->Jump && actor->user.track_dir == 1) + if (actor->hasState(NAME_Jump) && actor->user.track_dir == 1) { if (!tpoint->tag_high) actor->user.jump_speed = ACTOR_STD_JUMP; @@ -3080,7 +3080,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) break; case TRACK_ACTOR_JUMP_IF_REVERSE: - if (actor->user.__legacyState.ActorActionSet->Jump && actor->user.track_dir == -1) + if (actor->hasState(NAME_Jump) && actor->user.track_dir == -1) { if (!tpoint->tag_high) actor->user.jump_speed = ACTOR_STD_JUMP; @@ -3112,7 +3112,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) case TRACK_ACTOR_SIT: - if (actor->user.__legacyState.ActorActionSet->Sit) + if (actor->hasState(NAME_Sit)) { if (!tpoint->tag_high) actor->user.WaitTics = 3 * 120; @@ -3125,7 +3125,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) break; case TRACK_ACTOR_DEATH1: - if (actor->user.__legacyState.ActorActionSet->Death2) + if (actor->hasState(NAME_Death2)) { actor->user.WaitTics = 4 * 120; actor->setStateGroup(NAME_Death1); @@ -3134,7 +3134,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) case TRACK_ACTOR_DEATH2: - if (actor->user.__legacyState.ActorActionSet->Death2) + if (actor->hasState(NAME_Death2)) { actor->user.WaitTics = 4 * 120; actor->setStateGroup(NAME_Death2); @@ -3144,7 +3144,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) case TRACK_ACTOR_DEATH_JUMP: - if (actor->user.__legacyState.ActorActionSet->DeathJump) + if (actor->hasState(NAME_DeathJump)) { actor->user.Flags |= (SPR_DEAD); actor->vel.X *= 2; @@ -3157,7 +3157,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) case TRACK_ACTOR_CLOSE_ATTACK1: - if (actor->user.__legacyState.ActorActionSet->CloseAttack[0]) + if (actor->hasState(NAME_CloseAttack, 0)) { if (!tpoint->tag_high) actor->user.WaitTics = 2 * 120; @@ -3171,7 +3171,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) case TRACK_ACTOR_CLOSE_ATTACK2: - if (actor->user.__legacyState.ActorActionSet->CloseAttack[1]) + if (actor->hasState(NAME_CloseAttack, 1)) { if (!tpoint->tag_high) actor->user.WaitTics = 4 * 120; @@ -3221,7 +3221,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) case TRACK_ACTOR_CLIMB_LADDER: - if (actor->user.__legacyState.ActorActionSet->Jump) + if (actor->hasState(NAME_Jump)) { HitInfo near; diff --git a/source/games/sw/src/zilla.cpp b/source/games/sw/src/zilla.cpp index 289e589a6..d872b5678 100644 --- a/source/games/sw/src/zilla.cpp +++ b/source/games/sw/src/zilla.cpp @@ -684,7 +684,7 @@ int DoZillaMove(DSWActor* actor) if (actor->user.track >= 0) ActorFollowTrack(actor, ACTORMOVETICS); else - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); KeepActorOnFloor(actor); diff --git a/source/games/sw/src/zombie.cpp b/source/games/sw/src/zombie.cpp index 285a1e709..091cb846a 100644 --- a/source/games/sw/src/zombie.cpp +++ b/source/games/sw/src/zombie.cpp @@ -903,7 +903,7 @@ int DoZombieMove(DSWActor* actor) ActorFollowTrack(actor, ACTORMOVETICS); else { - (*actor->user.__legacyState.ActorActionFunc)(actor); + actor->callStateAction(); } // stay on floor unless doing certain things