From 0b674b7bca263b0d988127717bc972095511912f Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 29 Jul 2015 23:52:58 -0500 Subject: [PATCH] Fix rare crash on player disconnect --- mods/physics/init.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mods/physics/init.lua b/mods/physics/init.lua index 6e38503..386d97f 100755 --- a/mods/physics/init.lua +++ b/mods/physics/init.lua @@ -16,9 +16,11 @@ function physics.adjust_physics(player,_physics) end function physics.apply(player) - local name = player:get_player_name() - if physics.player_frozen[name] ~= true then - player:set_physics_override(physics.player_physics[name]) + if player ~= nil then + local name = player:get_player_name() + if physics.player_frozen[name] ~= true then + player:set_physics_override(physics.player_physics[name]) + end end end