runtime error: Cannot read null.client
proc name: PLV Gain (/mob/proc/PLV_Gain)
usr: Tester the Bester (/mob)
src: Tester the Bester (/mob)
call stack:
Tester the Bester (/mob): PLV Gain(0.003, 1.1)
Tester the Bester (/mob): Melee Attack Gain(1)
Tester the Bester (/mob): Attack()
Error 2:
runtime error: Cannot read null.client
proc name: PLV Gain (/mob/proc/PLV_Gain)
usr: Tyrannosaurus Rex (/mob/Enemy/Tyrannosaurus_Rex)
src: Tester the Bester (/mob)
call stack:
Tester the Bester (/mob): PLV Gain(0.003, 1.1)
Tester the Bester (/mob): Melee Attack Gain(1)
Tyrannosaurus Rex (/mob/Enemy/Tyrannosaurus_Rex): Melee Attack()
Tyrannosaurus Rex (/mob/Enemy/Tyrannosaurus_Rex): Bump(Tester the Bester (/mob))
Code:
mob/Enemy/Bump(mob/A)
-snip-
spawn Melee_Attack()
--------------------------------------------
mob/proc
Melee_Attack()
for(var/mob/M in get_step(src,dir))
if(!attacking)
flick("Attacking",src)
if(M.monster) M.target=src
attacking=1
if(!MinuteBoost)
MinuteBoost=1
src.Melee_Attack_Gain(2)
spawn(600) MinuteBoost=0
src.Melee_Attack_Gain(5)
if(M.monster)
if(!M.MinuteBoost)
M.MinuteBoost=1
M.Melee_Hit_Gain(2)
spawn(600) if(M) M.MinuteBoost=0
M.Melee_Hit_Gain(5)
-snip-
------------------------------------------
mob/verb
Attack()
-snip-
if(M.monster) M.target=usr
attacking=1
if(!MinuteBoost&&!M.monster)
MinuteBoost=1
usr.Melee_Attack_Gain(2)
spawn(600) MinuteBoost=0
if(client) usr.Melee_Attack_Gain()
if(!M.MinuteBoost)
M.MinuteBoost=1
M.Melee_Hit_Gain(2)
spawn(600) if(M) M.MinuteBoost=0
if(M.client) M.Melee_Hit_Gain()
if(M.monster)
M.Melee_Hit_Gain(4)
-snip-
------------------------------------------
Melee_Attack_Gain(var/repeat=1)
if(repeat>1)
repeat-=1
src.Melee_Attack_Gain(repeat)
HitCounter+=1
if(ENR<MaxENR)
if(!dead||z==1)
else ENR+=((MaxENR/200)*EnergyRegen)
if(src.client)
var/GravityGain
if(CurrentGravity<=GravityMastered) GravityGain=(GravityMastered/10)+1
else GravityGain=(CurrentGravity/10)+1
src.PLV_Gain(0.003,GravityGain)
src.ENR_Gain(0.008)
if(STRENDfocus=="Balanced")
if(prob(15)) src.STR_Gain(0.015)
if(prob(10)) src.END_Gain(0.020)
if(prob(10)) src.SPD_Gain(0.007)
/*else if(STRENDfocus=="Strength")
if(prob(10)) src.STR_Gain(0.055)
if(prob(25)) src.SPD_Gain(-0.010)
else if(STRENDfocus=="Endurance")
if(prob(10)) src.END_Gain(0.056)
if(prob(25)) src.SPD_Gain(-0.010)*/
if(FORRESfocus=="Balanced")
if(prob(20)) src.FOR_Gain(0.003)
if(prob(20)) src.RES_Gain(0.003)
if(prob(10)) src.SPD_Gain(0.007)
/*else if(FORRESfocus=="Force")
if(prob(10)) src.FOR_Gain(0.02)
else if(FORRESfocus=="Resistance")
if(prob(10)) src.RES_Gain(0.02)*/
if(OFFDEFfocus=="Balanced")
if(prob(10)) src.OFF_Gain(0.037)
if(prob(10)) src.DEF_Gain(0.033)
if(prob(10)) src.SPD_Gain(0.007)
/*else if(OFFDEFfocus=="Offense")
if(prob(10)) src.OFF_Gain(usr,0.09)
else if(OFFDEFfocus=="Defense")
if(prob(10)) src.DEF_Gain(usr,0.09)*/
PLVGain+=GAININCREASE*5*LogoutBonus*GlobalGain
else if(src.monster)
src.PLV_Gain(0.003)
src.ENR_Gain(0.008)
if(prob(15)) src.STR_Gain(0.015)
if(prob(10)) src.END_Gain(0.020)
if(prob(10)) src.SPD_Gain(0.007)
if(prob(20)) src.FOR_Gain(0.003)
if(prob(20)) src.RES_Gain(0.003)
if(prob(10)) src.SPD_Gain(0.007)
if(prob(10)) src.OFF_Gain(0.037)
if(prob(10)) src.DEF_Gain(0.033)
if(prob(10)) src.SPD_Gain(0.007)
PLVGain+=GAININCREASE*5*GlobalGain
---------------------------------------
PLV_Gain(var/mult,var/GravityGain=(src.GravityMastered/10)+1) //calculates PLV gain
if(src.client) src.PLV+=mult*src.PowerRank*src.PLVGain*src.LogoutBonus*src.PLVMod*GravityGain*src.HTCMod*src.InexperienceMult*src.SparMult*(src.CarriedWeight+1)*GlobalGain
else src.PLV+=mult*src.PLVGain*src.PLVMod*src.InexperienceMult*src.SparMult*GlobalGain
Problem description:
Basically upon using Attack() on a mob or having a mob bump into me and Melee_Attack() me, it spits out this runtime error. For some reason it's not occurring every single time a mob bumps into me, but it is occurring every time I punch one of them.
I can't figure out why src would be null by the time it reached PLV_Gain. Is there something stupidly obvious I'm missing?
I left out the entirety of Bump(/mob), Attack(), and Melee_Attack() since I doubt those are causing the issue. I'm fairly certain the runtime is coming from either Melee_Attack_Gain(/var) or PLV_Gain(/var,/var) since it's happening with both. I can add them in if you think those are causing the problem.