aboutsummaryrefslogtreecommitdiff
path: root/gamemode/itemsystem/items/spell_teleport.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-11-17 17:11:15 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2016-11-17 17:11:15 -0500
commit52fb13ef163bcea7f1409e17fd62509703de9f69 (patch)
tree12df9ec09392b561d4a2604544f200635130c8b8 /gamemode/itemsystem/items/spell_teleport.lua
parent50537786ae45d0e12a1dc4265e0d40d2fd4fbc4b (diff)
downloadwintersurvival2-52fb13ef163bcea7f1409e17fd62509703de9f69.tar.gz
wintersurvival2-52fb13ef163bcea7f1409e17fd62509703de9f69.tar.bz2
wintersurvival2-52fb13ef163bcea7f1409e17fd62509703de9f69.zip
Added persistance
Diffstat (limited to 'gamemode/itemsystem/items/spell_teleport.lua')
-rw-r--r--gamemode/itemsystem/items/spell_teleport.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/gamemode/itemsystem/items/spell_teleport.lua b/gamemode/itemsystem/items/spell_teleport.lua
index 686d5d1..9c31f25 100644
--- a/gamemode/itemsystem/items/spell_teleport.lua
+++ b/gamemode/itemsystem/items/spell_teleport.lua
@@ -26,11 +26,11 @@ ITEM.CD = 0.25
All saved points are stored in a global table where
ITEM.savedpoint[player] = <saved point vector>
]]
-ITEM.savedpoint = {}
+local savedpoint = {}
function ITEM:DoTeleport(score,pl,self)
print("DoTeleport called!")
- if ITEM.savedpoint[pl] == nil then return end
+ if savedpoint[pl] == nil then return end
print("Fully successfull teleport callback:")
print(pl)
local aim = pl:GetAimVector()
@@ -39,7 +39,7 @@ function ITEM:DoTeleport(score,pl,self)
D:SetPos(pl:GetShootPos() + aim * 200)
D:SetOwner(pl)
D:SetAngles(aim:Angle())
- D.endpoint = ITEM.savedpoint[pl]
+ D.endpoint = savedpoint[pl]
D:Spawn()
D:Activate()
pl:EmitSound(Sound("physics/flesh/flesh_impact_hard.wav"),100,math.random(90,110))
@@ -71,7 +71,7 @@ end
function ITEM:OnSecondary(pl,tr)
print("Endpoint set?")
ParticleEffect("firetest",pl:GetPos(),pl:GetAngles(),pl)
- ITEM.savedpoint[pl] = pl:GetPos()
+ savedpoint[pl] = pl:GetPos()
end
function ITEM:OnPrimary(pl,tr)