diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 2f99bde41..6ff0d5ce7 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -993,13 +993,13 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int // //--------------------------------------------------------------------------- -void shoot_d(int i, int atwith) +void shoot_d(int i_, int atwith) { + auto actor = &hittype[i_]; + spritetype* const s = &actor->s; + short sect, l, j; int sx, sy, sz, sa, p, vel, zvel, x, dal; - auto actor = &hittype[i]; - spritetype* const s = &actor->s; - auto atact = &hittype[atwith]; if (s->picnum == TILE_APLAYER) { p = s->yvel; @@ -1009,7 +1009,7 @@ void shoot_d(int i, int atwith) p = -1; } - SetGameVarID(g_iAtWithVarID, 0, atact, p); + SetGameVarID(g_iAtWithVarID, atwith, actor, p); SetGameVarID(g_iReturnVarID, 0, actor, p); OnEvent(EVENT_SHOOT, p, ps[p].GetActor(), -1); if (GetGameVarID(g_iReturnVarID, actor, p) != 0) diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index 8aff92b70..73beabd02 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -842,7 +842,6 @@ void shoot_r(int i, int atwith) auto actor = &hittype[i]; spritetype* const s = &actor->s; - auto atact = &hittype[atwith]; sect = s->sectnum; zvel = 0; @@ -873,7 +872,7 @@ void shoot_r(int i, int atwith) } } - SetGameVarID(g_iAtWithVarID, 0, atact, p); + SetGameVarID(g_iAtWithVarID, atwith, actor, p); SetGameVarID(g_iReturnVarID, 0, actor, p); OnEvent(EVENT_SHOOT, p, ps[p].GetActor(), -1); if (GetGameVarID(g_iReturnVarID, actor, p) != 0)