From 08d855c39f6bc94e9eb4f47345a506c825f8579d Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Thu, 17 Jan 2019 17:27:17 +0300 Subject: [PATCH] Ignore file extensions for animations with numeric postfix --- src/game/g_map.pas | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/game/g_map.pas b/src/game/g_map.pas index 97c56d0..35e8d46 100644 --- a/src/game/g_map.pas +++ b/src/game/g_map.pas @@ -435,17 +435,19 @@ end; // ////////////////////////////////////////////////////////////////////////// // var NNF_PureName: String; // Èìÿ òåêñòóðû áåç öèôð â êîíöå + NNF_PureExt: String; // extension postfix NNF_FirstNum: Integer; // ×èñëî ó íà÷àëüíîé òåêñòóðû NNF_CurrentNum: Integer; // Ñëåäóþùåå ÷èñëî ó òåêñòóðû function g_Texture_NumNameFindStart(name: String): Boolean; var - i: Integer; + i, j: Integer; begin Result := False; NNF_PureName := ''; + NNF_PureExt := ''; NNF_FirstNum := -1; NNF_CurrentNum := -1; @@ -458,8 +460,11 @@ begin end else begin + j := i + 1; + while (j <= Length(name)) and (name[j] <> '.') do inc(j); NNF_PureName := Copy(name, 1, i); - Delete(name, 1, i); + NNF_PureExt := Copy(name, j); + name := Copy(name, i + 1, j - i - 1); Break; end; end; @@ -483,7 +488,7 @@ begin Exit; end; - newName := NNF_PureName + IntToStr(NNF_CurrentNum); + newName := NNF_PureName + IntToStr(NNF_CurrentNum) + NNF_PureExt; if NNF_CurrentNum < NNF_FirstNum then Result := NNF_NAME_BEFORE -- 2.29.2