From e97dfb36873dfdee17a69bbc365f270284f1f38f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 24 May 2023 19:54:58 +0200 Subject: [PATCH] - moved ActorActionFunc and Personality out of __LegacyState again. --- source/games/sw/src/actor.cpp | 4 ++-- source/games/sw/src/ai.cpp | 42 ++++++++++++++++----------------- source/games/sw/src/break.cpp | 2 +- source/games/sw/src/bunny.cpp | 6 ++--- source/games/sw/src/coolg.cpp | 4 ++-- source/games/sw/src/coolie.cpp | 2 +- source/games/sw/src/game.h | 4 ++-- source/games/sw/src/hornet.cpp | 2 +- source/games/sw/src/jsector.cpp | 2 +- source/games/sw/src/ninja.cpp | 10 ++++---- source/games/sw/src/ripper.cpp | 2 +- source/games/sw/src/ripper2.cpp | 2 +- source/games/sw/src/save.cpp | 4 ++-- source/games/sw/src/sector.cpp | 6 ++--- source/games/sw/src/sprite.cpp | 28 +++++++++++----------- source/games/sw/src/swactor.h | 2 +- source/games/sw/src/track.cpp | 12 +++++----- 17 files changed, 67 insertions(+), 67 deletions(-) diff --git a/source/games/sw/src/actor.cpp b/source/games/sw/src/actor.cpp index 09f5a2b0f0..e97950fa3f 100644 --- a/source/games/sw/src/actor.cpp +++ b/source/games/sw/src/actor.cpp @@ -1071,11 +1071,11 @@ bool DSWActor::hasState(FName label, int subl) return getLegacyState(a, label, subl) != nullptr; } -void DSWActor::setActionDecide() { user.__legacyState.ActorActionFunc = AF(DoActorDecide); } +void DSWActor::setActionDecide() { user.ActorActionFunc = AF(DoActorDecide); } void DSWActor::callAction() { - callFunction(user.__legacyState.ActorActionFunc); + callFunction(user.ActorActionFunc); } void DSWActor::callStateAction() diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index bf71b443a4..18ff5b2542 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -66,7 +66,7 @@ bool ActorMoveHitReact(DSWActor* actor) { // if you ran into a player - call close range functions DoActorPickClosePlayer(actor); - auto action = ChooseAction(actor->user.__legacyState.Personality->TouchTarget); + auto action = ChooseAction(actor->user.Personality->TouchTarget); actor->callFunction(action); } } @@ -451,7 +451,7 @@ VMFunction* DoActorActionDecide(DSWActor* actor) // REMINDER: This function is not even called if SpriteControl doesn't let // it get called - ASSERT(actor->user.__legacyState.Personality); + ASSERT(actor->user.Personality); actor->user.Dist = 0; action = AF(InitActorDecide); @@ -497,7 +497,7 @@ VMFunction* DoActorActionDecide(DSWActor* actor) actor->user.Flags &= ~(SPR_ACTIVE); // You've lost the player - now decide what to do - action = ChooseAction(actor->user.__legacyState.Personality->LostTarget); + action = ChooseAction(actor->user.Personality->LostTarget); //CON_Message("LostTarget"); return action; } @@ -509,9 +509,9 @@ VMFunction* DoActorActionDecide(DSWActor* actor) (pActor && pActor->hasU() && pActor->user.WeaponNum == WPN_FIST && actor->user.ID != RIPPER2_RUN_R0 && actor->user.ID != RIPPER_RUN_R0)) { if ((actor->user.ID == COOLG_RUN_R0 && (actor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT)) || (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) - action = ChooseAction(actor->user.__legacyState.Personality->Evasive); + action = ChooseAction(actor->user.Personality->Evasive); else - action = ChooseAction(actor->user.__legacyState.Personality->CloseRange); + action = ChooseAction(actor->user.Personality->CloseRange); //CON_Message("CloseRange"); return action; } @@ -531,9 +531,9 @@ VMFunction* DoActorActionDecide(DSWActor* actor) else { if ((actor->user.ID == COOLG_RUN_R0 && (actor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT)) || (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) - action = ChooseAction(actor->user.__legacyState.Personality->Evasive); + action = ChooseAction(actor->user.Personality->Evasive); else - action = ChooseAction(actor->user.__legacyState.Personality->Battle); + action = ChooseAction(actor->user.Personality->Battle); } //CON_Message("Battle 1"); return action; @@ -543,9 +543,9 @@ VMFunction* DoActorActionDecide(DSWActor* actor) else { if ((actor->user.ID == COOLG_RUN_R0 && (actor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT)) || (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) - action = ChooseAction(actor->user.__legacyState.Personality->Evasive); + action = ChooseAction(actor->user.Personality->Evasive); else - action = ChooseAction(actor->user.__legacyState.Personality->Battle); + action = ChooseAction(actor->user.Personality->Battle); //CON_Message("Battle 2"); return action; } @@ -555,16 +555,16 @@ VMFunction* DoActorActionDecide(DSWActor* actor) else if (ICanSee) { if ((actor->user.ID == COOLG_RUN_R0 && (actor->spr.cstat & CSTAT_SPRITE_TRANSLUCENT)) || (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)) - action = ChooseAction(actor->user.__legacyState.Personality->Evasive); + action = ChooseAction(actor->user.Personality->Evasive); else - action = ChooseAction(actor->user.__legacyState.Personality->Offense); + action = ChooseAction(actor->user.Personality->Offense); //CON_Message("Offense"); return action; } else { // You've lost the player - now decide what to do - action = ChooseAction(actor->user.__legacyState.Personality->LostTarget); + action = ChooseAction(actor->user.Personality->LostTarget); //CON_Message("Close but cant see, LostTarget"); return action; } @@ -586,7 +586,7 @@ VMFunction* DoActorActionDecide(DSWActor* actor) DoActorOperate(actor); // Don't let player completely sneek up behind you - action = ChooseAction(actor->user.__legacyState.Personality->Surprised); + action = ChooseAction(actor->user.Personality->Surprised); //CON_Message("Surprised"); if (!actor->user.DidAlert && ICanSee) { @@ -601,7 +601,7 @@ VMFunction* DoActorActionDecide(DSWActor* actor) // Player has not seen actor, to be fair let him know actor // are there ; - DoActorNoise(actor, ChooseNoise(actor->user.__legacyState.Personality->Broadcast)); + DoActorNoise(actor, ChooseNoise(actor->user.Personality->Broadcast)); return action; } } @@ -687,7 +687,7 @@ int DoActorDecide(DSWActor* actor) int InitActorMoveCloser(DSWActor* actor) { - actor->user.__legacyState.ActorActionFunc = AF(DoActorMoveCloser); + actor->user.ActorActionFunc = AF(DoActorMoveCloser); if (!actor->checkStateGroup(NAME_Run)) actor->setStateGroup(NAME_Run); @@ -745,7 +745,7 @@ int DoActorMoveCloser(DSWActor* actor) } // Do a noise if ok - DoActorNoise(actor, ChooseNoise(actor->user.__legacyState.Personality->Broadcast)); + DoActorNoise(actor, ChooseNoise(actor->user.Personality->Broadcast)); // after moving a ways check to see if player is still in sight if (actor->user.DistCheck > 34.375) @@ -1040,7 +1040,7 @@ int InitActorAttack(DSWActor* actor) return 0; } - actor->user.__legacyState.ActorActionFunc = AF(DoActorAttack); + actor->user.ActorActionFunc = AF(DoActorAttack); // move into standing frame //actor->setStateGroup(NAME_Stand); @@ -1087,7 +1087,7 @@ int DoActorAttack(DSWActor* actor) { int rand_num; - DoActorNoise(actor, ChooseNoise(actor->user.__legacyState.Personality->Broadcast)); + DoActorNoise(actor, ChooseNoise(actor->user.Personality->Broadcast)); double dist =(actor->spr.pos.XY() - actor->user.targetActor->spr.pos.XY()).Length(); @@ -1211,7 +1211,7 @@ int InitActorDuck(DSWActor* actor) return 0; } - actor->user.__legacyState.ActorActionFunc = AF(DoActorDuck); + actor->user.ActorActionFunc = AF(DoActorDuck); actor->setStateGroup(NAME_Duck); double dist = (actor->spr.pos.XY() - actor->user.targetActor->spr.pos.XY()).LengthSquared(); @@ -1562,7 +1562,7 @@ int InitActorReposition(DSWActor* actor) } - actor->user.__legacyState.ActorActionFunc = AF(DoActorReposition); + actor->user.ActorActionFunc = AF(DoActorReposition); if (!(actor->user.Flags & SPR_SWIMMING)) actor->setStateGroup(NAME_Run); @@ -1608,7 +1608,7 @@ int DoActorReposition(DSWActor* actor) int InitActorPause(DSWActor* actor) { - actor->user.__legacyState.ActorActionFunc = AF(DoActorPause); + actor->user.ActorActionFunc = AF(DoActorPause); actor->callAction(); diff --git a/source/games/sw/src/break.cpp b/source/games/sw/src/break.cpp index 67daea9c9b..bec06bd4f0 100644 --- a/source/games/sw/src/break.cpp +++ b/source/games/sw/src/break.cpp @@ -1021,7 +1021,7 @@ bool NullActor(DSWActor* actor) return true; // does not have a STATE or FUNC to control it - if (!actor->user.__legacyState.ActorActionFunc) + if (!actor->user.ActorActionFunc) return true; return false; diff --git a/source/games/sw/src/bunny.cpp b/source/games/sw/src/bunny.cpp index 8ab42588ad..046a9433bb 100644 --- a/source/games/sw/src/bunny.cpp +++ b/source/games/sw/src/bunny.cpp @@ -1171,7 +1171,7 @@ void BunnyHatch(DSWActor* actor) actorNew->user.ShellNum = 0; // Not Pregnant right now actorNew->setStateGroup(NAME_Jump); - actorNew->user.__legacyState.ActorActionFunc = AF(DoActorMoveJump); + actorNew->user.ActorActionFunc = AF(DoActorMoveJump); DoActorSetSpeed(actorNew, FAST_SPEED); PickJumpMaxSpeed(actorNew, -600); @@ -1219,7 +1219,7 @@ DSWActor* BunnyHatch2(DSWActor* actor) actorNew->user.ShellNum = 0; // Not Pregnant right now actorNew->setStateGroup(NAME_Jump); - actorNew->user.__legacyState.ActorActionFunc = AF(DoActorMoveJump); + actorNew->user.ActorActionFunc = AF(DoActorMoveJump); DoActorSetSpeed(actorNew, FAST_SPEED); if (TEST_BOOL3(actor)) { @@ -1308,7 +1308,7 @@ int DoBunnyMove(DSWActor* actor) actor->spr.Angles.Yaw = RandomAngle(); actor->user.jump_speed = -350; DoActorBeginJump(actor); - actor->user.__legacyState.ActorActionFunc = AF(DoActorMoveJump); + actor->user.ActorActionFunc = AF(DoActorMoveJump); } } diff --git a/source/games/sw/src/coolg.cpp b/source/games/sw/src/coolg.cpp index c635a7fbd7..1deb2742a5 100644 --- a/source/games/sw/src/coolg.cpp +++ b/source/games/sw/src/coolg.cpp @@ -552,7 +552,7 @@ int NewCoolg(DSWActor* actor) actorNew->user.__legacyState.ActorActionSet = &CoolgActionSet; actorNew->spr.shade = actor->spr.shade; - actorNew->user.__legacyState.Personality = &CoolgPersonality; + actorNew->user.Personality = &CoolgPersonality; actorNew->user.__legacyState.Attrib = &CoolgAttrib; // special case @@ -695,7 +695,7 @@ int DoCoolgMatchPlayerZ(DSWActor* actor) int InitCoolgCircle(DSWActor* actor) { - actor->user.__legacyState.ActorActionFunc = AF(DoCoolgCircle); + actor->user.ActorActionFunc = AF(DoCoolgCircle); actor->setStateGroup(NAME_Run); diff --git a/source/games/sw/src/coolie.cpp b/source/games/sw/src/coolie.cpp index c19567fe25..4b4ef0756b 100644 --- a/source/games/sw/src/coolie.cpp +++ b/source/games/sw/src/coolie.cpp @@ -412,7 +412,7 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso actor->spr.picnum = actor->user.__legacyState.State->Pic; change_actor_stat(actor, STAT_ENEMY); - actor->user.__legacyState.Personality = person; + actor->user.Personality = person; actor->user.__legacyState.ActorActionSet = action; DoActorZrange(actor); diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 493925cb7a..711ef0dfb3 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -699,6 +699,8 @@ struct USER TArray WallShade; walltype* WallP; // operate on wall instead of sprite + VMFunction* ActorActionFunc; + PERSONALITY* Personality; struct LegacyState { @@ -709,8 +711,6 @@ struct USER STATE** StateFallOverride; // a bit kludgy - override std fall state ACTOR_ACTION_SET* ActorActionSet; int16_t RotNum; - VMFunction* ActorActionFunc; - PERSONALITY* Personality; ATTRIBUTE* Attrib; }; diff --git a/source/games/sw/src/hornet.cpp b/source/games/sw/src/hornet.cpp index 361ebad541..eaffc95bee 100644 --- a/source/games/sw/src/hornet.cpp +++ b/source/games/sw/src/hornet.cpp @@ -413,7 +413,7 @@ int DoHornetMatchPlayerZ(DSWActor* actor) int InitHornetCircle(DSWActor* actor) { - actor->user.__legacyState.ActorActionFunc = AF(DoHornetCircle); + actor->user.ActorActionFunc = AF(DoHornetCircle); actor->setStateGroup(NAME_Run); diff --git a/source/games/sw/src/jsector.cpp b/source/games/sw/src/jsector.cpp index 1e6f727f81..b21a8b97aa 100644 --- a/source/games/sw/src/jsector.cpp +++ b/source/games/sw/src/jsector.cpp @@ -183,7 +183,7 @@ void JS_SpriteSetup(void) itActor->user.__legacyState.RotNum = 0; itActor->user.WaitTics = itActor->spr.lotag * 120; - itActor->user.__legacyState.ActorActionFunc = AF(GenerateDrips); + itActor->user.ActorActionFunc = AF(GenerateDrips); change_actor_stat(itActor, STAT_NO_STATE); itActor->spr.cstat |= CSTAT_SPRITE_INVISIBLE; diff --git a/source/games/sw/src/ninja.cpp b/source/games/sw/src/ninja.cpp index b04d21ff16..ffb1f578a7 100644 --- a/source/games/sw/src/ninja.cpp +++ b/source/games/sw/src/ninja.cpp @@ -1785,14 +1785,14 @@ int SetupNinja(DSWActor* actor) { actor->user.__legacyState.Attrib = &NinjaAttrib; actor->user.__legacyState.ActorActionSet = &NinjaActionSet; - actor->user.__legacyState.Personality = &NinjaPersonality; + actor->user.Personality = &NinjaPersonality; ChangeState(actor, s_NinjaCeiling[0]); } else { actor->user.__legacyState.Attrib = &NinjaAttrib; actor->user.__legacyState.ActorActionSet = &NinjaSniperActionSet; - actor->user.__legacyState.Personality = &NinjaSniperPersonality; + actor->user.Personality = &NinjaSniperPersonality; ChangeState(actor, s_NinjaDuck[0]); } } @@ -1810,14 +1810,14 @@ int SetupNinja(DSWActor* actor) { actor->user.__legacyState.Attrib = &NinjaAttrib; actor->user.__legacyState.ActorActionSet = &NinjaActionSet; - actor->user.__legacyState.Personality = &NinjaPersonality; + actor->user.Personality = &NinjaPersonality; ChangeState(actor, s_NinjaCeiling[0]); } else { actor->user.__legacyState.Attrib = &NinjaAttrib; actor->user.__legacyState.ActorActionSet = &NinjaSniperActionSet; - actor->user.__legacyState.Personality = &NinjaSniperPersonality; + actor->user.Personality = &NinjaSniperPersonality; ChangeState(actor, s_NinjaDuck[0]); } } @@ -1849,7 +1849,7 @@ int SetupNinja(DSWActor* actor) { actor->user.__legacyState.Attrib = &NinjaAttrib; actor->user.__legacyState.ActorActionSet = &NinjaSniperActionSet; - actor->user.__legacyState.Personality = &NinjaSniperPersonality; + actor->user.Personality = &NinjaSniperPersonality; ChangeState(actor, s_NinjaDuck[0]); } } diff --git a/source/games/sw/src/ripper.cpp b/source/games/sw/src/ripper.cpp index 310a615080..8889f70b31 100644 --- a/source/games/sw/src/ripper.cpp +++ b/source/games/sw/src/ripper.cpp @@ -1227,7 +1227,7 @@ void RipperHatch(DSWActor* actor) actorNew->user.Flags |= (SPR_ACTIVE); actorNew->setStateGroup(NAME_Jump); - actorNew->user.__legacyState.ActorActionFunc = AF(DoActorMoveJump); + actorNew->user.ActorActionFunc = AF(DoActorMoveJump); DoActorSetSpeed(actorNew, FAST_SPEED); PickJumpMaxSpeed(actorNew, -600); diff --git a/source/games/sw/src/ripper2.cpp b/source/games/sw/src/ripper2.cpp index 674e6d040a..531db7997c 100644 --- a/source/games/sw/src/ripper2.cpp +++ b/source/games/sw/src/ripper2.cpp @@ -1235,7 +1235,7 @@ void Ripper2Hatch(DSWActor* actor) actorNew->user.Flags |= (SPR_ACTIVE); actorNew->setStateGroup(NAME_Jump); - actorNew->user.__legacyState.ActorActionFunc = AF(DoActorMoveJump); + actorNew->user.ActorActionFunc = AF(DoActorMoveJump); DoActorSetSpeed(actorNew, FAST_SPEED); PickJumpMaxSpeed(actorNew, -600); diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 2a2e0b94d8..29a234d004 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -745,7 +745,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, USER& w, USER* def ("StateEnd", w.__legacyState.StateEnd, def->__legacyState.StateEnd) ("StateFallOverride", w.__legacyState.StateFallOverride, def->__legacyState.StateFallOverride) ("ActorActionSet", w.__legacyState.ActorActionSet, def->__legacyState.ActorActionSet) - ("Personality", w.__legacyState.Personality, def->__legacyState.Personality) + ("Personality", w.Personality, def->Personality) ("Attrib", w.__legacyState.Attrib, def->__legacyState.Attrib) ("sop_parent", w.sop_parent, def->sop_parent) ("flags", w.Flags, def->Flags) @@ -826,7 +826,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, USER& w, USER* def ("filler", w.filler, def->filler) ("wallshade", w.WallShade) ("rotator", w.rotator) - ("actoractionfunc", w.__legacyState.ActorActionFunc) + ("actoractionfunc", w.ActorActionFunc) ("oz", w.oz, def->oz); arc.EndObject(); diff --git a/source/games/sw/src/sector.cpp b/source/games/sw/src/sector.cpp index ab924b2adb..151040b201 100644 --- a/source/games/sw/src/sector.cpp +++ b/source/games/sw/src/sector.cpp @@ -1008,7 +1008,7 @@ void DoSpawnSpotsForKill(short match) if (actor->spr.hitag == SPAWN_SPOT && actor->spr.lotag == match) { change_actor_stat(actor, STAT_NO_STATE); - actor->user.__legacyState.ActorActionFunc = AF(DoSpawnSpot); + actor->user.ActorActionFunc = AF(DoSpawnSpot); actor->user.WaitTics = SP_TAG5(actor) * 15; SetActorZ(actor, actor->spr.pos); // setting for Killed @@ -1035,7 +1035,7 @@ void DoSpawnSpotsForDamage(short match) if (actor->spr.hitag == SPAWN_SPOT && actor->spr.lotag == match) { change_actor_stat(actor, STAT_NO_STATE); - actor->user.__legacyState.ActorActionFunc = AF(DoSpawnSpot); + actor->user.ActorActionFunc = AF(DoSpawnSpot); actor->user.WaitTics = SP_TAG7(actor) * 15; // setting for Damaged actor->user.LastDamage = 0; @@ -1778,7 +1778,7 @@ int OperateSprite(DSWActor* actor, short player_is_operating) SpawnUser(actor, 0, nullptr); - actor->user.__legacyState.ActorActionFunc = AF(DoGrating); + actor->user.ActorActionFunc = AF(DoGrating); actor->spr.lotag = 0; actor->spr.hitag /= 2; diff --git a/source/games/sw/src/sprite.cpp b/source/games/sw/src/sprite.cpp index a4ae8d02da..1c7cab8430 100644 --- a/source/games/sw/src/sprite.cpp +++ b/source/games/sw/src/sprite.cpp @@ -1468,7 +1468,7 @@ void SpriteSetupPost(void) jActor->user.ceiling_dist = 4; jActor->user.floor_dist = -2; - jActor->user.__legacyState.ActorActionFunc = AF(DoActorDebris); + jActor->user.ActorActionFunc = AF(DoActorDebris); jActor->spr.cstat |= CSTAT_SPRITE_BREAKABLE; jActor->spr.extra |= SPRX_BREAKABLE; @@ -1960,18 +1960,18 @@ void SpriteSetup(void) { case 0: actor->user.Flags &= ~(SPR_ACTIVE); - actor->user.__legacyState.ActorActionFunc = AF(DoVator); + actor->user.ActorActionFunc = AF(DoVator); break; case 1: actor->user.Flags &= ~(SPR_ACTIVE); - actor->user.__legacyState.ActorActionFunc = AF(DoVator); + actor->user.ActorActionFunc = AF(DoVator); break; case 2: - actor->user.__legacyState.ActorActionFunc = AF(DoVatorAuto); + actor->user.ActorActionFunc = AF(DoVatorAuto); break; case 3: actor->user.Flags &= ~(SPR_ACTIVE); - actor->user.__legacyState.ActorActionFunc = AF(DoVatorAuto); + actor->user.ActorActionFunc = AF(DoVatorAuto); break; } @@ -2068,11 +2068,11 @@ void SpriteSetup(void) { case 0: actor->user.Flags &= ~(SPR_ACTIVE); - actor->user.__legacyState.ActorActionFunc = AF(DoRotator); + actor->user.ActorActionFunc = AF(DoRotator); break; case 1: actor->user.Flags &= ~(SPR_ACTIVE); - actor->user.__legacyState.ActorActionFunc = AF(DoRotator); + actor->user.ActorActionFunc = AF(DoRotator); break; } @@ -2113,11 +2113,11 @@ void SpriteSetup(void) { case 0: actor->user.Flags &= ~(SPR_ACTIVE); - actor->user.__legacyState.ActorActionFunc = AF(DoSlidor); + actor->user.ActorActionFunc = AF(DoSlidor); break; case 1: actor->user.Flags &= ~(SPR_ACTIVE); - actor->user.__legacyState.ActorActionFunc = AF(DoSlidor); + actor->user.ActorActionFunc = AF(DoSlidor); break; } @@ -2161,18 +2161,18 @@ void SpriteSetup(void) { case 0: actor->user.Flags &= ~(SPR_ACTIVE); - actor->user.__legacyState.ActorActionFunc = AF(DoSpike); + actor->user.ActorActionFunc = AF(DoSpike); break; case 1: actor->user.Flags &= ~(SPR_ACTIVE); - actor->user.__legacyState.ActorActionFunc = AF(DoSpike); + actor->user.ActorActionFunc = AF(DoSpike); break; case 2: - actor->user.__legacyState.ActorActionFunc = AF(DoSpikeAuto); + actor->user.ActorActionFunc = AF(DoSpikeAuto); break; case 3: actor->user.Flags &= ~(SPR_ACTIVE); - actor->user.__legacyState.ActorActionFunc = AF(DoSpikeAuto); + actor->user.ActorActionFunc = AF(DoSpikeAuto); break; } @@ -2349,7 +2349,7 @@ void SpriteSetup(void) SpawnUser(actor, ST1, nullptr); change_actor_stat(actor, STAT_NO_STATE); - actor->user.__legacyState.ActorActionFunc = AF(DoLavaErupt); + actor->user.ActorActionFunc = AF(DoLavaErupt); // interval between erupts if (SP_TAG10(actor) == 0) diff --git a/source/games/sw/src/swactor.h b/source/games/sw/src/swactor.h index 7006bc0276..03aec3a49c 100644 --- a/source/games/sw/src/swactor.h +++ b/source/games/sw/src/swactor.h @@ -47,7 +47,7 @@ class DSWActor : public DCoreActor // wrappers that hide legacy implementation details. void ChangeStateEnd(); - void clearActionFunc() { user.__legacyState.ActorActionFunc = nullptr; } + void clearActionFunc() { user.ActorActionFunc = nullptr; } void setActionDecide(); void setStateGroup(FName label, int substate = 0); // substate is only valid for Attack and CloseAttack bool checkStateGroup(FName label, int substate = 0); diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 211e2371de..890a379f38 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -2594,7 +2594,7 @@ void VehicleSetSmoke(SECTOR_OBJECT* sop, VMFunction* animator) DoSoundSpotStopSound(actor->spr.lotag); } - actor->user.__legacyState.ActorActionFunc = animator; + actor->user.ActorActionFunc = animator; } break; } @@ -2910,7 +2910,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) actor->user.jump_speed = -tpoint->tag_high; DoActorBeginJump(actor); - actor->user.__legacyState.ActorActionFunc = AF(DoActorMoveJump); + actor->user.ActorActionFunc = AF(DoActorMoveJump); } break; @@ -2956,7 +2956,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) } DoActorBeginJump(actor); - actor->user.__legacyState.ActorActionFunc = AF(DoActorMoveJump); + actor->user.ActorActionFunc = AF(DoActorMoveJump); return false; } @@ -2981,7 +2981,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) } DoActorBeginJump(actor); - actor->user.__legacyState.ActorActionFunc = AF(DoActorMoveJump); + actor->user.ActorActionFunc = AF(DoActorMoveJump); return false; } @@ -3011,7 +3011,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor) actor->user.WaitTics = tpoint->tag_high * 128; InitActorDuck(actor); - actor->user.__legacyState.ActorActionFunc = AF(DoActorDuck); + actor->user.ActorActionFunc = AF(DoActorDuck); return false; } @@ -3435,7 +3435,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics) actor->spr.pos.Z += actor->user.pos.Y; DoActorSetSpeed(actor, SLOW_SPEED); - actor->user.__legacyState.ActorActionFunc = AF(NinjaJumpActionFunc); + actor->user.ActorActionFunc = AF(NinjaJumpActionFunc); actor->user.jump_speed = -650; DoActorBeginJump(actor);