diff options
| author | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-07 21:30:10 -0500 |
|---|---|---|
| committer | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-01-07 21:30:10 -0500 |
| commit | 43a6f971730a8441b47a44008a023e5af8cdb91c (patch) | |
| tree | afa57b2b3f0740f96037431863962c15a865b26c /gamemode/itemsystem/items/researchtable.lua | |
| parent | 12e7fff3321b4f0c827ddd3bb8dca7f8a58c6fc2 (diff) | |
| parent | 2de3779c361160a956f3da2c8e8a97b6af5d0783 (diff) | |
| download | wintersurvival2-43a6f971730a8441b47a44008a023e5af8cdb91c.tar.gz wintersurvival2-43a6f971730a8441b47a44008a023e5af8cdb91c.tar.bz2 wintersurvival2-43a6f971730a8441b47a44008a023e5af8cdb91c.zip | |
Fix for research table also snapping
Diffstat (limited to 'gamemode/itemsystem/items/researchtable.lua')
| -rw-r--r-- | gamemode/itemsystem/items/researchtable.lua | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gamemode/itemsystem/items/researchtable.lua b/gamemode/itemsystem/items/researchtable.lua index 8c5c9e5..57a209c 100644 --- a/gamemode/itemsystem/items/researchtable.lua +++ b/gamemode/itemsystem/items/researchtable.lua @@ -1,6 +1,10 @@ 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 = {
@@ -40,8 +44,16 @@ 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 Aim = Angle(0,pl:GetAimVector():Angle().y+90,0)
+ local Pos = tr.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)
+ Aim.yaw = Aim.yaw - (Aim.yaw%15)
+ end
+ drop:SetAngles(Aim)
+ drop:SetPos(Pos)
drop:Spawn()
drop:Activate()
|
