Skip to content

Commit 331f875

Browse files
Remove restoreElementBaseModels() from onClientResourceStop event handler
This fixes the crashes when disconnecting/stopping the resource and there's a ped/player element loaded. The error happened because trying to set the element model of an already destroyed element causes a memory access violation error and crashed the game. The ped/player elements were destroyed automatically by the engine when disconnecting, so this line is not necessary.
1 parent 854ca29 commit 331f875

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

newmodels_azul/scripts/core/client_logic.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ addEventHandler("newmodels_azul:receiveCustomModels", resourceRoot, function(cus
399399
end, false)
400400

401401
addEventHandler("onClientResourceStop", resourceRoot, function()
402-
restoreElementBaseModels()
403402
-- Free all allocated models instantly
404403
for customModel, _ in pairs(loadedModels) do
405404
freeAllocatedModelNow(customModel)

0 commit comments

Comments
 (0)