Spawning "models/player.mdl" ragdoll causes instant server crash


One of the players on my Sandbox server discovered that spawning the models/player.mdl ragdoll will crash the server. Unless I am mistaken, this is the same model that is used when a player fails to load in the server properly:

I believe you can find this model in one of the VPKs linked by garrysmod/sourceengine/hl2_misc_dir.vpk (SRCDS installation).

I realize this can be blocked with something as simple as

hook.Add( "PlayerSpawnRagdoll", "PreventPlayerRagdollCrash", function( ply, model )      
      if ( model == "models/player.mdl" ) then return false else return true end 

I played at the thought of trying to remove it from the VPK archive, but remembered the model is actually used for real purposes.

My question then is why does this ragdoll cause the server to crash?

Is there something that can be done to prevent this without requiring server owners to patch it?

It’s not a ragdoll.

I’m not particularly interested in what to call it. I’m only calling it a ragdoll because it’s the PlayerSpawnRagdoll hook that gets called when it’s spawned.

I am more concerned as to why the crash occurs and whether there is anything that can be done to prevent people from going onto any server, spawning it, and effectively crashing it without requiring every operator to patch it.

How do you know that’s the hook that gets called when the model crashes the server? Afaik, it’s not a ragdoll, so you gotta use a different hook to prevent it from spawning.

I stated in my first post that it was patchable with something as trivial as checking the model in the PlayerSpawnRagdoll hook. Adding a print statement shows the models/player.mdl model is trying to be spawned.

I’ve just spawned it fine in single player and a listen server, going to try dedicated in a minute.

I haven’t checked whether the PlayerSpawnRagdoll hook gets called or not, but I’d be surprised if it does because when that model spawns it spawns as an effect (with the green ring around the bottom and no physics).

[editline]23rd December 2013[/editline]


I spawned it in singleplayer and I crashed.

Thank you for looking into it, wh1t3rabbit and code_gs.

I just installed a vanilla sandbox server and spawned it just fine there as well. However, when running this in console:

My vanilla server prints nothing, while both my main servers print back, meaning something is causing models/player.mdl to be treated as a ragdoll. I can’t think of anything that would possibly do that, intentionally or not.

It crashes for me too in singleplayer, btw.

it works fine for me singleplayer and multiplayer

" [EV] :heart:Nyan Cat​:heart: (STEAM_0:0:29473971) spawned (prop_effect) models/props_junk/watermelon01.mdl "
IT is spawned as a prop_effect for me