From: fgsfds Date: Tue, 6 Feb 2018 23:03:59 +0000 (+0300) Subject: fixed texture switch bug AGAIN X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=5929d2a7e4ac7aef4d49bdef3bef3ef506e4b9b0;p=d2df-sdl.git fixed texture switch bug AGAIN --- 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