aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/player_spellcast.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/shared/player_spellcast.lua')
-rw-r--r--gamemode/shared/player_spellcast.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/gamemode/shared/player_spellcast.lua b/gamemode/shared/player_spellcast.lua
index 0cf2108..20a6cb5 100644
--- a/gamemode/shared/player_spellcast.lua
+++ b/gamemode/shared/player_spellcast.lua
@@ -8,9 +8,10 @@ if(SERVER) then
util.AddNetworkString("CastSpell")
util.AddNetworkString("FinishedCasting")
- function meta:Cast(spellname, callback)
+ function meta:Cast(spellname, callback, weapon)
if(self.casting) then return end
self.casting = callback
+ self.wep = weapon
print("Casting " .. spellname)
net.Start("CastSpell")
net.WriteString(spellname)
@@ -20,7 +21,9 @@ if(SERVER) then
net.Receive("FinishedCasting",function(len,pl)
if(pl.casting) then
print("Finished casting message received by server: " .. pl:Nick())
- pl.casting(net.ReadInt(BITCOUNT),pl)
+ local score = net.ReadInt(BITCOUNT)
+ print("Calling callback with " .. score .. " and " .. pl:Nick())
+ pl.casting(score,pl,pl.wep)
pl.casting = nil
end
end)