From 6ebb2d76015660354a7220a4f84a3b0c095053a7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 21 Nov 2021 12:02:07 +0100 Subject: [PATCH] - swingdacrunch --- source/games/whaven/src/weapons.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/source/games/whaven/src/weapons.cpp b/source/games/whaven/src/weapons.cpp index 1ace9211c..9cf2eb5b1 100644 --- a/source/games/whaven/src/weapons.cpp +++ b/source/games/whaven/src/weapons.cpp @@ -2405,46 +2405,47 @@ void swingdaweapon(PLAYER& plr) { void swingdacrunch(PLAYER& plr, int daweapon) { + auto& pspr = sprite[player->spritenum]; switch (daweapon) { case 0: // fist - spritesound(S_SOCK1 + (krand() % 4), &sprite[plr.spritenum]); + spritesound(S_SOCK1 + (krand() % 4), &pspr); break; case 1: // dagger if ((krand() % 2) != 0) - spritesound(S_GORE1 + (krand() % 4), &sprite[plr.spritenum]); + spritesound(S_GORE1 + (krand() % 4), &pspr); break; case 2: // short sword - spritesound(S_SWORD2 + (krand() % 3), &sprite[plr.spritenum]); + spritesound(S_SWORD2 + (krand() % 3), &pspr); break; case 3: // morningstar - spritesound(S_SOCK1 + (krand() % 4), &sprite[plr.spritenum]); + spritesound(S_SOCK1 + (krand() % 4), &pspr); break; case 4: // broad sword - spritesound(S_SWORD1 + (krand() % 3), &sprite[plr.spritenum]); + spritesound(S_SWORD1 + (krand() % 3), &pspr); break; case 5: // battle axe if ((krand() % 2) != 0) - spritesound(S_SOCK1 + (krand() % 4), &sprite[plr.spritenum]); + spritesound(S_SOCK1 + (krand() % 4), &pspr); else - spritesound(S_SWORD1 + (krand() % 3), &sprite[plr.spritenum]); + spritesound(S_SWORD1 + (krand() % 3), &pspr); break; case 6: // bow break; case 7: // pike if ((krand() % 2) != 0) - spritesound(S_SOCK1 + (krand() % 4), &sprite[plr.spritenum]); + spritesound(S_SOCK1 + (krand() % 4), &pspr); else - spritesound(S_SWORD1 + (krand() % 3), &sprite[plr.spritenum]); + spritesound(S_SWORD1 + (krand() % 3), &pspr); break; case 8: // two handed sword - spritesound(S_SWORD1 + (krand() % 2), &sprite[plr.spritenum]); + spritesound(S_SWORD1 + (krand() % 2), &pspr); break; case 9: // halberd if ((krand() % 2) != 0) - spritesound(S_SOCK1 + (krand() % 4), &sprite[plr.spritenum]); + spritesound(S_SOCK1 + (krand() % 4), &pspr); else - spritesound(S_SWORD1 + (krand() % 3), &sprite[plr.spritenum]); + spritesound(S_SWORD1 + (krand() % 3), &pspr); break; } }