From 2adf62e22e1a12a16318431dfe37516a1c945776 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 10 Jun 2013 07:21:52 +0000 Subject: ProtectionAreas: Implemented reloading areas when a player moves git-svn-id: http://mc-server.googlecode.com/svn/trunk@1575 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/ProtectionAreas/Storage.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'MCServer/Plugins/ProtectionAreas/Storage.lua') diff --git a/MCServer/Plugins/ProtectionAreas/Storage.lua b/MCServer/Plugins/ProtectionAreas/Storage.lua index 10cc469e5..e21b128d5 100644 --- a/MCServer/Plugins/ProtectionAreas/Storage.lua +++ b/MCServer/Plugins/ProtectionAreas/Storage.lua @@ -192,7 +192,17 @@ function cStorage:LoadPlayerAreas(a_PlayerName, a_PlayerX, a_PlayerZ, a_WorldNam local BoundsMinZ = a_PlayerZ - g_AreaBounds; local BoundsMaxZ = a_PlayerZ + g_AreaBounds; - local res = cPlayerAreas:new(); + local res = cPlayerAreas:new( + BoundsMinX + g_AreaSafeEdge, BoundsMinZ + g_AreaSafeEdge, + BoundsMaxX - g_AreaSafeEdge, BoundsMaxZ - g_AreaSafeEdge + ); + + --[[ + LOG("Loading protection areas for player " .. a_PlayerName .. " centered around {" .. a_PlayerX .. ", " .. a_PlayerZ .. + "}, bounds are {" .. BoundsMinX .. ", " .. BoundsMinZ .. "} - {" .. + BoundsMaxX .. ", " .. BoundsMaxZ .. "}" + ); + --]] -- Load the areas from the DB, based on the player's location local sql = -- cgit v1.2.3