From 166b6d460f30b3b5179df5edcdf2ddfc9ede75a0 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 26 Feb 2016 20:49:23 -0500 Subject: Modifications to fireball spell to make it usefull in combat --- gamemode/shared/player_spellcast.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gamemode/shared/player_spellcast.lua') 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) -- cgit v1.2.3-70-g09d2