= 2)
var/n = runBases.len - 1
if(n > 1 && runLens[n-1] <= runLens[n] + runLens[n+1])
@@ -188,12 +188,12 @@ reverse a descending sequence without violating stability.
else if(runLens[n] <= runLens[n+1])
mergeAt(n)
else
- break //Invariant is established
+ break //Invariant is established
-//Merges all runs on the stack until only one remains.
-//Called only once, to finalise the sort
-/datum/sortInstance/proc/mergeForceCollapse()
+ //Merges all runs on the stack until only one remains.
+ //Called only once, to finalise the sort
+/datum/sort_instance/proc/mergeForceCollapse()
while(runBases.len >= 2)
var/n = runBases.len - 1
if(n > 1 && runLens[n-1] < runLens[n+1])
@@ -201,10 +201,10 @@ reverse a descending sequence without violating stability.
mergeAt(n)
-//Merges the two consecutive runs at stack indices i and i+1
-//Run i must be the penultimate or antepenultimate run on the stack
-//In other words, i must be equal to stackSize-2 or stackSize-3
-/datum/sortInstance/proc/mergeAt(i)
+ //Merges the two consecutive runs at stack indices i and i+1
+ //Run i must be the penultimate or antepenultimate run on the stack
+ //In other words, i must be equal to stackSize-2 or stackSize-3
+/datum/sort_instance/proc/mergeAt(i)
//ASSERT(runBases.len >= 2)
//ASSERT(i >= 1)
//ASSERT(i == runBases.len - 1 || i == runBases.len - 2)
@@ -223,7 +223,6 @@ reverse a descending sequence without violating stability.
runLens.Cut(i+1, i+2)
runBases.Cut(i+1, i+2)
-
//Find where the first element of run2 goes in run1.
//Prior elements in run1 can be ignored (because they're already in place)
var/k = gallopRight(fetchElement(L,base2), base1, len1, 0)
@@ -247,20 +246,21 @@ reverse a descending sequence without violating stability.
mergeHi(base1, len1, base2, len2)
-/*
- Locates the position to insert key within the specified sorted range
- If the range contains elements equal to key, this will return the index of the LEFTMOST of those elements
+ /*
+ Locates the position to insert key within the specified sorted range
+ If the range contains elements equal to key, this will return the index of the LEFTMOST of those elements
- key the element to be inserted into the sorted range
- base the index of the first element of the sorted range
- len the length of the sorted range, must be greater than 0
- hint the offset from base at which to begin the search, such that 0 <= hint < len; i.e. base <= hint < base+hint
+ key the element to be inserted into the sorted range
+ base the index of the first element of the sorted range
+ len the length of the sorted range, must be greater than 0
+ hint the offset from base at which to begin the search, such that 0 <= hint < len; i.e. base <= hint < base+hint
- Returns the index at which to insert element 'key'
-*/
-/datum/sortInstance/proc/gallopLeft(key, base, len, hint)
+ Returns the index at which to insert element 'key'
+ */
+/datum/sort_instance/proc/gallopLeft(key, base, len, hint)
//ASSERT(len > 0 && hint >= 0 && hint < len)
+ var/list/L = src.L
var/lastOffset = 0
var/offset = 1
if(call(cmp)(key, fetchElement(L,base+hint)) > 0)
@@ -304,31 +304,30 @@ reverse a descending sequence without violating stability.
//ASSERT(lastOffset == offset)
return offset
-/**
- * Like gallopLeft, except that if the range contains an element equal to
- * key, gallopRight returns the index after the rightmost equal element.
- *
- * @param key the key whose insertion point to search for
- * @param a the array in which to search
- * @param base the index of the first element in the range
- * @param len the length of the range; must be > 0
- * @param hint the index at which to begin the search, 0 <= hint < n.
- * The closer hint is to the result, the faster this method will run.
- * @param c the comparator used to order the range, and to search
- * @return the int k, 0 <= k <= n such that a[b + k - 1] <= key < a[b + k]
- */
-/datum/sortInstance/proc/gallopRight(key, base, len, hint)
+ /**
+ * Like gallopLeft, except that if the range contains an element equal to
+ * key, gallopRight returns the index after the rightmost equal element.
+ *
+ * @param key the key whose insertion point to search for
+ * @param a the array in which to search
+ * @param base the index of the first element in the range
+ * @param len the length of the range; must be > 0
+ * @param hint the index at which to begin the search, 0 <= hint < n.
+ * The closer hint is to the result, the faster this method will run.
+ * @param c the comparator used to order the range, and to search
+ * @return the int k, 0 <= k <= n such that `a[b + k - 1] <= key < a[b + k]`
+ */
+/datum/sort_instance/proc/gallopRight(key, base, len, hint)
//ASSERT(len > 0 && hint >= 0 && hint < len)
+ var/list/L = src.L
var/offset = 1
var/lastOffset = 0
- if(call(cmp)(key, fetchElement(L,base+hint)) < 0) //key <= L[base+hint]
- var/maxOffset = hint + 1 //therefore we want to insert somewhere in the range [base,base+hint] = [base+,base+(hint+1))
- while(offset < maxOffset && call(cmp)(key, fetchElement(L,base+hint-offset)) < 0) //we are iterating backwards
+ if(call(cmp)(key, fetchElement(L,base+hint)) < 0) //key <= L[base+hint]
+ var/maxOffset = hint + 1 //therefore we want to insert somewhere in the range [base,base+hint] = [base+,base+(hint+1))
+ while(offset < maxOffset && call(cmp)(key, fetchElement(L,base+hint-offset)) < 0) //we are iterating backwards
lastOffset = offset
- offset = (offset << 1) + 1 //1 3 7 15
- //if(offset <= 0) //int overflow, not an issue here since we are using floats
- // offset = maxOffset
+ offset = (offset << 1) + 1 //1 3 7 15
if(offset > maxOffset)
offset = maxOffset
@@ -337,13 +336,11 @@ reverse a descending sequence without violating stability.
lastOffset = hint - offset
offset = hint - temp
- else //key > L[base+hint]
- var/maxOffset = len - hint //therefore we want to insert somewhere in the range (base+hint,base+len) = [base+hint+1, base+hint+(len-hint))
+ else //key > L[base+hint]
+ var/maxOffset = len - hint //therefore we want to insert somewhere in the range (base+hint,base+len) = [base+hint+1, base+hint+(len-hint))
while(offset < maxOffset && call(cmp)(key, fetchElement(L,base+hint+offset)) >= 0)
lastOffset = offset
offset = (offset << 1) + 1
- //if(offset <= 0) //int overflow, not an issue here since we are using floats
- // offset = maxOffset
if(offset > maxOffset)
offset = maxOffset
@@ -357,9 +354,9 @@ reverse a descending sequence without violating stability.
while(lastOffset < offset)
var/m = lastOffset + ((offset - lastOffset) >> 1)
- if(call(cmp)(key, fetchElement(L,base+m)) < 0) //key <= L[base+m]
+ if(call(cmp)(key, fetchElement(L,base+m)) < 0) //key <= L[base+m]
offset = m
- else //key > L[base+m]
+ else //key > L[base+m]
lastOffset = m + 1
//ASSERT(lastOffset == offset)
@@ -367,11 +364,12 @@ reverse a descending sequence without violating stability.
return offset
-//Merges two adjacent runs in-place in a stable fashion.
-//For performance this method should only be called when len1 <= len2!
-/datum/sortInstance/proc/mergeLo(base1, len1, base2, len2)
+ //Merges two adjacent runs in-place in a stable fashion.
+ //For performance this method should only be called when len1 <= len2!
+/datum/sort_instance/proc/mergeLo(base1, len1, base2, len2)
//ASSERT(len1 > 0 && len2 > 0 && base1 + len1 == base2)
+ var/list/L = src.L
var/cursor1 = base1
var/cursor2 = base2
@@ -391,8 +389,8 @@ reverse a descending sequence without violating stability.
outer:
while(1)
- var/count1 = 0 //# of times in a row that first run won
- var/count2 = 0 // " " " " " " second run won
+ var/count1 = 0 //# of times in a row that first run won
+ var/count2 = 0 // " " " " " " second run won
//do the straightfoward thin until one run starts winning consistently
@@ -471,10 +469,11 @@ reverse a descending sequence without violating stability.
//ASSERT(len1 > 1)
-/datum/sortInstance/proc/mergeHi(base1, len1, base2, len2)
+/datum/sort_instance/proc/mergeHi(base1, len1, base2, len2)
//ASSERT(len1 > 0 && len2 > 0 && base1 + len1 == base2)
- var/cursor1 = base1 + len1 - 1 //start at end of sublists
+ var/list/L = src.L
+ var/cursor1 = base1 + len1 - 1 //start at end of sublists
var/cursor2 = base2 + len2 - 1
//degenerate cases
@@ -491,8 +490,8 @@ reverse a descending sequence without violating stability.
outer:
while(1)
- var/count1 = 0 //# of times in a row that first run won
- var/count2 = 0 // " " " " " " second run won
+ var/count1 = 0 //# of times in a row that first run won
+ var/count2 = 0 // " " " " " " second run won
//do the straightfoward thing until one run starts winning consistently
do
@@ -522,11 +521,11 @@ reverse a descending sequence without violating stability.
do
//ASSERT(len1 > 0 && len2 > 1)
- count1 = len1 - gallopRight(fetchElement(L,cursor2), base1, len1, len1-1) //should cursor1 be base1?
+ count1 = len1 - gallopRight(fetchElement(L,cursor2), base1, len1, len1-1) //should cursor1 be base1?
if(count1)
cursor1 -= count1
- moveRange(L, cursor1+1, cursor2+1, count1) //cursor1+1 == cursor2 by definition
+ moveRange(L, cursor1+1, cursor2+1, count1) //cursor1+1 == cursor2 by definition
cursor2 -= count1
len1 -= count1
@@ -558,7 +557,7 @@ reverse a descending sequence without violating stability.
if(minGallop < 0)
minGallop = 0
- minGallop += 2 // Penalize for leaving gallop mode
+ minGallop += 2 // Penalize for leaving gallop mode
if(len2 == 1)
//ASSERT(len1 > 0)
@@ -571,12 +570,11 @@ reverse a descending sequence without violating stability.
//ASSERT(len2 > 0)
-/datum/sortInstance/proc/mergeSort(start, end)
+/datum/sort_instance/proc/mergeSort(start, end)
var/remaining = end - start
//If array is small, do an insertion sort
if(remaining < MIN_MERGE)
- //var/initRunLen = countRunAndMakeAscending(start, end)
binarySort(start, end, start/*+initRunLen*/)
return
@@ -606,7 +604,7 @@ reverse a descending sequence without violating stability.
else if(runLens[n] <= runLens[n+1])
mergeAt2(n)
else
- break //Invariant is established
+ break //Invariant is established
while(runBases.len >= 2)
var/n = runBases.len - 1
@@ -616,7 +614,8 @@ reverse a descending sequence without violating stability.
return L
-/datum/sortInstance/proc/mergeAt2(i)
+/datum/sort_instance/proc/mergeAt2(i)
+ var/list/L = src.L
var/cursor1 = runBases[i]
var/cursor2 = runBases[i+1]
diff --git a/code/_onclick/hud/ability_screen_objects.dm b/code/_onclick/hud/ability_screen_objects.dm
index 7690b9d203..e4fda3ad9b 100644
--- a/code/_onclick/hud/ability_screen_objects.dm
+++ b/code/_onclick/hud/ability_screen_objects.dm
@@ -185,9 +185,9 @@
/mob/Destroy()
- ..()
if(ability_master)
QDEL_NULL(ability_master)
+ . = ..()
///////////ACTUAL ABILITIES////////////
diff --git a/code/_onclick/hud/minihud_rigmech.dm b/code/_onclick/hud/minihud_rigmech.dm
index b4d13f1c86..6af7c68d65 100644
--- a/code/_onclick/hud/minihud_rigmech.dm
+++ b/code/_onclick/hud/minihud_rigmech.dm
@@ -35,12 +35,12 @@
if(!owner_rig)
qdel(src)
return
-
+
var/obj/item/weapon/cell/rigcell = owner_rig.cell
var/obj/item/weapon/tank/rigtank = owner_rig.air_supply
var/charge_percentage = rigcell ? rigcell.charge / rigcell.maxcharge : 0
- var/air_percentage = rigtank ? CLAMP(rigtank.air_contents.total_moles / 17.4693, 0, 1) : 0
+ var/air_percentage = rigtank?.air_contents ? CLAMP(rigtank.air_contents.total_moles / 17.4693, 0, 1) : 0
var/air_on = owner_rig.wearer?.internal ? 1 : 0
power.icon_state = "pwr[round(charge_percentage / 0.2, 1)]"
@@ -84,7 +84,7 @@
if(!owner_mech)
qdel(src)
return
-
+
var/obj/item/weapon/cell/mechcell = owner_mech.cell
var/obj/machinery/portable_atmospherics/canister/mechtank = owner_mech.internal_tank
@@ -97,7 +97,7 @@
air.icon_state = "air[round(air_percentage / 0.2, 1)]"
health.icon_state = "health[round(health_percentage / 0.2, 1)]"
airtoggle.icon_state = "airon[air_on]"
-
+
// Screen objects
/obj/screen/rig
icon = 'icons/mob/screen_rigmech.dmi'
@@ -209,7 +209,7 @@
var/list/adding = list()
HUD.adding = adding
-
+
var/obj/screen/using
using = new /obj/screen/ghost/jumptomob()
using.screen_loc = ui_ghost_jumptomob
@@ -225,4 +225,4 @@
using.screen_loc = ui_ghost_reenter_corpse
using.hud = src
adding += using
-*/
\ No newline at end of file
+*/
diff --git a/code/controllers/globals.dm b/code/controllers/globals.dm
index cd6e7544dd..45d8f3ccf3 100644
--- a/code/controllers/globals.dm
+++ b/code/controllers/globals.dm
@@ -63,4 +63,4 @@ GLOBAL_REAL(GLOB, /datum/controller/global_vars)
if(end_tick - start_tick)
warning("Global [replacetext("[I]", "InitGlobal", "")] slept during initialization!")
- populate_legacy_globals()
+ //populate_legacy_globals()
diff --git a/code/controllers/subsystems/ping.dm b/code/controllers/subsystems/ping.dm
index 0b76d7dea1..0d4225b01a 100644
--- a/code/controllers/subsystems/ping.dm
+++ b/code/controllers/subsystems/ping.dm
@@ -27,18 +27,19 @@ SUBSYSTEM_DEF(ping)
var/client/client = currentrun[currentrun.len]
currentrun.len--
- if(!client?.is_preference_enabled(/datum/client_preference/vchat_enable))
- winset(client, "output", "on-show=&is-disabled=0&is-visible=1")
- winset(client, "browseroutput", "is-disabled=1;is-visible=0")
- client.tgui_panel.oldchat = TRUE
+ if(client)
+ if(!client.is_preference_enabled(/datum/client_preference/vchat_enable))
+ winset(client, "output", "on-show=&is-disabled=0&is-visible=1")
+ winset(client, "browseroutput", "is-disabled=1;is-visible=0")
+ client.tgui_panel.oldchat = TRUE
- if (client?.tgui_panel?.is_ready())
- // Send a soft ping
- client.tgui_panel.window.send_message("ping/soft", list(
- // Slightly less than the subsystem timer (somewhat arbitrary)
- // to prevent incoming pings from resetting the afk state
- "afk" = client.is_afk(3.5 SECONDS),
- ))
+ if (client?.tgui_panel?.is_ready())
+ // Send a soft ping
+ client.tgui_panel.window.send_message("ping/soft", list(
+ // Slightly less than the subsystem timer (somewhat arbitrary)
+ // to prevent incoming pings from resetting the afk state
+ "afk" = client.is_afk(3.5 SECONDS),
+ ))
if (MC_TICK_CHECK)
return
diff --git a/code/core/image/Transform.dm b/code/core/image/Transform.dm
index a2b03c4dbe..cbe8cf0fcd 100644
--- a/code/core/image/Transform.dm
+++ b/code/core/image/Transform.dm
@@ -1,3 +1,11 @@
+//Images are the ONLY other kind of child of datum that has a loc other than atom
+//Datums DO NOT have a loc themselves. Usually, loc based cleanup is handled by atom/, but it doesn't count here
+//Image is not a child of loc!
+/image/Destroy()
+ loc = null
+ . = ..()
+
+
/// The image's base transform scale for width.
/image/var/tf_scale_x
diff --git a/code/datums/chat_message.dm b/code/datums/chat_message.dm
index 8c523aea29..e7d456e7cd 100644
--- a/code/datums/chat_message.dm
+++ b/code/datums/chat_message.dm
@@ -51,8 +51,6 @@ var/list/runechat_image_cache = list()
/// If we are currently processing animation and cleanup at EOL
var/ending_life
- /// deletion timer
- var/timer_delete
/**
* Constructs a chat message overlay
@@ -75,9 +73,6 @@ var/list/runechat_image_cache = list()
generate_image(text, target, owner, extra_classes, lifespan)
/datum/chatmessage/Destroy()
- if(timer_delete)
- deltimer(timer_delete)
- timer_delete = null
if(istype(owned_by, /client)) // hopefully the PARENT_QDELETING on client should beat this if it's a disconnect
UnregisterSignal(owned_by, COMSIG_PARENT_QDELETING)
if(owned_by.seen_messages)
@@ -228,7 +223,9 @@ var/list/runechat_image_cache = list()
return
ending_life = TRUE
animate(message, alpha = 0, time = fadetime, flags = ANIMATION_PARALLEL)
- timer_delete = QDEL_IN_STOPPABLE(src, fadetime) //ChompEDIT - we use QDEL_IN_STOPPABLE, upstream just has QDEL_IN do the same thing
+ spawn(fadetime)
+ if(!QDELETED(src))
+ qdel(src)
/**
* Creates a message overlay at a defined location for a given speaker
diff --git a/code/datums/observation/moved.dm b/code/datums/observation/moved.dm
index 9ae9d91ceb..393abcd553 100644
--- a/code/datums/observation/moved.dm
+++ b/code/datums/observation/moved.dm
@@ -32,12 +32,6 @@ GLOBAL_DATUM_INIT(moved_event, /decl/observ/moved, new)
. = ..()
am.RegisterSignal(src,COMSIG_OBSERVER_MOVED, /atom/movable/proc/recursive_move, override = TRUE)
-/atom/movable/Initialize(mapload)
- . = ..()
- if(istype(loc, /atom/movable)) // on initialise, if i'm inside a thing, preregister this.
- var/atom/movable/am = loc
- RegisterSignal(am, COMSIG_OBSERVER_MOVED, /atom/movable/proc/recursive_move, override = TRUE)
-
/atom/movable/Exited(var/atom/movable/am, atom/old_loc)
. = ..()
am.UnregisterSignal(src,COMSIG_OBSERVER_MOVED)
diff --git a/code/datums/progressbar.dm b/code/datums/progressbar.dm
index 2a4dd2f92a..bffcf2ff0b 100644
--- a/code/datums/progressbar.dm
+++ b/code/datums/progressbar.dm
@@ -63,8 +63,7 @@
spawn(5)
if(client)
client.images -= bar
- //qdel(bar) //ChompEDIT - try not qdelling progressbars.
- bar = null //ChompEDIT - null instead of qdel
+ QDEL_NULL(bar)
. = ..()
#undef PROGRESSBAR_HEIGHT
diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm
index 086af2b34b..70cf4d980b 100644
--- a/code/game/machinery/computer/camera.dm
+++ b/code/game/machinery/computer/camera.dm
@@ -96,6 +96,9 @@ GLOBAL_LIST_EMPTY(bodycamera_screens) // CHOMPEdit
add_overlay("glass")
+ pinboard = SSvis_overlays.add_vis_overlay(src, icon = icon, iconstate = "pinboard", layer = 0.1, add_appearance_flags = KEEP_TOGETHER, add_vis_flags = VIS_INHERIT_ID|VIS_INHERIT_PLANE, unique = TRUE)
+ pinboard.add_filter("screen cutter", 1, alpha_mask_filter(icon = mask))
+ /*
pinboard = new()
pinboard.icon = icon
pinboard.icon_state = "pinboard"
@@ -104,6 +107,7 @@ GLOBAL_LIST_EMPTY(bodycamera_screens) // CHOMPEdit
pinboard.appearance_flags = KEEP_TOGETHER
pinboard.add_filter("screen cutter", 1, alpha_mask_filter(icon = mask))
vis_contents += pinboard
+ */
. = ..()
@@ -201,6 +205,10 @@ GLOBAL_LIST_EMPTY(bodycamera_screens) // CHOMPEdit
add_overlay("glass")
+ bpinboard = SSvis_overlays.add_vis_overlay(src, icon = icon, iconstate = "pinboard", layer = 0.1, add_appearance_flags = KEEP_TOGETHER, add_vis_flags = VIS_INHERIT_ID|VIS_INHERIT_PLANE, unique = TRUE)
+ bpinboard.add_filter("screen cutter", 1, alpha_mask_filter(icon = mask))
+ vis_contents += bpinboard
+ /*
bpinboard = new()
bpinboard.icon = icon
bpinboard.icon_state = "pinboard"
@@ -209,6 +217,7 @@ GLOBAL_LIST_EMPTY(bodycamera_screens) // CHOMPEdit
bpinboard.appearance_flags = KEEP_TOGETHER
bpinboard.add_filter("screen cutter", 1, alpha_mask_filter(icon = mask))
vis_contents += bpinboard
+ */
. = ..()
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 4ae6a293a5..0e12bdf902 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -653,7 +653,7 @@
/obj/machinery/porta_turret/proc/die() //called when the turret dies, ie, health <= 0
health = 0
stat |= BROKEN //enables the BROKEN bit
- spark_system.start() //creates some sparks because they look cool
+ spark_system?.start() //creates some sparks because they look cool
update_icon()
/obj/machinery/porta_turret/process()
diff --git a/code/game/mecha/equipment/tools/shield_omni.dm b/code/game/mecha/equipment/tools/shield_omni.dm
index 002a82feda..724611becc 100644
--- a/code/game/mecha/equipment/tools/shield_omni.dm
+++ b/code/game/mecha/equipment/tools/shield_omni.dm
@@ -77,7 +77,7 @@
/obj/item/shield_projector/rectangle/mecha/Initialize()
. = ..()
my_mech = loc
- RegisterSignal(my_mech, COMSIG_OBSERVER_MOVED, /obj/item/shield_projector/proc/update_shield_positions)
+ RegisterSignal(my_mech, COMSIG_OBSERVER_MOVED, /obj/item/shield_projector/proc/update_shield_positions, override = TRUE)
update_shift(my_mech)
/obj/item/shield_projector/rectangle/mecha/proc/update_shift(atom/movable/mech)
diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm
index 475b3f5be7..7b6bca0985 100644
--- a/code/game/objects/effects/overlays.dm
+++ b/code/game/objects/effects/overlays.dm
@@ -1,9 +1,9 @@
/obj/effect/overlay
name = "overlay"
unacidable = TRUE
- var/i_attached//Added for possible image attachments to objects. For hallucinations and the like.
+ var/i_attached //Added for possible image attachments to objects. For hallucinations and the like.
-/obj/effect/overlay/beam//Not actually a projectile, just an effect.
+/obj/effect/overlay/beam //Not actually a projectile, just an effect.
name="beam"
icon='icons/effects/beam.dmi'
icon_state="b_beam"
diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm
index dbc4e60dc1..3bdef69f13 100644
--- a/code/game/objects/items/devices/gps.dm
+++ b/code/game/objects/items/devices/gps.dm
@@ -91,9 +91,9 @@ var/list/GPS_list = list()
STOP_PROCESSING(SSobj, src)
is_in_processing_list = FALSE
GPS_list -= src
- . = ..()
update_holder()
QDEL_NULL(compass)
+ . = ..()
/obj/item/device/gps/proc/can_track(var/obj/item/device/gps/other, var/reachable_z_levels)
if(!other.tracking || other.emped || other.hide_signal)
diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm
index 839675cb62..1c337690a5 100644
--- a/code/game/objects/items/stacks/stack.dm
+++ b/code/game/objects/items/stacks/stack.dm
@@ -253,6 +253,7 @@
if(!uses_charge)
amount -= used
if (amount <= 0)
+ amount = 0 // stop amount going negative ideally
qdel(src) //should be safe to qdel immediately since if someone is still using this stack it will persist for a little while longer
update_icon()
return 1
diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm
index 71927bff27..4792b5106a 100644
--- a/code/game/turfs/simulated.dm
+++ b/code/game/turfs/simulated.dm
@@ -20,38 +20,30 @@
var/climbable = FALSE //Adds proc to wall if set to TRUE on its initialization, defined here since not all walls are subtypes of wall
var/icon_edge = 'icons/turf/outdoors_edge.dmi' //VOREStation Addition - Allows for alternative edge icon files
+ var/wet_cleanup_timer
// This is not great.
/turf/simulated/proc/wet_floor(var/wet_val = 1)
if(wet > 2) //Can't mop up ice
return
- /* //ChompEDIT START - huge CPU usage
- spawn(0)
- wet = wet_val
- if(wet_overlay)
- cut_overlay(wet_overlay)
- wet_overlay = image('icons/effects/water.dmi', icon_state = "wet_floor")
- add_overlay(wet_overlay)
- sleep(800)
- if(wet == 2)
- sleep(3200)
- wet = 0
- if(wet_overlay)
- cut_overlay(wet_overlay)
- wet_overlay = null
- */ //ChompEDIT CONTINUE
wet = wet_val
if(wet_overlay)
cut_overlay(wet_overlay)
wet_overlay = image('icons/effects/water.dmi', icon_state = "wet_floor")
add_overlay(wet_overlay)
+ if(wet_cleanup_timer)
+ deltimer(wet_cleanup_timer)
+ wet_cleanup_timer = null
if(wet == 2)
- addtimer(CALLBACK(src, PROC_REF(wet_floor_finish)), 160 SECONDS)
+ wet_cleanup_timer = addtimer(CALLBACK(src, PROC_REF(wet_floor_finish)), 160 SECONDS, TIMER_STOPPABLE)
else
- addtimer(CALLBACK(src, PROC_REF(wet_floor_finish)), 40 SECONDS)
+ wet_cleanup_timer = addtimer(CALLBACK(src, PROC_REF(wet_floor_finish)), 40 SECONDS, TIMER_STOPPABLE)
/turf/simulated/proc/wet_floor_finish()
wet = 0
+ if(wet_cleanup_timer)
+ deltimer(wet_cleanup_timer)
+ wet_cleanup_timer = null
if(wet_overlay)
cut_overlay(wet_overlay)
wet_overlay = null
diff --git a/code/modules/client/preference_setup/loadout/loadout_shoes_vr.dm b/code/modules/client/preference_setup/loadout/loadout_shoes_vr.dm
index e4f6793707..1f2ebb83fd 100644
--- a/code/modules/client/preference_setup/loadout/loadout_shoes_vr.dm
+++ b/code/modules/client/preference_setup/loadout/loadout_shoes_vr.dm
@@ -58,10 +58,16 @@
species_restricted = null
/obj/item/clothing/shoes/none/Initialize()
- ..()
- if(istype(loc, /mob))
+ . = ..()
+ if(istype(loc, /mob)) // are we in a mob?
var/mob/m = loc
m.drop_from_inventory(src, get_turf(m))
- m.update_inv_shoes()
- moveToNullspace()
- return INITIALIZE_HINT_QDEL //Fuck them shoes
+ if(contents.len) // spill out contents (e.g. microholders)
+ for(var/atom/movable/thing in contents)
+ thing.loc = get_turf(src)
+ moveToNullspace() // go to nullspace
+ spawn(1)
+ qdel(src) // die
+
+/obj/item/clothing/shoes/none/make_worn_icon(body_type, slot_name, inhands, default_icon, default_layer, icon/clip_mask) // override this to ensure that no worn icon is generated
+ return
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index ea823581be..5220da9c26 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -22,6 +22,7 @@
QDEL_NULL(touching)
// We don't qdel(bloodstr) because it's the same as qdel(reagents)
bloodstr = null
+ QDEL_NULL_LIST(internal_organs)
QDEL_NULL_LIST(stomach_contents)
return ..()
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 71e8ede37b..3394e65b68 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -58,10 +58,7 @@
/mob/living/carbon/human/Destroy()
human_mob_list -= src
- /* //Chomp REMOVE - this is done on mob/living/Destroy
- for(var/organ in organs)
- qdel(organ)
- */
+ QDEL_NULL_LIST(organs)
if(nif)
QDEL_NULL(nif) //VOREStation Add
worn_clothing.Cut()
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 728b162e86..14bc20dcba 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -53,12 +53,8 @@
if(tf_mob_holder)
tf_mob_holder = null
//VOREStation Addition End
- if(hud_list) //prune out images in hud_list
- for(var/item in hud_list)
- if(item)
- item = null
- if(selected_image)
- selected_image = null
+ QDEL_NULL_LIST(hud_list)
+ QDEL_NULL(selected_image)
//QDEL_NULL(vorePanel) //VOREStation Add commented and moved to /mob
//QDEL_LIST_NULL(vore_organs) //VOREStation Add commented and moved to /mob
temp_language_sources = null //VOREStation Add
diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/broodmother_spawn.dm b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/broodmother_spawn.dm
index 5ebb7df0d7..e800e9bfdf 100644
--- a/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/broodmother_spawn.dm
+++ b/code/modules/mob/living/simple_mob/subtypes/animal/giant_spider/broodmother_spawn.dm
@@ -14,7 +14,10 @@
/mob/living/simple_mob/animal/giant_spider/frost/broodling/death()
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- qdel(src)
+
+ spawn(1)
+ if(!QDELETED(src))
+ qdel(src)
/mob/living/simple_mob/animal/giant_spider/electric/broodling
maxHealth = 30
@@ -32,7 +35,10 @@
/mob/living/simple_mob/animal/giant_spider/electric/broodling/death()
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- qdel(src)
+
+ spawn(1)
+ if(!QDELETED(src))
+ qdel(src)
/mob/living/simple_mob/animal/giant_spider/hunter/broodling
maxHealth = 40
@@ -47,7 +53,10 @@
/mob/living/simple_mob/animal/giant_spider/hunter/broodling/death()
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- qdel(src)
+
+ spawn(1)
+ if(!QDELETED(src))
+ qdel(src)
/mob/living/simple_mob/animal/giant_spider/lurker/broodling
maxHealth = 40
@@ -62,7 +71,10 @@
/mob/living/simple_mob/animal/giant_spider/lurker/broodling/death()
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- qdel(src)
+
+ spawn(1)
+ if(!QDELETED(src))
+ qdel(src)
/mob/living/simple_mob/animal/giant_spider/nurse/broodling
maxHealth = 60
@@ -78,7 +90,10 @@
/mob/living/simple_mob/animal/giant_spider/nurse/broodling/death()
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- qdel(src)
+
+ spawn(1)
+ if(!QDELETED(src))
+ qdel(src)
/mob/living/simple_mob/animal/giant_spider/pepper/broodling
maxHealth = 40
@@ -93,7 +108,10 @@
/mob/living/simple_mob/animal/giant_spider/pepper/broodling/death()
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- qdel(src)
+
+ spawn(1)
+ if(!QDELETED(src))
+ qdel(src)
/mob/living/simple_mob/animal/giant_spider/thermic/broodling
maxHealth = 40
@@ -111,7 +129,10 @@
/mob/living/simple_mob/animal/giant_spider/thermic/broodling/death()
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- qdel(src)
+
+ spawn(1)
+ if(!QDELETED(src))
+ qdel(src)
/mob/living/simple_mob/animal/giant_spider/tunneler/broodling
maxHealth = 40
@@ -126,7 +147,10 @@
/mob/living/simple_mob/animal/giant_spider/tunneler/broodling/death()
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- qdel(src)
+
+ spawn(1)
+ if(!QDELETED(src))
+ qdel(src)
/mob/living/simple_mob/animal/giant_spider/webslinger/broodling
maxHealth = 30
@@ -143,7 +167,10 @@
/mob/living/simple_mob/animal/giant_spider/webslinger/broodling/death()
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- qdel(src)
+
+ spawn(1)
+ if(!QDELETED(src))
+ qdel(src)
/mob/living/simple_mob/animal/giant_spider/broodling
maxHealth = 60
@@ -161,4 +188,7 @@
/mob/living/simple_mob/animal/giant_spider/broodling/death()
new /obj/effect/decal/cleanable/spiderling_remains(src.loc)
- qdel(src)
+
+ spawn(1)
+ if(!QDELETED(src))
+ qdel(src)
diff --git a/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/mecha.dm b/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/mecha.dm
index d572508433..07a0412fc1 100644
--- a/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/mecha.dm
+++ b/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/mecha.dm
@@ -94,7 +94,7 @@
/mob/living/simple_mob/mechanical/mecha/bullet_act()
. = ..()
- sparks.start()
+ sparks?.start()
/mob/living/simple_mob/mechanical/mecha/speech_bubble_appearance()
return pilot_type ? "" : ..()
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 6c5a9ad3ff..bf7f1ceaae 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -4,20 +4,19 @@
living_mob_list -= src
player_list -= src
unset_machine()
- QDEL_NULL(hud_used)
clear_fullscreen()
if(client)
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
qdel(spell_master)
remove_screen_obj_references()
- client.screen.Cut()
+ client.screen = list()
if(mind && mind.current == src)
spellremove(src)
if(!istype(src,/mob/observer)) //CHOMPEdit
ghostize() //CHOMPEdit
//ChompEDIT start - fix hard qdels
QDEL_NULL(plane_holder)
-
+ QDEL_NULL(hud_used)
if(pulling)
stop_pulling() //TG does this on atom/movable but our stop_pulling proc is here so whatever
diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm
index a8309ae880..0809f852ed 100644
--- a/code/modules/mob/new_player/new_player.dm
+++ b/code/modules/mob/new_player/new_player.dm
@@ -87,7 +87,7 @@
output += "Show Player Polls
No Changes
" //ChompEDIT - fixed height
*/
- if(client.check_for_new_server_news())
+ if(client?.check_for_new_server_news())
output += "Show Server News
(NEW!)
" //ChompEDIT 'Game updates' --> 'Server news'
else
output += "Show Server News
No Changes
" //ChompEDIT 'Game updates' --> 'Server news'
diff --git a/code/modules/power/singularity/particle_accelerator/particle.dm b/code/modules/power/singularity/particle_accelerator/particle.dm
index 5d559ec2cb..e2773f0396 100644
--- a/code/modules/power/singularity/particle_accelerator/particle.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle.dm
@@ -99,6 +99,5 @@
if(movement_range <= 0)
qdel(src)
else
- //sleep(lag) //ChompEDIT
- //move(lag) //ChompEDIT
- addtimer(CALLBACK(src, PROC_REF(move), lag), lag) //ChompEDIT
\ No newline at end of file
+ spawn(lag)
+ move(lag)
diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm
index 772e190282..9545acaaf6 100644
--- a/code/modules/projectiles/ammunition.dm
+++ b/code/modules/projectiles/ammunition.dm
@@ -23,6 +23,10 @@
BB = new projectile_type(src)
randpixel_xy()
+/obj/item/ammo_casing/Destroy()
+ QDEL_NULL(BB)
+ return ..()
+
//removes the projectile from the ammo casing
/obj/item/ammo_casing/proc/expend()
. = BB
diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm
index c5317bb1fe..6a8b387b54 100644
--- a/code/modules/projectiles/projectile.dm
+++ b/code/modules/projectiles/projectile.dm
@@ -469,15 +469,13 @@
impacted_mobs.Cut()
impacted_mobs = null
- trajectory = null
- beam_index = null
- beam_components = null
-
+ qdel(trajectory)
+ cleanup_beam_segments()
if(my_case)
if(my_case.BB == src)
my_case.BB = null
- my_case = null
+ my_case = null
return ..()
@@ -743,6 +741,12 @@
/obj/item/projectile/proc/launch_projectile(atom/target, target_zone, mob/user, params, angle_override, forced_spread = 0)
+
+ if(!get_turf(user) && !get_turf(src)) // if both the user of the projectile AND the projectile itself are in nullspace, don't fire, just remove ourselves
+ spawn(1)
+ qdel(src)
+ return //fire returns nothing, so neither do we need to
+
original = target
def_zone = check_zone(target_zone)
firer = user
diff --git a/code/modules/reagents/holder/holder.dm b/code/modules/reagents/holder/holder.dm
index 8a22d5db79..1c5630b1e6 100644
--- a/code/modules/reagents/holder/holder.dm
+++ b/code/modules/reagents/holder/holder.dm
@@ -243,7 +243,10 @@
if(!target || !istype(target))
return
- amount = max(0, min(amount, total_volume, target.get_free_space() / multiplier))
+ if(multiplier)
+ amount = max(0, min(amount, total_volume, target.get_free_space() / multiplier))
+ else
+ amount = max(0, min(amount, total_volume))
if(!amount)
return
diff --git a/code/modules/reagents/reagents/dispenser.dm b/code/modules/reagents/reagents/dispenser.dm
index beac8756e2..d71b3b39db 100644
--- a/code/modules/reagents/reagents/dispenser.dm
+++ b/code/modules/reagents/reagents/dispenser.dm
@@ -443,7 +443,7 @@
if(B.item_digest_mode == IM_HOLD)
return
var/obj/item/I = O
- var/spent_amt = I.digest_act(I.loc, 1, amount / (meltdose / 3))
+ var/spent_amt = I.digest_act(B, 1, amount / (meltdose / 3))
remove_self(spent_amt) //10u stomacid per w_class, less if stronger acid.
if(B.owner)
B.owner_adjust_nutrition((B.nutrition_percent / 100) * 5 * spent_amt)
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 4f52a7930f..35f964a12f 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -642,7 +642,6 @@
src.destinationTag = T.sortTag
// CHOMPEdit End
-
// start the movement process
// argument is the disposal unit the holder started in
/obj/structure/disposalholder/proc/start(var/obj/machinery/disposal/D)
@@ -873,6 +872,10 @@
if(!istype(H))
return
+ if(!isturf(T)) // try very hard to ensure we have a valid turf target
+ var/turf/GT = get_turf(T)
+ T = (GT ? GT : get_turf(src))
+
// Empty the holder if it is expelled into a dense turf.
// Leaving it intact and sitting in a wall is stupid.
if(T.density)
diff --git a/code/modules/shieldgen/directional_shield.dm b/code/modules/shieldgen/directional_shield.dm
index 227a9f6853..295df9166a 100644
--- a/code/modules/shieldgen/directional_shield.dm
+++ b/code/modules/shieldgen/directional_shield.dm
@@ -103,6 +103,11 @@
if(always_on)
create_shields()
RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(moved_event))
+
+ if(istype(loc, /atom/movable)) // on initialise, if i'm inside a thing, preregister this.
+ var/atom/movable/am = loc
+ RegisterSignal(am, COMSIG_OBSERVER_MOVED, /atom/movable/proc/recursive_move, override = TRUE)
+
return ..()
/obj/item/shield_projector/Destroy()
diff --git a/code/modules/vore/chat_healthbars.dm b/code/modules/vore/chat_healthbars.dm
index f64be8c25b..66e191a29b 100644
--- a/code/modules/vore/chat_healthbars.dm
+++ b/code/modules/vore/chat_healthbars.dm
@@ -8,6 +8,8 @@
if(!override) //Did the person push the verb? Ignore the pref
if(!reciever.client.is_preference_enabled(/datum/client_preference/vore_health_bars))
return
+ if(!istype(src.loc, /obj/belly)) // not in a belly? don't bother
+ return
var/ourpercent = 0
if(ishuman(src)) //humans don't die or become unconcious at 0%, it's actually like -50% or something, so, let's pretend they have 50 more health than they do
diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm
index 9a0343bd53..b2399c9c56 100644
--- a/code/modules/vore/eating/belly_obj_vr.dm
+++ b/code/modules/vore/eating/belly_obj_vr.dm
@@ -1166,7 +1166,7 @@
// but can easily make the message vary based on how many people are inside, etc.
// Returns a string which shoul be appended to the Examine output.
/obj/belly/proc/get_examine_msg()
- if(!(contents.len) || !(examine_messages.len))
+ if(!(contents.len) || !(examine_messages?.len))
return ""
var/formatted_message
diff --git a/code/modules/vore/eating/bellymodes_vr.dm b/code/modules/vore/eating/bellymodes_vr.dm
index 14a5287d86..b3ea06dccd 100644
--- a/code/modules/vore/eating/bellymodes_vr.dm
+++ b/code/modules/vore/eating/bellymodes_vr.dm
@@ -137,7 +137,7 @@
//these are all external sound triggers now, so it's ok.
if(emote_active)
- var/list/EL = emote_lists[digest_mode]
+ var/list/EL = emote_lists?[digest_mode]
if((LAZYLEN(EL) || LAZYLEN(emote_lists[DM_HOLD_ABSORBED]) || (digest_mode == DM_DIGEST && LAZYLEN(emote_lists[DM_HOLD])) || (digest_mode == DM_SELECT && (LAZYLEN(emote_lists[DM_HOLD])||LAZYLEN(emote_lists[DM_DIGEST])||LAZYLEN(emote_lists[DM_ABSORB])) )) && next_emote <= world.time)
var/living_count = 0
var/absorbed_count = 0