mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 05:57:24 +01:00
Fixed an evidence bag runtime error and added a few CRASH() checks to /obj/machinery/disposal
This commit is contained in:
+1
-1
@@ -264,7 +264,7 @@
|
||||
var/burning = null
|
||||
var/hitsound = null
|
||||
var/w_class = 3.0
|
||||
var/wielded = 0
|
||||
var/wielded = 0 // 1 if item is two handed and grabbed with two hands
|
||||
var/twohanded = 0 // Two handed and wielded off by default, nyoro~n -Agouri
|
||||
var/force_unwielded = 0
|
||||
var/force_wielded = 0
|
||||
|
||||
@@ -33,11 +33,14 @@
|
||||
desc = "An evidence bag containing \a [O]. [O.desc]"
|
||||
|
||||
/obj/item/weapon/evidencebag/attack_self(mob/user as mob)
|
||||
var/obj/item/I = src.contents[1]
|
||||
user << "You take the [I] out of the [src]."
|
||||
I.loc = user.loc
|
||||
src.underlays -= I
|
||||
icon_state = "evidenceobj"
|
||||
if (src.contents.len > 0)
|
||||
var/obj/item/I = src.contents[1]
|
||||
user << "You take the [I] out of the [src]."
|
||||
I.loc = user.loc
|
||||
src.underlays -= I
|
||||
icon_state = "evidenceobj"
|
||||
else
|
||||
user << "The [src] is empty."
|
||||
|
||||
/obj/item/weapon/storage/box/evidence
|
||||
name = "evidence bag box"
|
||||
|
||||
@@ -73,9 +73,17 @@
|
||||
if(isrobot(user))
|
||||
return
|
||||
|
||||
else if (!isnull(I)) // As per code/game/atom_procs.dm, this shouldn't even be required, but for some reason is. -- Abi79
|
||||
else
|
||||
if(isnull(I)) // Added these calls to CRASH to diagnose a runtime error that may be one of the causes of erasure errors --Abi79
|
||||
CRASH("disposal/attackby() was called, but I was nulled before calling user.drop_item()")
|
||||
|
||||
var/debug_item_name = I.name
|
||||
|
||||
user.drop_item()
|
||||
|
||||
if(isnull(I))
|
||||
CRASH("disposal/attackby() was called with [debug_item_name] as I, but I was nulled after calling user.drop_item()")
|
||||
|
||||
I.loc = src
|
||||
user << "You place \the [I] into the [src]."
|
||||
for(var/mob/M in viewers(src))
|
||||
|
||||
Reference in New Issue
Block a user