From 6e130d026e108facc537bf9b356a0d95ae7c6adb Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 30 Dec 2021 23:22:56 +1100 Subject: [PATCH] - SW: Replace `PLAYERstruct` `lv_*` variables with a vector. --- source/games/sw/src/game.h | 2 +- source/games/sw/src/player.cpp | 8 ++++---- source/games/sw/src/save.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index c93f2ee82..8af1526d7 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -613,7 +613,7 @@ struct PLAYERstruct TObjPtr last_camera_act; // holds last valid move position - int lv_x,lv_y,lv_z; + vec3_t lv; REMOTE_CONTROL remote; SECTOR_OBJECTp sop_remote; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index cf6582efa..b84cc4578 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -5921,14 +5921,14 @@ void DoPlayerDeathMoveHead(PLAYERp pp) { pp->cursector = pp->lv_sector; ChangeActorSect(pp->actor, pp->lv_sector); - pp->pos.X = plActor->spr.pos.X = pp->lv_x; - pp->pos.Y = plActor->spr.pos.Y = pp->lv_y; + pp->pos.X = plActor->spr.pos.X = pp->lv.X; + pp->pos.Y = plActor->spr.pos.Y = pp->lv.Y; } else { pp->lv_sector = sect; - pp->lv_x = pp->pos.X; - pp->lv_y = pp->pos.Y; + pp->lv.X = pp->pos.X; + pp->lv.Y = pp->pos.Y; } } diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 1da09a97b..eda29f755 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -438,9 +438,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P ("y", w.pos.Y) ("z", w.pos.Z) ("lv_sectnum", w.lv_sector) - ("lv_x", w.lv_x) - ("lv_y", w.lv_y) - ("lv_z", w.lv_z) + ("lv_x", w.lv.X) + ("lv_y", w.lv.Y) + ("lv_z", w.lv.Z) ("remote_sprite", w.remoteActor) ("remote", w.remote) ("sop_remote", w.sop_remote)