From 15b223840b3410d7db533c1b6ef42ecb751e2db1 Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 22 Nov 2017 05:23:28 +0000 Subject: [PATCH] Useless removal of a couple of redundant blocks of code git-svn-id: https://svn.eduke32.com/eduke32@6499 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.cpp | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index ee849986e..d49cfcce3 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -1383,8 +1383,8 @@ static void Yax_SetBunchInterpolation(int32_t sectnum, int32_t cf) // A_Spawn has two forms with arguments having different meaning: // -// 1. j>=0: Spawn from parent sprite with picnum -// 2. j<0: Spawn from already *existing* sprite +// 1. spriteNum>=0: Spawn from parent sprite with picnum +// 2. spriteNum<0: Spawn from already *existing* sprite int A_Spawn(int spriteNum, int tileNum) { int newSprite; @@ -1740,28 +1740,15 @@ int A_Spawn(int spriteNum, int tileNum) { updatesector(pSprite->x - 108, pSprite->y + 108, &pukeSect); if (pukeSect >= 0 && sector[pukeSect].floorz != sector[pSprite->sectnum].floorz) - { - pSprite->xrepeat = pSprite->yrepeat = 0; - changespritestat(newSprite, STAT_MISC); - break; - } - } - else - { - pSprite->xrepeat = pSprite->yrepeat = 0; - changespritestat(newSprite, STAT_MISC); - break; + goto zero_puke; } + else goto zero_puke; } - else - { - pSprite->xrepeat = pSprite->yrepeat = 0; - changespritestat(newSprite, STAT_MISC); - break; - } + else goto zero_puke; } else { + zero_puke: pSprite->xrepeat = pSprite->yrepeat = 0; changespritestat(newSprite, STAT_MISC); break; @@ -1972,20 +1959,13 @@ int A_Spawn(int spriteNum, int tileNum) break; } } - else - { - pSprite->xrepeat = pSprite->yrepeat = 0; - break; - } - } - else - { - pSprite->xrepeat = pSprite->yrepeat = 0; - break; + else goto zero_footprint; } + else goto zero_footprint; } else { + zero_footprint: pSprite->xrepeat = pSprite->yrepeat = 0; break; }