diff --git a/source/games/sw/src/panel.cpp b/source/games/sw/src/panel.cpp index e5e5b2254..f51719d6d 100644 --- a/source/games/sw/src/panel.cpp +++ b/source/games/sw/src/panel.cpp @@ -6357,7 +6357,7 @@ void pWeaponBob(PANEL_SPRITEp psp, short condition) // Back up current coordinates for interpolating. psp->backupcoords(); - psp->pos.X = psp->xorig + xdiff; + psp->pos.X = psp->bobpos.X + xdiff; psp->pos.Y = psp->yorig + ydiff + UziRecoilYadj; } diff --git a/source/games/sw/src/panel.h b/source/games/sw/src/panel.h index fbd00c65d..f416ece58 100644 --- a/source/games/sw/src/panel.h +++ b/source/games/sw/src/panel.h @@ -106,8 +106,7 @@ struct PANEL_SPRITEstruct PANEL_STATEp State, RetractState, PresentState, ActionState, RestState; PLAYERp PlayerP; // Do not change the order of this line - DVector2 pos, opos; - double xorig; + DVector2 pos, opos, bobpos; double yorig; // Do not change the order of this // line @@ -134,7 +133,7 @@ struct PANEL_SPRITEstruct void backupx() { opos.X = pos.X; }; void backupy() { opos.Y = pos.Y; }; void backupcoords() { opos = pos; }; - void backupbobx() { xorig = pos.X; }; + void backupbobx() { bobpos.X = pos.X; }; void backupboby() { yorig = pos.Y; }; void backupbobcoords() { backupbobx(); backupboby(); }; }; diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 732f8fa7f..fd19c2524 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -338,7 +338,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PANEL_SPRITEstruct ("picnum", w.picnum) ("vel", w.vel) ("vel_adj", w.vel_adj) - ("xorig", w.xorig) + ("xorig", w.bobpos.X) ("yorig", w.yorig) ("flags", w.flags) ("priority", w.priority)