mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-28 07:39:13 +01:00
[MIRROR] JSON Logging Refactor (#11623)
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Selis
Kashargul
parent
272afa33c8
commit
5a62077f2c
@@ -25,11 +25,11 @@
|
||||
var/recursion = 0 // safety check - max iterations
|
||||
while(istype(cur_parent) && (recursion < 64))
|
||||
if(cur_parent == cur_parent.loc) //safety check incase a thing is somehow inside itself, cancel
|
||||
log_debug("RECURSIVE_MOVE: Parent is inside itself. ([holder]) ([holder.type])")
|
||||
log_runtime("RECURSIVE_MOVE: Parent is inside itself. ([holder]) ([holder.type])")
|
||||
reset_parents()
|
||||
break
|
||||
if(cur_parent in parents) //safety check incase of circular contents. (A inside B, B inside C, C inside A), cancel
|
||||
log_debug("RECURSIVE_MOVE: Parent is inside a circular inventory. ([holder]) ([holder.type])")
|
||||
log_runtime("RECURSIVE_MOVE: Parent is inside a circular inventory. ([holder]) ([holder.type])")
|
||||
reset_parents()
|
||||
break
|
||||
recursion++
|
||||
@@ -40,7 +40,7 @@
|
||||
cur_parent = cur_parent.loc
|
||||
|
||||
if(recursion >= 64) // If we escaped due to iteration limit, cancel
|
||||
log_debug("RECURSIVE_MOVE: Parent hit recursion limit. ([holder]) ([holder.type])")
|
||||
log_runtime("RECURSIVE_MOVE: Parent hit recursion limit. ([holder]) ([holder.type])")
|
||||
reset_parents()
|
||||
parents.Cut()
|
||||
|
||||
@@ -109,15 +109,15 @@
|
||||
parents.Cut()
|
||||
|
||||
//the banana peel of testing stays
|
||||
/obj/item/bananapeel/testing
|
||||
/obj/item/bananapeel/test
|
||||
name = "banana peel of testing"
|
||||
desc = "spams world log with debugging information"
|
||||
|
||||
/obj/item/bananapeel/testing/proc/shmove(var/atom/source, var/atom/old_loc, var/atom/new_loc)
|
||||
/obj/item/bananapeel/test/proc/shmove(var/atom/source, var/atom/old_loc, var/atom/new_loc)
|
||||
SIGNAL_HANDLER
|
||||
world.log << "the [source] moved from [old_loc]([old_loc.x],[old_loc.y],[old_loc.z]) to [new_loc]([new_loc.x],[new_loc.y],[new_loc.z])"
|
||||
|
||||
/obj/item/bananapeel/testing/Initialize(mapload)
|
||||
/obj/item/bananapeel/test/Initialize(mapload)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/recursive_move)
|
||||
RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(shmove))
|
||||
|
||||
Reference in New Issue
Block a user