From cc4a1cad399cc6a2617c1cdf02f9417eec2c4263 Mon Sep 17 00:00:00 2001 From: "nielsbreu@gmail.com" Date: Fri, 5 Jul 2013 11:13:21 +0000 Subject: Reduced the amount of tables. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1644 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Core/back.lua | 4 ++-- MCServer/Plugins/Core/functions.lua | 4 +--- MCServer/Plugins/Core/main.lua | 4 +--- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'MCServer/Plugins') diff --git a/MCServer/Plugins/Core/back.lua b/MCServer/Plugins/Core/back.lua index ade1c9d64..63ec1d857 100644 --- a/MCServer/Plugins/Core/back.lua +++ b/MCServer/Plugins/Core/back.lua @@ -1,8 +1,8 @@ function HandleBackCommand( Split, Player ) - if (X[Player:GetName()] == nil) or (Y[Player:GetName()] == nil) or (Z[Player:GetName()] == nil) then + if BackCoords[Player:GetName()] == nil then Player:SendMessage(cChatColor.Green .. "There is no last position known") else - Player:TeleportToCoords(X[Player:GetName()], Y[Player:GetName()], Z[Player:GetName()]) + Player:TeleportToCoords(BackCoords[Player:GetName()].x, BackCoords[Player:GetName()].y, BackCoords[Player:GetName()].z) Player:SendMessage(cChatColor.Green .. "You teleported back to your last known position") end return true diff --git a/MCServer/Plugins/Core/functions.lua b/MCServer/Plugins/Core/functions.lua index 6d82d2253..36fb3786f 100644 --- a/MCServer/Plugins/Core/functions.lua +++ b/MCServer/Plugins/Core/functions.lua @@ -1,5 +1,3 @@ function SetBackCoordinates( Player ) - X[Player:GetName()] = Player:GetPosX() - Y[Player:GetName()] = Player:GetPosY() - Z[Player:GetName()] = Player:GetPosZ() + BackCoords[Player:GetName()] = Vector3i( Player:GetPosX(), Player:GetPosY(), Player:GetPosZ() ) end \ No newline at end of file diff --git a/MCServer/Plugins/Core/main.lua b/MCServer/Plugins/Core/main.lua index fa67dc977..acdcd1606 100644 --- a/MCServer/Plugins/Core/main.lua +++ b/MCServer/Plugins/Core/main.lua @@ -7,9 +7,7 @@ SHOW_PLUGIN_NAMES = true -- If true, plugin name will be shown before commands PLUGIN = {} -- Reference to own plugin object BannedPlayersIni = {} WhiteListIni = {} -X = {} -Y = {} -Z = {} +BackCoords = {} LimitWorldsCuboid = {} -- cgit v1.2.3