From 5929d2a7e4ac7aef4d49bdef3bef3ef506e4b9b0 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 7 Feb 2018 02:03:59 +0300 Subject: [PATCH] fixed texture switch bug AGAIN --- src/game/g_netmsg.pas | 14 +++----------- src/game/g_panel.pas | 18 ++---------------- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index ce4238a..b98681b 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -2364,17 +2364,9 @@ begin TP := g_Map_PanelByGUID(PGUID); if (TP <> nil) then begin - if Loop = 0 then - begin - // switch texture - TP.SetTexture(Tex, Loop); - TP.SetFrame(Fr, Cnt); - end - else - begin - // looped or non-looped animation - TP.NextTexture(Loop); - end; + // switch texture + TP.SetTexture(Tex, Loop); + TP.SetFrame(Fr, Cnt); end; end; diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas index d0eb1ce..490a728 100644 --- a/src/game/g_panel.pas +++ b/src/game/g_panel.pas @@ -957,22 +957,8 @@ end; procedure TPanel.SetTexture(ID: Integer; AnimLoop: Byte = 0); begin -// Íåò òåêñòóð: - if Length(FTextureIDs) = 0 then - FCurTexture := -1 - else - // Òîëüêî îäíà òåêñòóðà: - if Length(FTextureIDs) = 1 then - begin - if (ID = 0) or (ID = -1) then - FCurTexture := ID; - end - else - // Áîëüøå îäíîé òåêñòóðû: - begin - if (ID >= -1) and (ID <= High(FTextureIDs)) then - FCurTexture := ID; - end; + if (ID >= -1) and (ID < Length(FTextureIDs)) then + FCurTexture := ID; // Ïåðåêëþ÷èëèñü íà âèäèìóþ àíèì. òåêñòóðó: if (FCurTexture >= 0) and FTextureIDs[FCurTexture].Anim then -- 2.29.2