Facepunch / garrysmod-issues

Garry's Mod issue tracker
143 stars 56 forks source link

:SetModel causes strange desync when used on player with with certain models #6020

Open wrefgtzweve opened 1 week ago

wrefgtzweve commented 1 week ago

For some reason using :SetModel() on another player clientside causes some kind of desync issue, i'm honestly not sure what to call this. It happens on p2p x86_64 and srcds linux main branch.

Basegame model example:

bot:SetModel( "models/props_c17/FurnitureFridge001a.mdl" )

Workshop GMA example code:

steamworks.DownloadUGC( "1982247237", function( path )
    game.MountGMA( path )
    bot:SetModel( "models/player/fillipuster/fillipuster.mdl" )
end)

https://github.com/user-attachments/assets/374f2f6d-f7bc-490b-8d67-fb8e8a139045

robotboy655 commented 1 week ago

This happens because the model is not precached on the server, so when you use the SetModel on client, internally the entity's model index clientside is set to the "invalid index" which causes issues for some reason. This applies to any entity, not just players as far as I can tell, at the very least it happens on prop_physics as well.

wrefgtzweve commented 1 week ago

Yeah i can confirm that precaching the models serverside fixes it 👍