diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index 5aef5ec63..6b6d491ad 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -566,16 +566,6 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, else SetGameVarID(lVar2, ps[iPlayer].access_incs, sActor, sPlayer); break; - case PLAYER_ACCESS_WALLNUM: - if (bSet) ps[iPlayer].access_wallnum = lValue; - else SetGameVarID(lVar2, ps[iPlayer].access_wallnum, sActor, sPlayer); - break; - - case PLAYER_ACCESS_SPRITENUM: - if (bSet) ps[iPlayer].access_spritenum = ScriptIndexToActor(lValue); - else SetGameVarID(lVar2, ActorToScriptIndex(ps[iPlayer].access_spritenum), sActor, sPlayer); - break; - case PLAYER_KICKBACK_PIC: if (bSet) ps[iPlayer].kickback_pic = lValue; else SetGameVarID(lVar2, ps[iPlayer].kickback_pic, sActor, sPlayer); diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index c910d518e..be1b5f7b3 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -1119,7 +1119,7 @@ DEFINE_FIELD_X(DukePlayer, player_struct, airleft) DEFINE_FIELD_X(DukePlayer, player_struct, knee_incs) DEFINE_FIELD_X(DukePlayer, player_struct, access_incs) DEFINE_FIELD_X(DukePlayer, player_struct, ftq) -DEFINE_FIELD_X(DukePlayer, player_struct, access_wallnum) +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) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 91ac6f699..30a3dfed9 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -1558,8 +1558,8 @@ int doincrements_d(struct player_struct* p) } else { - fi.checkhitswitch(snum, &wall[p->access_wallnum], nullptr); - switch (wall[p->access_wallnum].pal) + fi.checkhitswitch(snum, p->access_wall, nullptr); + switch (p->access_wall->pal) { case 0:p->got_access &= (0xffff - 0x1); break; case 21:p->got_access &= (0xffff - 0x2); break; diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 203f7ba0e..d5070ce37 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -1406,8 +1406,8 @@ int doincrements_r(struct player_struct* p) } else { - fi.checkhitswitch(snum, &wall[p->access_wallnum], nullptr); - switch (wall[p->access_wallnum].pal) + fi.checkhitswitch(snum, p->access_wall, nullptr); + switch (p->access_wall->pal) { case 0:p->keys[1] = 1; break; case 21:p->keys[2] = 1; break; diff --git a/source/games/duke/src/savegame.cpp b/source/games/duke/src/savegame.cpp index 8879ffbd3..faee7e500 100644 --- a/source/games/duke/src/savegame.cpp +++ b/source/games/duke/src/savegame.cpp @@ -151,7 +151,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w, ("knee_incs", w.knee_incs) ("access_incs", w.access_incs) ("ftq", w.ftq) - ("access_wallnum", w.access_wallnum) + ("access_wallnum", w.access_wall) ("access_spritenum", w.access_spritenum) ("kickback_pic", w.kickback_pic) ("got_access", w.got_access) diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 11121fc3c..1a661ff86 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -306,7 +306,7 @@ bool checkhitswitch_d(int snum, walltype* wwal, DDukeActor *act) if (ps[snum].access_incs == 1) { if (!act) - ps[snum].access_wallnum = wallnum(wwal); + ps[snum].access_wall = wwal; else ps[snum].access_spritenum = act; } diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 2230db421..301c285fb 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -424,7 +424,7 @@ bool checkhitswitch_r(int snum, walltype* wwal, DDukeActor* act) if (ps[snum].access_incs == 1) { if (!act) - ps[snum].access_wallnum = wallnum(wwal); + ps[snum].access_wall = wwal; else ps[snum].access_spritenum = act; } diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 14afdc6d1..93ab1b829 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -210,7 +210,8 @@ struct player_struct int aim_mode, ftt; - int cursectnum, one_parallax_sectnum, access_wallnum; // wall + sector references. Make them pointers later? + int cursectnum, one_parallax_sectnum; // wall + sector references. Make them pointers later? + walltype* access_wall; short last_extra, subweapon; short ammo_amount[MAX_WEAPONS], frag, fraggedself; diff --git a/wadsrc/static/zscript/games/duke/dukegame.zs b/wadsrc/static/zscript/games/duke/dukegame.zs index de2c58209..2adb9c811 100644 --- a/wadsrc/static/zscript/games/duke/dukegame.zs +++ b/wadsrc/static/zscript/games/duke/dukegame.zs @@ -159,7 +159,8 @@ struct DukePlayer native int randomflamex, crack_time; native int aim_mode, ftt; - native int cursectnum, one_parallax_sectnum, access_wallnum; + native int cursectnum, one_parallax_sectnum; + //native walltype access_wall; // can't do yet. native int16 last_extra, subweapon; native int16 ammo_amount[DukeWpn.MAX_WEAPONS], frag, fraggedself; @@ -175,7 +176,7 @@ struct DukePlayer 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 - native voidptr holoduke_on; // cannot do it as a proper actor pointer - but the status bar needs it. + native voidptr holoduke_on; // cannot do it as a proper actor pointer yet - but the status bar needs it. native int16 weaprecs[256], weapreccnt; native uint interface_toggle_flag; @@ -1233,4 +1234,4 @@ struct RRSnd native BUB_HEY1 = 498, BUB_HEY2 = 499, } -} \ No newline at end of file +}