Fix runtimes in MouseDrop when dragging out of the screen

* MouseDrop()'s over_object may be null if dropping over a stat panel or over other empty space. Fix runtimes from assuming it is not null.
* Fixes Runtime in clothing_accessories.dm,54: Cannot read null.name
* Fixes Runtime in evidencebag.dm,21: Cannot read null.loc
This commit is contained in:
Leshana
2017-06-09 15:47:45 -04:00
parent 873d8e1067
commit c632366c26
2 changed files with 3 additions and 4 deletions

View File

@@ -40,7 +40,7 @@
return ..()
/obj/item/clothing/MouseDrop(var/obj/over_object)
if (ishuman(usr) || issmall(usr))
if (over_object && (ishuman(usr) || issmall(usr)))
//makes sure that the clothing is equipped so that we can't drag it into our hand from miles away.
if (!(src.loc == usr))
return

View File

@@ -12,6 +12,8 @@
/obj/item/weapon/evidencebag/MouseDrop(var/obj/item/I as obj)
if (!ishuman(usr))
return
if(!istype(I) || I.anchored)
return ..()
var/mob/living/carbon/human/user = usr
@@ -36,9 +38,6 @@
else
return
if(!istype(I) || I.anchored)
return
if(istype(I, /obj/item/weapon/evidencebag))
user << "<span class='notice'>You find putting an evidence bag in another evidence bag to be slightly absurd.</span>"
return