DEADSOFTWARE

Ignore file extensions for animations with numeric postfix
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Thu, 17 Jan 2019 14:27:17 +0000 (17:27 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Thu, 17 Jan 2019 14:27:17 +0000 (17:27 +0300)
src/game/g_map.pas

index 97c56d0c399f8682f3122caa345d79ac9a28aa05..35e8d46a6078d31326c79dc63af187ad03e74d17 100644 (file)
@@ -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