From b312ff41dbd2c3b52c2653f6a0ac0a0ac62fa365 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Tue, 6 Oct 2015 23:29:51 -0400 Subject: [PATCH] More Destroying Tweaks --- code/LINDA/LINDA_turf_tile.dm | 4 +-- code/_onclick/hud/screen_objects.dm | 2 +- code/game/smoothwall.dm | 3 ++ code/game/turfs/simulated/walls.dm | 6 ---- code/game/turfs/turf.dm | 4 +-- code/modules/mob/dead/observer/observer.dm | 17 +++------ code/modules/mob/living/silicon/ai/ai.dm | 13 +++---- .../living/silicon/ai/freelook/cameranet.dm | 2 +- .../mob/living/silicon/ai/freelook/eye.dm | 6 +--- .../mob/living/silicon/ai/freelook/read_me.dm | 2 +- .../modules/mob/living/silicon/robot/robot.dm | 4 +++ .../mob/living/silicon/robot/robot_modules.dm | 36 ++++++++++--------- code/modules/mob/mob.dm | 3 ++ 13 files changed, 48 insertions(+), 54 deletions(-) diff --git a/code/LINDA/LINDA_turf_tile.dm b/code/LINDA/LINDA_turf_tile.dm index 80127669417..30f9be83b4c 100644 --- a/code/LINDA/LINDA_turf_tile.dm +++ b/code/LINDA/LINDA_turf_tile.dm @@ -67,11 +67,11 @@ air.temperature = temperature -/turf/simulated/Del() +/turf/simulated/Destroy() visibilityChanged() if(active_hotspot) qdel(active_hotspot) - ..() + return ..() /turf/simulated/assume_air(datum/gas_mixture/giver) if(!giver) return 0 diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 8f2cb283829..ea5202fd03f 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -69,7 +69,7 @@ if(master) var/obj/item/I = usr.get_active_hand() if(I) - master.attackby(I, usr, params, params) + master.attackby(I, usr, params) return 1 /obj/screen/gun diff --git a/code/game/smoothwall.dm b/code/game/smoothwall.dm index 3c55255eb78..48d150dfb85 100644 --- a/code/game/smoothwall.dm +++ b/code/game/smoothwall.dm @@ -73,6 +73,9 @@ relativewall_neighbours() /turf/simulated/wall/Destroy() + for(var/obj/effect/E in src) + if(E.name == "Wallrot") + qdel(E) if(!del_suppress_resmoothing) spawn(10) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 82379c9defd..30f3e69a5ad 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -32,12 +32,6 @@ /obj/structure/falsewall/reinforced // WHY DO WE SMOOTH WITH FALSE R-WALLS WHEN WE DON'T SMOOTH WITH REAL R-WALLS. ) - -/turf/simulated/wall/Del() - for(var/obj/effect/E in src) - if(E.name == "Wallrot") - qdel(E) - /turf/simulated/wall/ChangeTurf(var/newtype) for(var/obj/effect/E in src) if(E.name == "Wallrot") diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 0ad197e085e..09890dc7617 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -42,10 +42,7 @@ return /turf/Destroy() - return QDEL_HINT_HARDDEL_NOW - // Adds the adjacent turfs to the current atmos processing -/turf/Del() if(air_master) for(var/direction in cardinal) if(atmos_adjacent_turfs & direction) @@ -53,6 +50,7 @@ if(istype(T)) air_master.add_to_active(T) ..() + return QDEL_HINT_HARDDEL_NOW /turf/ex_act(severity) return 0 diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 7d68a50340f..c483f1ee750 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -87,6 +87,10 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi ..() /mob/dead/observer/Destroy() + if(ismob(following)) + var/mob/M = following + M.following_mobs -= src + following = null if (ghostimage) ghost_darkness_images -= ghostimage qdel(ghostimage) @@ -382,19 +386,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob var/list/following_mobs = list() -/mob/Destroy() - for(var/mob/dead/observer/M in following_mobs) - M.following = null - following_mobs = null - return ..() - -/mob/dead/observer/Destroy() - if(ismob(following)) - var/mob/M = following - M.following_mobs -= src - following = null - return ..() - /mob/Move() . = ..() if(.) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 5c41901fa21..0160049cbc6 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -101,7 +101,7 @@ var/list/ai_verbs_default = list( announcement.announcement_type = "A.I. Announcement" announcement.announcer = name announcement.newscast = 1 - + var/list/possibleNames = ai_names var/pickedName = null @@ -215,7 +215,7 @@ var/list/ai_verbs_default = list( /mob/living/silicon/ai/SetName(pickedName as text) ..() - + announcement.announcer = name if(eyeobj) @@ -229,6 +229,7 @@ var/list/ai_verbs_default = list( /mob/living/silicon/ai/Destroy() ai_list -= src + qdel(eyeobj) // No AI, no Eye return ..() @@ -332,19 +333,19 @@ var/list/ai_verbs_default = list( set name = "Show Crew Manifest" set category = "AI Commands" show_station_manifest() - + /mob/living/silicon/ai/var/message_cooldown = 0 /mob/living/silicon/ai/proc/ai_announcement_text() set category = "AI Commands" set name = "Make Station Announcement" - + if(check_unable(AI_CHECK_WIRELESS | AI_CHECK_RADIO)) return if(message_cooldown) src << "Please allow one minute to pass between announcements." return - + var/input = input(usr, "Please write a message to announce to the station crew.", "A.I. Announcement") as message|null if(!input) return @@ -383,7 +384,7 @@ var/list/ai_verbs_default = list( /mob/living/silicon/ai/proc/ai_cancel_call() set name = "Recall Emergency Shuttle" set category = "AI Commands" - + if(check_unable(AI_CHECK_WIRELESS)) return diff --git a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm index 584af962874..d2b23c93eff 100644 --- a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm +++ b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm @@ -5,7 +5,7 @@ var/datum/cameranet/cameranet = new() /datum/cameranet - // The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del(). + // The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Destroy(). var/list/cameras = list() var/cameras_unsorted = 1 // The chunks of the map, mapping the areas that the cameras can see. diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index 89dbeb14740..6a157225c2c 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -29,6 +29,7 @@ qdel(ghostimage) ghostimage = null; updateallghostimages() + ai = null return ..() // Movement code. Returns 0 to stop air movement from moving it. @@ -95,11 +96,6 @@ spawn(5) eyeobj.loc = src.loc -/mob/living/silicon/ai/Destroy() - eyeobj.ai = null - qdel(eyeobj) // No AI, no Eye - return ..() - /atom/proc/move_camera_by_click() if(istype(usr, /mob/living/silicon/ai)) var/mob/living/silicon/ai/AI = usr diff --git a/code/modules/mob/living/silicon/ai/freelook/read_me.dm b/code/modules/mob/living/silicon/ai/freelook/read_me.dm index 53e68ff1377..8ddb0689409 100644 --- a/code/modules/mob/living/silicon/ai/freelook/read_me.dm +++ b/code/modules/mob/living/silicon/ai/freelook/read_me.dm @@ -20,7 +20,7 @@ HOW IT WORKS It works by first creating a camera network datum. Inside of this camera network are "chunks" (which will be - explained later) and "cameras". The cameras list is kept up to date by obj/machinery/camera/New() and Del(). + explained later) and "cameras". The cameras list is kept up to date by obj/machinery/camera/New() and Destroy(). Next the camera network has chunks. These chunks are a 16x16 tile block of turfs and cameras contained inside the chunk. These turfs are then sorted out based on what the cameras can and cannot see. If none of the cameras can see the turf, inside diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 2e71b85b668..f7372a79f5f 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -206,6 +206,10 @@ var/list/robot_verbs_default = list( connected_ai.connected_robots -= src qdel(wires) wires = null + qdel(module) + module = null + camera = null + cell = null return ..() /mob/living/silicon/robot/proc/pick_module() diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 4e45d6bc2ba..9a44a61d3bd 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -10,7 +10,7 @@ var/obj/item/emag = null var/obj/item/borg/upgrade/jetpack = null var/list/subsystems = list() - + var/list/stacktypes var/channels = list() @@ -30,7 +30,11 @@ src.modules += new /obj/item/device/flash/cyborg(src) src.emag = new /obj/item/toy/sword(src) src.emag.name = "Placeholder Emag Item" - + +/obj/item/weapon/robot_module/Destroy() + modules.Cut() + emag = null + return ..() /obj/item/weapon/robot_module/proc/fix_modules() for(var/obj/item/I in modules) @@ -83,7 +87,7 @@ R.add_language("Chittin", 0) R.add_language("Bubblish", 0) R.add_language("Clownish",0) - + /obj/item/weapon/robot_module/proc/add_subsystems(var/mob/living/silicon/robot/R) R.verbs |= subsystems @@ -102,7 +106,7 @@ src.modules += new /obj/item/weapon/crowbar(src) src.modules += new /obj/item/device/healthanalyzer(src) src.emag = new /obj/item/weapon/melee/energy/sword/cyborg(src) - + fix_modules() /obj/item/weapon/robot_module/medical @@ -114,7 +118,7 @@ /obj/item/stack/medical/splint = 5, /obj/item/stack/nanopaste = 5 ) - + /obj/item/weapon/robot_module/medical/New() src.modules += new /obj/item/device/flash/cyborg(src) src.modules += new /obj/item/device/healthanalyzer/advanced(src) @@ -144,7 +148,7 @@ src.emag.reagents.add_reagent("facid", 250) src.emag.name = "Polyacid spray" - + fix_modules() /obj/item/weapon/robot_module/medical/respawn_consumable(var/mob/living/silicon/robot/R) @@ -223,7 +227,7 @@ src.modules += new /obj/item/taperoll/police(src) src.modules += new /obj/item/clothing/mask/gas/sechailer/cyborg(src) src.emag = new /obj/item/weapon/gun/energy/laser/cyborg(src) - + fix_modules() /obj/item/weapon/robot_module/janitor @@ -240,7 +244,7 @@ src.emag.reagents.add_reagent("lube", 250) src.emag.name = "Lube spray" - + fix_modules() /obj/item/weapon/robot_module/butler @@ -270,7 +274,7 @@ R.my_atom = src.emag R.add_reagent("beer2", 50) src.emag.name = "Mickey Finn's Special Brew" - + fix_modules() /obj/item/weapon/robot_module/butler/respawn_consumable(var/mob/living/silicon/robot/R) @@ -327,7 +331,7 @@ src.modules += new /obj/item/weapon/storage/bag/sheetsnatcher/borg(src) src.modules += new /obj/item/weapon/gun/energy/kinetic_accelerator/cyborg(src) src.emag = new /obj/item/borg/stun(src) - + fix_modules() /obj/item/weapon/robot_module/deathsquad @@ -341,7 +345,7 @@ src.modules += new /obj/item/weapon/tank/jetpack/carbondioxide(src) src.modules += new /obj/item/weapon/crowbar(src) src.emag = null - + fix_modules() /obj/item/weapon/robot_module/syndicate @@ -357,9 +361,9 @@ src.modules += new /obj/item/weapon/crowbar(src) src.modules += new /obj/item/weapon/pinpointer/operative(src) src.emag = null - + fix_modules() - + /obj/item/weapon/robot_module/syndicate_medical name = "syndicate medical robot module" stacktypes = list( @@ -368,7 +372,7 @@ /obj/item/stack/medical/splint = 25, /obj/item/stack/nanopaste = 25 ) - + /obj/item/weapon/robot_module/syndicate_medical/New() src.modules += new /obj/item/device/flash/cyborg(src) src.modules += new /obj/item/device/healthanalyzer/advanced(src) @@ -395,7 +399,7 @@ src.modules += new /obj/item/weapon/crowbar(src) src.modules += new /obj/item/weapon/pinpointer/operative(src) src.emag = null - + fix_modules() /obj/item/weapon/robot_module/combat @@ -410,7 +414,7 @@ src.modules += new /obj/item/borg/combat/mobility(src) src.modules += new /obj/item/weapon/wrench(src) //Is a combat android really going to be stopped by a chair? src.emag = new /obj/item/weapon/gun/energy/lasercannon/cyborg(src) - + fix_modules() /obj/item/weapon/robot_module/alien/hunter diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ae830d920b3..084ff2d3935 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -6,6 +6,9 @@ if(mind && mind.current == src) spellremove(src) ghostize() + for(var/mob/dead/observer/M in following_mobs) + M.following = null + following_mobs = null return ..() /mob/New()