diff --git a/source/games/sw/src/game.cpp b/source/games/sw/src/game.cpp index 71ad7e13a..a0f058fea 100644 --- a/source/games/sw/src/game.cpp +++ b/source/games/sw/src/game.cpp @@ -527,7 +527,7 @@ void TerminateLevel(void) SWStatIterator it(stat); if (auto actor = it.Next()) { - if (actor->hasU()) puser[pnum].CopyFromUser(actor->u()); + if (actor->hasU()) puser[pnum].CopyFromUser(actor); } } diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 1900ff53d..9c03da5ab 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -1100,27 +1100,6 @@ struct USER using USERp = USER*; -struct USERSAVE -{ - int16_t Health; - int8_t WeaponNum; - int8_t LastWeaponNum; - - void CopyFromUser(USER* u) - { - Health = u->Health; - WeaponNum = u->WeaponNum; - LastWeaponNum = u->LastWeaponNum; - } - - void CopyToUser(USER* u) - { - u->Health = Health; - u->WeaponNum = WeaponNum; - u->LastWeaponNum = LastWeaponNum; - } - -}; enum { @@ -1819,8 +1798,6 @@ extern short connecthead, connectpoint2[MAXPLAYERS]; */ extern int *lastpacket2clock; -// save player info when moving to a new level (shortened to only cover the fields that actually are copied back.( -extern USERSAVE puser[MAX_SW_PLAYERS_REG]; /////////////////////////// // @@ -2222,6 +2199,31 @@ struct ANIMstruct extern ANIM Anim[MAXANIM]; extern short AnimCnt; +struct USERSAVE +{ + int16_t Health; + int8_t WeaponNum; + int8_t LastWeaponNum; + + void CopyFromUser(DSWActor* u) + { + Health = u->user.Health; + WeaponNum = u->user.WeaponNum; + LastWeaponNum = u->user.LastWeaponNum; + } + + void CopyToUser(DSWActor* u) + { + u->user.Health = Health; + u->user.WeaponNum = WeaponNum; + u->user.LastWeaponNum = LastWeaponNum; + } + +}; + +// save player info when moving to a new level (shortened to only cover the fields that actually are copied back.) +extern USERSAVE puser[MAX_SW_PLAYERS_REG]; + END_SW_NS diff --git a/source/games/sw/src/ninja.cpp b/source/games/sw/src/ninja.cpp index a1af2bb57..eca23dc11 100644 --- a/source/games/sw/src/ninja.cpp +++ b/source/games/sw/src/ninja.cpp @@ -2400,7 +2400,7 @@ void InitPlayerSprite(PLAYERp pp) else { // restore stuff from last level - puser[pnum].CopyToUser(u); + puser[pnum].CopyToUser(actor); PlayerLevelReset(pp); }