adds a safety check to prevent runtimes

if the dummy parent item somehow gets spawned and an idiot player tries to use it, this stops them from runtiming/crashing the server. written in my free time so i may have done the "holder == null" part wrong, if it breaks ill fix it in a bit.
This commit is contained in:
PKPenguin321
2016-01-22 10:33:52 -08:00
parent c8aa8721e8
commit 8643aee84f
@@ -269,6 +269,9 @@
if(overloaded)//ensure the implant isn't broken
owner << "<span class='warning'>The implant doesn't respond. It seems to be broken...</span>"
return
if(holder == null)
owner << "<span class='warning'>You should not be attempting to use this implant, as it is a dummy item that should never appear. Please adminhelp and report this as an issue on github.</span>"
return
if(out)//check if the owner has the item out already
owner.unEquip(holder, 1)//if he does, take it away. then,
holder.loc = null//stash it in nullspace