From f40fadc72117be3ea8b5368aeef2a8649762d82d Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 4 Jan 2016 13:54:27 -0500 Subject: Added angle snapping --- gamemode/itemsystem/items/shack.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gamemode/itemsystem/items/shack.lua') diff --git a/gamemode/itemsystem/items/shack.lua b/gamemode/itemsystem/items/shack.lua index 9090fb3..96790d6 100644 --- a/gamemode/itemsystem/items/shack.lua +++ b/gamemode/itemsystem/items/shack.lua @@ -1,7 +1,7 @@ ITEM.Name = "Shack" ITEM.Class = "structure" -ITEM.Desc = "An actual building... how convenient." +ITEM.Desc = "An actual building... how convenient.\nHold down shift to snap" ITEM.Model = "models/props_debris/wood_board07a.mdl" ITEM.Icon = Material("settlement/icon_shack") ITEM.Recipe = { @@ -83,10 +83,11 @@ function ITEM:OnPrimary(pl,tr) local Ang = Angle(0,pl:GetAimVector():Angle().y+90,0) local Pos = tr.HitPos - if(GM:KeyPress(pl,IN_SPEED)) then + if(pl:KeyDown(IN_SPEED)) then Pos.x = Pos.x - (Pos.x%20) Pos.y = Pos.y - (Pos.y%20) Pos.z = Pos.z - (Pos.z%20) + Ang.yaw = Ang.yaw - (Ang.yaw%15) end for k,v in pairs(self.Ghost) do -- cgit v1.2.3-70-g09d2