From f4d31db33eb2d2fd97d0a073f56332d224259523 Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sat, 5 Sep 2026 09:18:19 +0700 Subject: [PATCH] [saco] Correct `CGame::CreateWeaponPickup` to inline the model wait; calling `IsModelLoaded` and friends out of line was wrong, the only delta left is MSVC rotating the wait loop where retail leaves it top tested --- saco/game/game.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/saco/game/game.cpp b/saco/game/game.cpp index 3f260b9..4ebc116 100644 --- a/saco/game/game.cpp +++ b/saco/game/game.cpp @@ -1093,10 +1093,13 @@ DWORD CGame::CreateWeaponPickup(int iModel, DWORD dwAmmo, float fX, float fY, fl { DWORD hnd; - if(!IsModelLoaded(iModel)) { - RequestModel(iModel); - LoadRequestedModels(); - while(!IsModelLoaded(iModel)) Sleep(5); + // the model wait is spelled out, none of the model helpers are inline here + if(iModel <= 20000 && iModel >= 0 && !ScriptCommand(&is_model_available, iModel)) + { + ScriptCommand(&request_model, iModel); + ScriptCommand(&load_requested_models); + + while(!ScriptCommand(&is_model_available, iModel)) Sleep(5); } ScriptCommand(&create_pickup_with_ammo, iModel, 4, dwAmmo, fX, fY, fZ, &hnd);