Permalink
Browse files

Fixed gmod_admin_cleanup and gmod_cleanup errors when run in a dedica…

…ted server console.
  • Loading branch information...
1 parent 33aea39 commit 549ab12d0469ccf3f8ec10d5b02b59293c7c3702 @Bo98 Bo98 committed Apr 25, 2014
Showing with 4 additions and 2 deletions.
  1. +4 −2 garrysmod/lua/includes/modules/cleanup.lua
@@ -96,6 +96,8 @@ if ( SERVER ) then
function CC_Cleanup( pl, command, args )
+
+ if ( !IsValid( pl ) ) then return end
local id = pl:UniqueID()
@@ -168,7 +170,7 @@ if ( SERVER ) then
game.CleanUpMap()
-- Send tooltip command to client
- pl:SendLua( "GAMEMODE:OnCleanup( 'all' )" )
+ if ( IsValid( pl ) ) then pl:SendLua( "GAMEMODE:OnCleanup( 'all' )" ) end
return
@@ -193,7 +195,7 @@ if ( SERVER ) then
end
-- Send tooltip command to client
- pl:SendLua( "GAMEMODE:OnCleanup( '"..args[1].."' )" )
+ if ( IsValid( pl ) ) then pl:SendLua( "GAMEMODE:OnCleanup( '"..args[1].."' )" ) end
end

0 comments on commit 549ab12

Please sign in to comment.