From 698b6eedf1d6d2806c77895775bcf8245ce02229 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 4 Jan 2016 13:26:04 -0500 Subject: Added building snap --- gamemode/itemsystem/items/alter.lua | 8 +++++++- gamemode/itemsystem/items/campfire.lua | 8 +++++++- gamemode/itemsystem/items/fence.lua | 8 +++++++- gamemode/itemsystem/items/floor.lua | 8 +++++++- gamemode/itemsystem/items/infuser.lua | 8 +++++++- gamemode/itemsystem/items/ramp.lua | 8 +++++++- gamemode/itemsystem/items/researchtable.lua | 8 +++++++- gamemode/itemsystem/items/shack.lua | 6 ++++++ gamemode/itemsystem/items/tent.lua | 5 +++++ gamemode/shared/player_ghost.lua | 5 +++++ 10 files changed, 65 insertions(+), 7 deletions(-) diff --git a/gamemode/itemsystem/items/alter.lua b/gamemode/itemsystem/items/alter.lua index 31d1b4f..b60d30b 100644 --- a/gamemode/itemsystem/items/alter.lua +++ b/gamemode/itemsystem/items/alter.lua @@ -52,7 +52,13 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then local drop = ents.Create("ws_alter") drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) - drop:SetPos(tr.HitPos) + local Pos = tr.HitPos + if(GM:KeyPress(pl,IN_SPEED)) then + Pos.x = Pos.x - (Pos.x%20) + Pos.y = Pos.y - (Pos.y%20) + Pos.z = Pos.z - (Pos.z%20) + end + drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/campfire.lua b/gamemode/itemsystem/items/campfire.lua index 5cc4987..f6ec4e6 100644 --- a/gamemode/itemsystem/items/campfire.lua +++ b/gamemode/itemsystem/items/campfire.lua @@ -68,7 +68,13 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit and tr.HitWorld) then local drop = ents.Create("ws_campfire") drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) - drop:SetPos(tr.HitPos) + local Pos = tr.HitPos + if(GM:KeyPress(pl,IN_SPEED)) then + Pos.x = Pos.x - (Pos.x%20) + Pos.y = Pos.y - (Pos.y%20) + Pos.z = Pos.z - (Pos.z%20) + end + drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/fence.lua b/gamemode/itemsystem/items/fence.lua index e4a8217..d472aaa 100644 --- a/gamemode/itemsystem/items/fence.lua +++ b/gamemode/itemsystem/items/fence.lua @@ -45,7 +45,13 @@ function ITEM:OnPrimary(pl,tr) local drop = ents.Create("ws_prop") drop:SetModel("models/props_wasteland/wood_fence02a.mdl") drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) - drop:SetPos(tr.HitPos) + local Pos = tr.HitPos + if(GM:KeyPress(pl,IN_SPEED)) then + Pos.x = Pos.x - (Pos.x%20) + Pos.y = Pos.y - (Pos.y%20) + Pos.z = Pos.z - (Pos.z%20) + end + drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/floor.lua b/gamemode/itemsystem/items/floor.lua index c02815b..82eb3ec 100644 --- a/gamemode/itemsystem/items/floor.lua +++ b/gamemode/itemsystem/items/floor.lua @@ -46,7 +46,13 @@ function ITEM:OnPrimary(pl,tr) local drop = ents.Create("ws_prop") drop:SetModel("models/props_wasteland/wood_fence02a.mdl") drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,90)) - drop:SetPos(tr.HitPos) + local Pos = tr.HitPos + if(GM:KeyPress(pl,IN_SPEED)) then + Pos.x = Pos.x - (Pos.x%20) + Pos.y = Pos.y - (Pos.y%20) + Pos.z = Pos.z - (Pos.z%20) + end + drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/infuser.lua b/gamemode/itemsystem/items/infuser.lua index d2f72ad..260e8fd 100644 --- a/gamemode/itemsystem/items/infuser.lua +++ b/gamemode/itemsystem/items/infuser.lua @@ -43,7 +43,13 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then local drop = ents.Create("ws_infuser") drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) - drop:SetPos(tr.HitPos) + local Pos = tr.HitPos + if(GM:KeyPress(pl,IN_SPEED)) then + Pos.x = Pos.x - (Pos.x%20) + Pos.y = Pos.y - (Pos.y%20) + Pos.z = Pos.z - (Pos.z%20) + end + drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/ramp.lua b/gamemode/itemsystem/items/ramp.lua index 96e6c27..9d6fd2b 100644 --- a/gamemode/itemsystem/items/ramp.lua +++ b/gamemode/itemsystem/items/ramp.lua @@ -46,7 +46,13 @@ function ITEM:OnPrimary(pl,tr) local drop = ents.Create("ws_prop") drop:SetModel("models/props_wasteland/wood_fence02a.mdl") drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,45)) - drop:SetPos(tr.HitPos) + local Pos = tr.HitPos + if(GM:KeyPress(pl,IN_SPEED)) then + Pos.x = Pos.x - (Pos.x%20) + Pos.y = Pos.y - (Pos.y%20) + Pos.z = Pos.z - (Pos.z%20) + end + drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/researchtable.lua b/gamemode/itemsystem/items/researchtable.lua index 4b05cf2..b347828 100644 --- a/gamemode/itemsystem/items/researchtable.lua +++ b/gamemode/itemsystem/items/researchtable.lua @@ -41,7 +41,13 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then local drop = ents.Create("ws_researchtable") drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) - drop:SetPos(tr.HitPos) + local Pos = tr.HitPos + if(GM:KeyPress(pl,IN_SPEED)) then + Pos.x = Pos.x - (Pos.x%20) + Pos.y = Pos.y - (Pos.y%20) + Pos.z = Pos.z - (Pos.z%20) + end + drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/shack.lua b/gamemode/itemsystem/items/shack.lua index f66fe38..9090fb3 100644 --- a/gamemode/itemsystem/items/shack.lua +++ b/gamemode/itemsystem/items/shack.lua @@ -83,6 +83,12 @@ 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 + Pos.x = Pos.x - (Pos.x%20) + Pos.y = Pos.y - (Pos.y%20) + Pos.z = Pos.z - (Pos.z%20) + end + for k,v in pairs(self.Ghost) do local Off = v.Pos*1 Off:Rotate(Ang) diff --git a/gamemode/itemsystem/items/tent.lua b/gamemode/itemsystem/items/tent.lua index 1d5a1b5..3cbb207 100644 --- a/gamemode/itemsystem/items/tent.lua +++ b/gamemode/itemsystem/items/tent.lua @@ -50,6 +50,11 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then local Ang = Angle(0,pl:GetAimVector():Angle().y+90,0) local Pos = tr.HitPos + if(GM:KeyPress(pl,IN_SPEED)) then + Pos.x = Pos.x - (Pos.x%20) + Pos.y = Pos.y - (Pos.y%20) + Pos.z = Pos.z - (Pos.z%20) + end for k,v in pairs(self.Ghost) do local Off = v.Pos*1 diff --git a/gamemode/shared/player_ghost.lua b/gamemode/shared/player_ghost.lua index ef61422..d2eade8 100644 --- a/gamemode/shared/player_ghost.lua +++ b/gamemode/shared/player_ghost.lua @@ -54,6 +54,11 @@ else local CanP = pl:CanPlaceStructure(Pos) Pos = Pos.HitPos + 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) + end for k,v in pairs(pl.GhostItem.Ghost) do local OffPos = v.Pos*1 -- cgit v1.2.3-70-g09d2 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/alter.lua | 9 ++++++--- gamemode/itemsystem/items/campfire.lua | 9 ++++++--- gamemode/itemsystem/items/fence.lua | 8 +++++--- gamemode/itemsystem/items/floor.lua | 8 +++++--- gamemode/itemsystem/items/infuser.lua | 8 +++++--- gamemode/itemsystem/items/ramp.lua | 8 +++++--- gamemode/itemsystem/items/researchtable.lua | 8 +++++--- gamemode/itemsystem/items/shack.lua | 5 +++-- gamemode/itemsystem/items/tent.lua | 3 ++- gamemode/shared/player_ghost.lua | 1 + 10 files changed, 43 insertions(+), 24 deletions(-) diff --git a/gamemode/itemsystem/items/alter.lua b/gamemode/itemsystem/items/alter.lua index b60d30b..891f15c 100644 --- a/gamemode/itemsystem/items/alter.lua +++ b/gamemode/itemsystem/items/alter.lua @@ -1,7 +1,7 @@ ITEM.Name = "Alter" ITEM.Class = "structure" -ITEM.Desc = "This allows you to sacrifice your soul for a player." +ITEM.Desc = "This allows you to sacrifice your soul for a player.\nHold down shift to snap" ITEM.Model = "models/props_c17/gravestone003a.mdl" ITEM.Icon = Material("wintersurvival2/hud/ws2_icons/icon_crow.png") ITEM.Recipe = { @@ -51,13 +51,16 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then local drop = ents.Create("ws_alter") - drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) + local Aim = 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 + + drop:SetAngles(Angle(0,Aim,0)) drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/campfire.lua b/gamemode/itemsystem/items/campfire.lua index f6ec4e6..4e35932 100644 --- a/gamemode/itemsystem/items/campfire.lua +++ b/gamemode/itemsystem/items/campfire.lua @@ -1,7 +1,7 @@ ITEM.Name = "Campfire" ITEM.Class = "structure" -ITEM.Desc = "Ready to be lit. Some assembly required." +ITEM.Desc = "Ready to be lit. Some assembly required.\nHold down shift to snap" ITEM.Model = "models/props_debris/wood_board07a.mdl" ITEM.Icon = Material("wintersurvival2/hud/ws1_icons/icon_campfire") ITEM.Recipe = { @@ -67,13 +67,16 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit and tr.HitWorld) then local drop = ents.Create("ws_campfire") - drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) + local Aim = 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 + drop:SetAngles(Aim) drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/fence.lua b/gamemode/itemsystem/items/fence.lua index d472aaa..8616a09 100644 --- a/gamemode/itemsystem/items/fence.lua +++ b/gamemode/itemsystem/items/fence.lua @@ -1,7 +1,7 @@ ITEM.Name = "Fence" ITEM.Class = "structure" -ITEM.Desc = "Some basic wood structure for setting up camps." +ITEM.Desc = "Some basic wood structure for setting up camps.\nHold down shift to snap" ITEM.Model = "models/props_debris/wood_board07a.mdl" ITEM.Icon = Material("wintersurvival2/hud/ws1_icons/icon_fence") ITEM.Recipe = { @@ -44,13 +44,15 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then local drop = ents.Create("ws_prop") drop:SetModel("models/props_wasteland/wood_fence02a.mdl") - drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) + local Aim = 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 + drop:SetAngles(Aim) drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/floor.lua b/gamemode/itemsystem/items/floor.lua index 82eb3ec..0e7cd8a 100644 --- a/gamemode/itemsystem/items/floor.lua +++ b/gamemode/itemsystem/items/floor.lua @@ -1,7 +1,7 @@ ITEM.Name = "Floor" ITEM.Class = "structure" -ITEM.Desc = "Some basic wood structure for setting up camps." +ITEM.Desc = "Some basic wood structure for setting up camps.\nHold down shift to snap" ITEM.Model = "models/props_debris/wood_board07a.mdl" ITEM.Icon = Material("wintersurvival2/hud/ws1_icons/icon_fence") ITEM.Recipe = { @@ -45,13 +45,15 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then local drop = ents.Create("ws_prop") drop:SetModel("models/props_wasteland/wood_fence02a.mdl") - drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,90)) + local Aim = 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 + drop:SetAngles(Aim) drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/infuser.lua b/gamemode/itemsystem/items/infuser.lua index 260e8fd..701a548 100644 --- a/gamemode/itemsystem/items/infuser.lua +++ b/gamemode/itemsystem/items/infuser.lua @@ -1,6 +1,6 @@ ITEM.Name = "Infuser" ITEM.Class = "structure" -ITEM.Desc = "Cast enchantments\nPlace runes nearby to boost magical power and have different effects" +ITEM.Desc = "Cast enchantments\nPlace runes nearby to boost magical power and have different effects\nHold down shift to snap" ITEM.Model = "models/props_junk/wood_crate002a.mdl" ITEM.Icon = Material("settlement/icon_researchtable") ITEM.Recipe = { @@ -42,13 +42,15 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then local drop = ents.Create("ws_infuser") - drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) + local Aim = 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 + drop:SetAngles(Aim) drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/ramp.lua b/gamemode/itemsystem/items/ramp.lua index 9d6fd2b..2954399 100644 --- a/gamemode/itemsystem/items/ramp.lua +++ b/gamemode/itemsystem/items/ramp.lua @@ -1,7 +1,7 @@ ITEM.Name = "Ramp" ITEM.Class = "structure" -ITEM.Desc = "Some basic wood structure for setting up camps." +ITEM.Desc = "Some basic wood structure for setting up camps.\nHold down shift to snap" ITEM.Model = "models/props_debris/wood_board07a.mdl" ITEM.Icon = Material("wintersurvival2/hud/ws1_icons/icon_fence") ITEM.Recipe = { @@ -45,13 +45,15 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then local drop = ents.Create("ws_prop") drop:SetModel("models/props_wasteland/wood_fence02a.mdl") - drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,45)) + local Aim = 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 + drop:SetAngles(Aim) drop:SetPos(Pos) drop:Spawn() drop:Activate() diff --git a/gamemode/itemsystem/items/researchtable.lua b/gamemode/itemsystem/items/researchtable.lua index b347828..9f00251 100644 --- a/gamemode/itemsystem/items/researchtable.lua +++ b/gamemode/itemsystem/items/researchtable.lua @@ -1,6 +1,6 @@ ITEM.Name = "Research Table" ITEM.Class = "structure" -ITEM.Desc = "A table to find recepies\nPlace 10 wood, sap, and rock in the table to discover a new recipe." +ITEM.Desc = "A table to find recepies\nHold down shift to snap" ITEM.Model = "models/props_junk/wood_crate001a.mdl" ITEM.Icon = Material("wintersurvival2/hud/ws2_icons/icon_recipe.png") ITEM.Recipe = { @@ -40,13 +40,15 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then local drop = ents.Create("ws_researchtable") - drop:SetAngles(Angle(0,pl:GetAimVector():Angle().y+90,0)) + local Aim = 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 + drop:SetAngles(Aim) drop:SetPos(Pos) drop:Spawn() drop:Activate() 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 diff --git a/gamemode/itemsystem/items/tent.lua b/gamemode/itemsystem/items/tent.lua index 3cbb207..846d6eb 100644 --- a/gamemode/itemsystem/items/tent.lua +++ b/gamemode/itemsystem/items/tent.lua @@ -50,10 +50,11 @@ function ITEM:OnPrimary(pl,tr) if (tr.Hit) then 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 diff --git a/gamemode/shared/player_ghost.lua b/gamemode/shared/player_ghost.lua index d2eade8..7cf11d0 100644 --- a/gamemode/shared/player_ghost.lua +++ b/gamemode/shared/player_ghost.lua @@ -58,6 +58,7 @@ else Pos.x = Pos.x - (Pos.x%20) Pos.y = Pos.y - (Pos.y%20) Pos.z = Pos.z - (Pos.z%20) + Aim.yaw = Aim.yaw - (Aim.yaw%15) end for k,v in pairs(pl.GhostItem.Ghost) do -- cgit v1.2.3-70-g09d2 From ae915e116af58554ca66245827079859a1facb83 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 4 Jan 2016 14:00:01 -0500 Subject: Fix about nameing in structures --- gamemode/itemsystem/items/alter.lua | 2 +- gamemode/itemsystem/items/campfire.lua | 2 +- gamemode/itemsystem/items/fence.lua | 2 +- gamemode/itemsystem/items/floor.lua | 2 +- gamemode/itemsystem/items/infuser.lua | 2 +- gamemode/itemsystem/items/ramp.lua | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gamemode/itemsystem/items/alter.lua b/gamemode/itemsystem/items/alter.lua index 891f15c..c661ebb 100644 --- a/gamemode/itemsystem/items/alter.lua +++ b/gamemode/itemsystem/items/alter.lua @@ -57,7 +57,7 @@ function ITEM:OnPrimary(pl,tr) 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) + Aim.yaw = Aim.yaw - (Aim.yaw%15) end drop:SetAngles(Angle(0,Aim,0)) diff --git a/gamemode/itemsystem/items/campfire.lua b/gamemode/itemsystem/items/campfire.lua index 4e35932..5295552 100644 --- a/gamemode/itemsystem/items/campfire.lua +++ b/gamemode/itemsystem/items/campfire.lua @@ -74,7 +74,7 @@ function ITEM:OnPrimary(pl,tr) 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) + Aim.yaw = Aim.yaw - (Aim.yaw%15) end drop:SetAngles(Aim) drop:SetPos(Pos) diff --git a/gamemode/itemsystem/items/fence.lua b/gamemode/itemsystem/items/fence.lua index 8616a09..1749713 100644 --- a/gamemode/itemsystem/items/fence.lua +++ b/gamemode/itemsystem/items/fence.lua @@ -50,7 +50,7 @@ function ITEM:OnPrimary(pl,tr) 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) + Aim.yaw = Aim.yaw - (Aim.yaw%15) end drop:SetAngles(Aim) drop:SetPos(Pos) diff --git a/gamemode/itemsystem/items/floor.lua b/gamemode/itemsystem/items/floor.lua index 0e7cd8a..7db8999 100644 --- a/gamemode/itemsystem/items/floor.lua +++ b/gamemode/itemsystem/items/floor.lua @@ -51,7 +51,7 @@ function ITEM:OnPrimary(pl,tr) 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) + Aim.yaw = Aim.yaw - (Aim.yaw%15) end drop:SetAngles(Aim) drop:SetPos(Pos) diff --git a/gamemode/itemsystem/items/infuser.lua b/gamemode/itemsystem/items/infuser.lua index 701a548..53aedf7 100644 --- a/gamemode/itemsystem/items/infuser.lua +++ b/gamemode/itemsystem/items/infuser.lua @@ -48,7 +48,7 @@ function ITEM:OnPrimary(pl,tr) 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) + Aim.yaw = Aim.yaw - (Aim.yaw%15) end drop:SetAngles(Aim) drop:SetPos(Pos) diff --git a/gamemode/itemsystem/items/ramp.lua b/gamemode/itemsystem/items/ramp.lua index 2954399..7b9e5f2 100644 --- a/gamemode/itemsystem/items/ramp.lua +++ b/gamemode/itemsystem/items/ramp.lua @@ -51,7 +51,7 @@ function ITEM:OnPrimary(pl,tr) 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) + Aim.yaw = Aim.yaw - (Aim.yaw%15) end drop:SetAngles(Aim) drop:SetPos(Pos) -- cgit v1.2.3-70-g09d2 From 2de3779c361160a956f3da2c8e8a97b6af5d0783 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 4 Jan 2016 23:11:40 -0500 Subject: Fixed tent snapping --- gamemode/itemsystem/items/tent.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamemode/itemsystem/items/tent.lua b/gamemode/itemsystem/items/tent.lua index 846d6eb..2c65eca 100644 --- a/gamemode/itemsystem/items/tent.lua +++ b/gamemode/itemsystem/items/tent.lua @@ -1,7 +1,7 @@ ITEM.Name = "Tent" ITEM.Class = "structure" -ITEM.Desc = "Something to duck under." +ITEM.Desc = "Something to duck under.\nHold down shift to snap" ITEM.Model = "models/props_debris/wood_board07a.mdl" ITEM.Icon = Material("settlement/icon_tent") ITEM.Recipe = { -- cgit v1.2.3-70-g09d2 From 0be6e859473d7a98122c13c5976d0383bd16e19e Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Thu, 7 Jan 2016 21:49:14 -0500 Subject: Fixed conflict in researchtable --- gamemode/itemsystem/items/researchtable.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gamemode/itemsystem/items/researchtable.lua b/gamemode/itemsystem/items/researchtable.lua index 57a209c..25c8201 100644 --- a/gamemode/itemsystem/items/researchtable.lua +++ b/gamemode/itemsystem/items/researchtable.lua @@ -1,10 +1,6 @@ ITEM.Name = "Research Table" ITEM.Class = "structure" -<<<<<<< HEAD -ITEM.Desc = "A table that gives hints every 30 seconds to nearby players" -======= ITEM.Desc = "A table to find recepies\nHold down shift to snap" ->>>>>>> building-rotateable ITEM.Model = "models/props_junk/wood_crate001a.mdl" ITEM.Icon = Material("wintersurvival2/hud/ws2_icons/icon_recipe.png") ITEM.Recipe = { -- cgit v1.2.3-70-g09d2 From 02ffa95e931d0a1968593da29b93bedcfc280799 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Thu, 7 Jan 2016 23:22:44 -0500 Subject: Bird corpses clean up every three seconds --- gamemode/client/render_noragdolls.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gamemode/client/render_noragdolls.lua b/gamemode/client/render_noragdolls.lua index 915d470..c3ffb09 100644 --- a/gamemode/client/render_noragdolls.lua +++ b/gamemode/client/render_noragdolls.lua @@ -1,6 +1,11 @@ -function GM:Initialize() - timer.Create( "removeRagdolls", 3, 0, function() - game.RemoveRagdolls() +hook.Add("Initialize","cleanupragdolls",function() + print("Client initalized") + timer.Create( "removeRagdolls", 3, 0, function() + for k,v in pairs(ents.GetAll()) do + if(v:GetClass() == "class C_ClientRagdoll") then + v:Remove() + end + end + end) end) -end -- cgit v1.2.3-70-g09d2