mob/proc
Equip_Proc(var/obj/O in src)
if(O.Slot == "Hand") // If the item is hand held
if(!src.Hand1) // If there is nothing in Hand1
src.Hand1 = O // Equip Item
usr << "Equipped..."
Hand1 = 1 // Hand1 is now full
return 0 // Return
if(src.Hand1) //If Hand1 is full
if(!src.Hand2) //If Hand2 is empty
src.Hand2 = O // Equip Item
usr << "Equipped..."
else
usr << "Both hands are full!"
else
usr << "Cannot equip" // If Item cannot go into hand (temporary)
return 0
obj/Items
Iron_Dagger
Slot="Hand"
DMGadd = 3
verb/Equip()
usr.Equip_Proc()
/*
Runtime Error:
runtime error: Cannot read null.Slot
proc name: Equip Proc (/mob/proc/Equip_Proc)
usr: Guest-1597742269 (/mob)
src: Guest-1597742269 (/mob)
call stack:
Guest-1597742269 (/mob): Equip Proc(null)
Iron Dagger (/obj/Items/Iron_Dagger): Equip()
*/
Problem description: I am getting a run time error for this equip proc. I am not entirely sure what the source of the problem is. Please could someone help me with this.
Call the proc like so
This will call the person using the verb's Equip_Proc() and pass the object the verb is being used on to the argument of the proc.