ProtectionAreas: Fixed area reloading

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1574 0a769ca7-a7f5-676a-18bf-c427514a06d6
master
madmaxoft@gmail.com 2013-06-10 06:47:03 +00:00
parent 1c1e289b3d
commit ed06d13b5c
2 changed files with 9 additions and 2 deletions

View File

@ -293,6 +293,9 @@ function HandleRemoveUser(a_Split, a_Player)
-- Send confirmation -- Send confirmation
a_Player:SendMessage("Removed " .. UserName .. " from area " .. AreaID); a_Player:SendMessage("Removed " .. UserName .. " from area " .. AreaID);
-- Reload all currently logged in players
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
return true; return true;
end end
@ -309,6 +312,10 @@ function HandleRemoveUserAll(a_Split, a_Player)
-- Remove the user from the DB -- Remove the user from the DB
g_Storage:RemoveUserAll(a_Split[2], a_Player:GetWorld():GetName()); g_Storage:RemoveUserAll(a_Split[2], a_Player:GetWorld():GetName());
-- Reload all currently logged in players
ReloadAllPlayersInWorld(a_Player:GetWorld():GetName());
return true; return true;
end end

View File

@ -186,14 +186,14 @@ function cStorage:LoadPlayerAreas(a_PlayerName, a_PlayerX, a_PlayerZ, a_WorldNam
assert(a_WorldName); assert(a_WorldName);
assert(self); assert(self);
res = cPlayerAreas:new();
-- Bounds for which the areas are loaded -- Bounds for which the areas are loaded
local BoundsMinX = a_PlayerX - g_AreaBounds; local BoundsMinX = a_PlayerX - g_AreaBounds;
local BoundsMaxX = a_PlayerX + g_AreaBounds; local BoundsMaxX = a_PlayerX + g_AreaBounds;
local BoundsMinZ = a_PlayerZ - g_AreaBounds; local BoundsMinZ = a_PlayerZ - g_AreaBounds;
local BoundsMaxZ = a_PlayerZ + g_AreaBounds; local BoundsMaxZ = a_PlayerZ + g_AreaBounds;
local res = cPlayerAreas:new();
-- Load the areas from the DB, based on the player's location -- Load the areas from the DB, based on the player's location
local sql = local sql =
"SELECT ID, MinX, MaxX, MinZ, MaxZ FROM Areas WHERE " .. "SELECT ID, MinX, MaxX, MinZ, MaxZ FROM Areas WHERE " ..