From: Stas'M Date: Thu, 17 May 2018 18:48:46 +0000 (+0300) Subject: Panel: Fix SetFrame out of index X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=10a6a314ac8316afcd61dc7071bda8261b0dbb45;p=d2df-sdl.git Panel: Fix SetFrame out of index http://doom2d.org/forum/viewtopic.php?f=36&t=2576 --- diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas index c95c271..c3d8224 100644 --- a/src/game/g_panel.pas +++ b/src/game/g_panel.pas @@ -906,7 +906,7 @@ begin (FTextureIDs[FCurTexture].AnTex <> nil) and (Width > 0) and (Height > 0) and (FAlpha < 255) then begin - FCurFrame := ClampInt(Frame, 0, FTextureIDs[FCurTexture].AnTex.TotalFrames); + FCurFrame := ClampInt(Frame, 0, FTextureIDs[FCurTexture].AnTex.TotalFrames - 1); FCurFrameCount := Count; FTextureIDs[FCurTexture].AnTex.CurrentFrame := FCurFrame; FTextureIDs[FCurTexture].AnTex.CurrentCounter := FCurFrameCount;