From f746d17424a071c15fd5b92bc521ce832ba15a07 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 4 Jun 2013 21:05:33 +0000 Subject: ProtectionAreas: Actual protection is now working, areas are hard-coded (10,10) - (20,20) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1557 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/ProtectionAreas/PlayerAreas.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'MCServer/Plugins/ProtectionAreas/PlayerAreas.lua') diff --git a/MCServer/Plugins/ProtectionAreas/PlayerAreas.lua b/MCServer/Plugins/ProtectionAreas/PlayerAreas.lua index 472a4c59b..5d054ea15 100644 --- a/MCServer/Plugins/ProtectionAreas/PlayerAreas.lua +++ b/MCServer/Plugins/ProtectionAreas/PlayerAreas.lua @@ -11,7 +11,7 @@ A player can interact with a block if either one of these is true: 2, There is at least one area covering the block with IsAllowed set to true The OOP class implementation follows the PiL 16.1 -Also, a global table g_PlayerAreas is the actual map of PlayerName -> cPlayerAreas +Also, a global table g_PlayerAreas is the actual map of PlayerID -> cPlayerAreas --]] @@ -37,7 +37,7 @@ end -- Adds a new cuboid to the area list, where the player is either allowed or not, depending on the IsAllowed param function cPlayerAreas:AddArea(a_Cuboid, a_IsAllowed) - table.add(self, {Cuboid = a_Cuboid, IsAllowed = a_IsAllowed}); + table.insert(self, {Cuboid = a_Cuboid, IsAllowed = a_IsAllowed}); end @@ -45,7 +45,7 @@ end --- returns true if the player owning this object can interact with the specified block -function cPlayerAreas:CanInteract(a_BlockX, a_BlockY, a_BlockZ) +function cPlayerAreas:CanInteractWithBlock(a_BlockX, a_BlockY, a_BlockZ) -- iterate through all the stored areas: local IsInsideAnyArea = false; for idx, Area in ipairs(self) do -- cgit v1.2.3