diff --git a/source/games/duke/src/dukeactor.h b/source/games/duke/src/dukeactor.h index 24e70bf43..4f4a902f6 100644 --- a/source/games/duke/src/dukeactor.h +++ b/source/games/duke/src/dukeactor.h @@ -12,12 +12,12 @@ using DukeLinearSpriteIterator = TLinearSpriteIterator; inline DDukeActor* player_struct::GetActor() { - return &hittype[i]; + return actor; } inline int player_struct::GetPlayerNum() { - return GetActor()->s->yvel; + return actor->s->yvel; } inline int ActorToScriptIndex(DDukeActor* a) diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 2f147b2a2..d3f6d6f80 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -591,11 +591,6 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, else SetGameVarID(lVar2, ActorToScriptIndex(ps[iPlayer].on_crane), sActor, sPlayer); break; - case PLAYER_I: // This is dangerous!!! - if (bSet) ps[iPlayer].i = lValue; - else SetGameVarID(lVar2, ps[iPlayer].i, sActor, sPlayer); - break; - case PLAYER_OVER_SHOULDER_ON: if (bSet) ps[iPlayer].over_shoulder_on = lValue; else SetGameVarID(lVar2, ps[iPlayer].over_shoulder_on, sActor, sPlayer); diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index b90b267d8..15de23a08 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -1113,7 +1113,7 @@ DEFINE_FIELD_X(DukePlayer, player_struct, access_wall) DEFINE_FIELD_X(DukePlayer, player_struct, got_access) DEFINE_FIELD_X(DukePlayer, player_struct, weapon_ang) DEFINE_FIELD_X(DukePlayer, player_struct, firstaid_amount) -DEFINE_FIELD_X(DukePlayer, player_struct, i) +DEFINE_FIELD_X(DukePlayer, player_struct, actor) DEFINE_FIELD_X(DukePlayer, player_struct, one_parallax_sectnum) DEFINE_FIELD_X(DukePlayer, player_struct, over_shoulder_on) DEFINE_FIELD_X(DukePlayer, player_struct, fist_incs) diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 569862c44..ae93bfc1c 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -624,7 +624,7 @@ void resetpspritevars(int g) else s->pal = ps[j].palookup = ud.user_pals[j]; - ps[j].i = act->GetSpriteIndex(); + ps[j].actor = act; ps[j].frag_ps = j; act->SetOwner(act); diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index 800dd1473..24470db79 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -159,7 +159,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w, ("firstaid_amount", w.firstaid_amount) ("somethingonplayer", w.somethingonplayer) ("on_crane", w.on_crane) - ("i", w.i) + ("i", w.actor) ("one_parallax_sectnum", w.one_parallax_sectnum) ("over_shoulder_on", w.over_shoulder_on) ("random_club_frame", w.random_club_frame) diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 2c864b4ad..ef483c897 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -216,6 +216,7 @@ struct player_struct sectortype* cursector; sectortype* one_parallax_sectnum; // wall + sector references. Make them pointers later? walltype* access_wall; + DDukeActor* actor; short last_extra, subweapon; short ammo_amount[MAX_WEAPONS], frag, fraggedself; @@ -225,7 +226,6 @@ struct player_struct short jumping_counter, airleft, knee_incs, access_incs; short ftq; short got_access, weapon_ang, firstaid_amount; - short i; short over_shoulder_on, fist_incs; short cheat_phase; short extra_extra8, quick_kick, last_quick_kick; diff --git a/wadsrc/static/zscript/games/duke/dukegame.zs b/wadsrc/static/zscript/games/duke/dukegame.zs index 5849a7d5c..7be15e23b 100644 --- a/wadsrc/static/zscript/games/duke/dukegame.zs +++ b/wadsrc/static/zscript/games/duke/dukegame.zs @@ -170,12 +170,11 @@ struct DukePlayer native int16 jumping_counter, airleft, knee_incs, access_incs; native int16 ftq; native int16 got_access, weapon_ang, firstaid_amount; - native int16 i; native int16 over_shoulder_on, fist_incs; native int16 cheat_phase; native int16 extra_extra8, quick_kick, last_quick_kick; native int16 heat_amount, timebeforeexit, customexitsound; - //DDukeActor* actorsqu, *wackedbyactor, *on_crane, *holoduke_on, *somethingonplayer, *access_spritenum, *dummyplayersprite, *newOwner; // later + //DDukeActor* actor, actorsqu, *wackedbyactor, *on_crane, *holoduke_on, *somethingonplayer, *access_spritenum, *dummyplayersprite, *newOwner; // later native voidptr holoduke_on; // cannot do it as a proper actor pointer yet - but the status bar needs it. native int16 weaprecs[256], weapreccnt;