Code Cleanup: Destroy() fixes part 1 + Misc Fixes (#1933)

In this PR:

Destroy() fixes backported from PR #1783.
JaniPDA fixes & improvements.
Chickens no longer consume their own eggs.
Language adding in setup is now 100% more sane.
Chemical dispensers now actually check that the user is still alive before renaming.
Ghosts are now marked as non-simulated atoms.
Non-simulated atoms no longer trigger proximity listeners.
Vendors no longer accept synthetic tools as stocking options.
Fixes #812.
Fixes #1877, Fixes #1929.
Fixes #1930.
Fixes #1152, Fixes #1917.
Fixes #1902.
Fixes #1165.
This commit is contained in:
Lohikar
2017-03-18 23:06:24 +02:00
committed by skull132
parent 905a338a98
commit 63eafb3643
37 changed files with 208 additions and 75 deletions
@@ -13,6 +13,7 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
blinded = 0
anchored = 1 // don't get pushed around
invisibility = INVISIBILITY_OBSERVER
simulated = FALSE
var/can_reenter_corpse
var/datum/hud/living/carbon/hud = null // hud
var/bootime = 0
+3
View File
@@ -52,6 +52,8 @@ var/list/cleanbot_types // Going to use this to generate a list of types once th
listener = new /obj/cleanbot_listener(src)
listener.cleanbot = src
janitorial_supplies |= src
if(radio_controller)
radio_controller.add_object(listener, beacon_freq, filter = RADIO_NAVBEACONS)
@@ -61,6 +63,7 @@ var/list/cleanbot_types // Going to use this to generate a list of types once th
patrol_path = null
target = null
ignorelist = null
janitorial_supplies -= src
/mob/living/bot/cleanbot/proc/handle_target()
if(target.clean_marked && target.clean_marked != src)
+1 -4
View File
@@ -17,13 +17,10 @@
germ_level++
/mob/living/carbon/Destroy()
qdel(ingested)
qdel(touching)
QDEL_NULL(touching)
// We don't qdel(bloodstr) because it's the same as qdel(reagents)
for(var/guts in internal_organs)
qdel(guts)
for(var/food in stomach_contents)
qdel(food)
return ..()
/mob/living/carbon/rejuvenate()
+14 -13
View File
@@ -39,20 +39,21 @@
var/obj/item/organ/external/head = get_organ("head")
var/mob/living/simple_animal/borer/B
for(var/I in head.implants)
if(istype(I,/mob/living/simple_animal/borer))
B = I
if(B)
if(!B.ckey && ckey && B.controlling)
B.ckey = ckey
B.controlling = 0
if(B.host_brain.ckey)
ckey = B.host_brain.ckey
B.host_brain.ckey = null
B.host_brain.name = "host brain"
B.host_brain.real_name = "host brain"
if (head)
for(var/I in head.implants)
if(istype(I,/mob/living/simple_animal/borer))
B = I
if(B)
if(!B.ckey && ckey && B.controlling)
B.ckey = ckey
B.controlling = 0
if(B.host_brain.ckey)
ckey = B.host_brain.ckey
B.host_brain.ckey = null
B.host_brain.name = "host brain"
B.host_brain.real_name = "host brain"
verbs -= /mob/living/carbon/proc/release_control
verbs -= /mob/living/carbon/proc/release_control
callHook("death", list(src, gibbed))
+24 -2
View File
@@ -81,8 +81,30 @@
human_mob_list -= src
for(var/organ in organs)
qdel(organ)
if (DS)
qdel(DS)//prevents the dionastats holding onto references and blocking GC
organs = null
internal_organs_by_name = null
internal_organs = null
organs_by_name = null
bad_internal_organs = null
bad_external_organs = null
QDEL_NULL(DS)
// qdel and null out our equipment.
QDEL_NULL(shoes)
QDEL_NULL(belt)
QDEL_NULL(gloves)
QDEL_NULL(glasses)
QDEL_NULL(head)
QDEL_NULL(l_ear)
QDEL_NULL(r_ear)
QDEL_NULL(wear_id)
QDEL_NULL(r_store)
QDEL_NULL(l_store)
QDEL_NULL(s_store)
QDEL_NULL(wear_suit)
// Do this last so the mob's stuff doesn't drop on del.
QDEL_NULL(w_uniform)
return ..()
/mob/living/carbon/human/Stat()
+8
View File
@@ -782,3 +782,11 @@ default behaviour is:
src << "<b>You are now \the [src]!</b>"
src << "<span class='notice'>Remember to stay in character for a mob of this type!</span>"
return 1
/mob/living/Destroy()
for (var/thing in stomach_contents)
qdel(thing)
stomach_contents = null
QDEL_NULL(ingested)
return ..()
@@ -248,6 +248,7 @@
connected_ai.connected_robots -= src
qdel(wires)
wires = null
QDEL_NULL(spark_system)
return ..()
/mob/living/silicon/robot/proc/set_module_sprites(var/list/new_sprites)
@@ -179,6 +179,7 @@
beg_for_food = 0
density = 0
mob_size = 0.75//just a rough estimate, the real value should be way lower
hunger_enabled = FALSE
/mob/living/simple_animal/chick/New()
..()
@@ -227,6 +228,7 @@ var/global/chicken_count = 0
holder_type = /obj/item/weapon/holder/chicken
density = 0
mob_size = 2
hunger_enabled = FALSE
/mob/living/simple_animal/chicken/New()
..()
@@ -256,14 +258,17 @@ var/global/chicken_count = 0
var/obj/item/weapon/reagent_containers/food/snacks/grown/G = O
if(G.seed && G.seed.kitchen_tag == "wheat")
if(!stat && eggsleft < 8)
user.visible_message("\blue [user] feeds [O] to [name]! It clucks happily.","\blue You feed [O] to [name]! It clucks happily.")
user.visible_message(
span("notice", "\The [user] feeds \the [O] to \the [name]! It clucks happily."),
span("notice", "You feed \the [O] to \the [name]! It clucks happily."),
"You hear a cluck.")
user.drop_item()
qdel(O)
eggsleft += rand(1, 4)
else
user << "\blue [name] doesn't seem hungry!"
user << "\The [name] doesn't seem hungry!"
else
user << "[name] doesn't seem interested in that."
user << "\The [name] doesn't seem interested in that."
else
..()
@@ -439,9 +439,8 @@
spark_system = bind_spark(src, 5)
/mob/living/simple_animal/hostile/bear/spatial/Destroy()
if (spark_system)
qdel(spark_system)
..()
QDEL_NULL(spark_system)
return ..()
//Called when we want to bypass ticks and attack immediately. For example in response to being shot
//This calls several procs and some duplicated code from the parent class to immediately put us in an assault state and lash out