From cd3947f3f4eca503ef77a850b38e7e2dbad842b2 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 24 Mar 2012 15:59:39 +0000 Subject: [PATCH] Correct 'nofloorpalrange' range clamping, move one get_hud_pal() farther down. The nofloorpalrange beginning and end indices are silently clamped to 1 .. 255. git-svn-id: https://svn.eduke32.com/eduke32@2524 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 2 +- polymer/eduke32/source/player.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 836583c2e..1ff846cac 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8480,7 +8480,7 @@ static int32_t parsedefinitions_game(scriptfile *script, int32_t preload) if (scriptfile_getnumber(script,&e)) break; b = max(b, 1); - e = min(e, MAXPALOOKUPS); + e = min(e, MAXPALOOKUPS-1); for (i=b; i<=e; i++) g_noFloorPal[i] = 1; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index fc6034516..2d5723d62 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -2218,12 +2218,10 @@ void P_DoWeaponSpawn(DukePlayer_t *p) void P_DisplayScuba(int32_t snum) { - int32_t p; - - p = get_hud_pal(g_player[snum].ps); - if (g_player[snum].ps->scuba_on) { + int32_t p = get_hud_pal(g_player[snum].ps); + rotatesprite_win(43<<16,(200-tilesizy[SCUBAMASK])<<16,65536,0,SCUBAMASK,0,p,2+16); rotatesprite_win((320-43)<<16,(200-tilesizy[SCUBAMASK])<<16,65536,1024,SCUBAMASK,0,p,2+4+16); }