mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user