diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index 269ab3962..59a74e6f6 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -1030,22 +1030,28 @@ void displayweapon_d(int snum, double interpfrac) auto displayflamethrower = [&]() { + offsets.X += weapon_xoffset; + offsets.Y -= gun_pos; + if (*kb < 1 || p->cursector->lotag == 2) { - hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, FLAMETHROWER, shade, o, pal); - hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, FLAMETHROWERPILOT, shade, o, pal); + hud_drawpal(210 + offsets.X, 261 + offsets.Y, FLAMETHROWER, shade, o, pal, angle); + hud_drawpal(210 + offsets.X, 261 + offsets.Y, FLAMETHROWERPILOT, shade, o, pal, angle); } else { - static const uint8_t cat_frames[] = { 0, 0, 1, 1, 2, 2 }; + static constexpr uint8_t cat_frames[] = { 0, 0, 1, 1, 2, 2 }; + if (p->GetActor()->spr.pal != 1) { - weapon_xoffset += krand() & 1; - looking_arc += krand() & 1; + offsets.X += krand() & 1; + offsets.Y += krand() & 1; } - gun_pos -= 16; - hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 261 - gun_pos, FLAMETHROWER + 1, -32, o, pal); - hud_drawpal(weapon_xoffset + 210 - look_anghalf, looking_arc + 235 - gun_pos, FLAMETHROWER + 2 + cat_frames[*kb % 6], -32, o, pal); + + offsets.Y += 16; + + hud_drawpal(210 + offsets.X, 261 + offsets.Y, FLAMETHROWER + 1, -32, o, pal, angle); + hud_drawpal(210 + offsets.X, 235 + offsets.Y, FLAMETHROWER + 2 + cat_frames[*kb % 6], -32, o, pal, angle); } };