DEADSOFTWARE

Fix model override option not changing bots' models
authorChallenge9 <letsgo9632@gmail.com>
Tue, 25 Apr 2023 20:55:53 +0000 (23:55 +0300)
committerTerminalHash <lyashuk.voxx@gmail.com>
Wed, 26 Apr 2023 10:53:50 +0000 (13:53 +0300)
src/game/g_player.pas

index 92e2902aa82105d0169cdc71664e1797e9f95906..a7afb5c9d17116a2ed8a5624ec881c62124056c7 100644 (file)
@@ -857,6 +857,8 @@ begin
 
   gPlayers[a].FActualModelName := ModelName;
   gPlayers[a].SetModel(ModelName);
+  if Bot and (g_Force_Model_Get() <> 0) then
+    gPlayers[a].SetModel(g_Forced_Model_GetName());
 
 // Íåò ìîäåëè - ñîçäàíèå íå âîçìîæíî:
   if gPlayers[a].FModel = nil then
@@ -925,7 +927,11 @@ begin
 
   // create entity and load state
   if Bot then
-    gPlayers[a] := TBot.Create()
+  begin
+    gPlayers[a] := TBot.Create();
+    if (g_Force_Model_Get() <> 0) then
+      gPlayers[a].SetModel(g_Forced_Model_GetName());
+  end
   else
     gPlayers[a] := TPlayer.Create();
   gPlayers[a].FPhysics := True; // ???