From 54d02d75a3da4ae3a73e00eea34d4bbfa3d6e73f Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Tue, 22 Jan 2013 23:45:47 +0000 Subject: [PATCH] - Committed SuperSayu's patch fix for silicon alarms. - Made the singularity not move stuff while contained, should help and make it easier to work with; such as fixing the field generator. - Added logging for gold slime extracts. - Removed unneeded deletion of signals in telecomms code. - Added a debug verb which will record pointers of signals that weren't garbage collected. - Removed the need to create a mob to compare it in telecomms code. - The spider infestation is more likely going to spawn nurses. - Runtime fix with spells. - Reverse list actually does something now. Bots never needed it so I removed it. (Thanks carn) - Added an ON_BORDER flag for border firedoors. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5601 316c924e-a436-60f5-8080-3fe189b3f50e --- code/__HELPERS/lists.dm | 8 +-- code/datums/spells/projectile.dm | 3 + code/game/communications.dm | 67 +++++++++++++------ code/game/machinery/bots/cleanbot.dm | 2 - code/game/machinery/bots/ed209bot.dm | 1 - code/game/machinery/bots/floorbot.dm | 1 - code/game/machinery/bots/medbot.dm | 1 - code/game/machinery/bots/mulebot.dm | 1 - code/game/machinery/bots/secbot.dm | 1 - code/game/machinery/doors/firedoor.dm | 2 + .../embedded_controller_base.dm | 2 +- code/game/machinery/telecomms/logbrowser.dm | 18 +++-- .../machinery/telecomms/telecomunications.dm | 2 +- code/game/objects/effects/spiders.dm | 6 +- code/modules/admin/verbs/mapping.dm | 1 + code/modules/events/spider_infestation.dm | 4 +- code/modules/mob/living/silicon/silicon.dm | 12 ++-- code/modules/power/singularity/singularity.dm | 4 +- code/modules/reagents/Chemistry-Recipes.dm | 19 ++++++ 19 files changed, 102 insertions(+), 53 deletions(-) diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index 7076565f541..5f018feb152 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -146,11 +146,11 @@ proc/listclearnulls(list/list) * Sorting */ -//Reverses the order of items in the list (Turning a stack into a queue) +//Reverses the order of items in the list /proc/reverselist(var/list/input) - var/list/output = new/list() - for(var/A in input) - output += A + var/list/output = list() + for(var/i = input.len; i >= 1; i--) + output += input[i] return output //Randomize: Return the list in a random order diff --git a/code/datums/spells/projectile.dm b/code/datums/spells/projectile.dm index 5d5ba5e1f8e..1df999cecce 100644 --- a/code/datums/spells/projectile.dm +++ b/code/datums/spells/projectile.dm @@ -57,6 +57,9 @@ else step(projectile,dir) + if(!projectile) // step and step_to sleeps so we'll have to check again. + break + if(!proj_lingering && projectile.loc == current_loc) //if it didn't move since last time del(projectile) break diff --git a/code/game/communications.dm b/code/game/communications.dm index e3a42c0fb09..2bf0dc0b4cc 100644 --- a/code/game/communications.dm +++ b/code/game/communications.dm @@ -182,7 +182,7 @@ datum/radio_frequency if(range) start_point = get_turf(source) if(!start_point) - del(signal) +// del(signal) return 0 if (filter) //here goes some copypasta. It is for optimisation. -rastaf0 for(var/obj/device in devices[filter]) @@ -255,11 +255,26 @@ datum/radio_frequency del(devices_line) -obj/proc - receive_signal(datum/signal/signal, receive_method, receive_param) - return null +var/list/pointers = list() -datum/signal +/client/proc/print_pointers() + set name = "Debug Signals" + set category = "Debug" + + if(!holder) + return + + src << "There are [pointers.len] pointers:" + for(var/p in pointers) + src << p + var/datum/signal/S = locate(p) + if(istype(S)) + src << S.debug_print() + +/obj/proc/receive_signal(datum/signal/signal, receive_method, receive_param) + return null + +/datum/signal var/obj/source var/transmission_method = 0 @@ -272,21 +287,29 @@ datum/signal var/frequency = 0 - proc/copy_from(datum/signal/model) - source = model.source - transmission_method = model.transmission_method - data = model.data - encryption = model.encryption - frequency = model.frequency +/datum/signal/New() + ..() + pointers += "\ref[src]" - proc/debug_print() - if (source) - . = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n" - else - . = "signal = {source = '[source]' ()\n" - for (var/i in data) - . += "data\[\"[i]\"\] = \"[data[i]]\"\n" - if(islist(data[i])) - var/list/L = data[i] - for(var/t in L) - . += "data\[\"[i]\"\] list has: [t]" +/datum/signal/Del() + pointers -= "\ref[src]" + ..() + +/datum/signal/proc/copy_from(datum/signal/model) + source = model.source + transmission_method = model.transmission_method + data = model.data + encryption = model.encryption + frequency = model.frequency + +/datum/signal/proc/debug_print() + if (source) + . = "signal = {source = '[source]' ([source:x],[source:y],[source:z])\n" + else + . = "signal = {source = '[source]' ()\n" + for (var/i in data) + . += "data\[\"[i]\"\] = \"[data[i]]\"\n" + if(islist(data[i])) + var/list/L = data[i] + for(var/t in L) + . += "data\[\"[i]\"\] list has: [t]" diff --git a/code/game/machinery/bots/cleanbot.dm b/code/game/machinery/bots/cleanbot.dm index b9921b6736e..625b0585da1 100644 --- a/code/game/machinery/bots/cleanbot.dm +++ b/code/game/machinery/bots/cleanbot.dm @@ -225,7 +225,6 @@ text("[src.oddbutton ? "Yes" : "No" next_dest_loc = closest_loc if (next_dest_loc) src.patrol_path = AStar(src.loc, next_dest_loc, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id=botcard, exclude=null) - src.patrol_path = reverselist(src.patrol_path) else patrol_move() @@ -235,7 +234,6 @@ text("[src.oddbutton ? "Yes" : "No" spawn(0) if(!src || !target) return src.path = AStar(src.loc, src.target.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, 0, 30) - src.path = reverselist(src.path) if(src.path.len == 0) src.oldtarget = src.target src.target = null diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index 0b4b9f21b16..6bd48380a9e 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -615,7 +615,6 @@ Auto Patrol: []"}, // given an optional turf to avoid /obj/machinery/bot/ed209/proc/calc_path(var/turf/avoid = null) src.path = AStar(src.loc, patrol_target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id=botcard, exclude=avoid) - src.path = reverselist(src.path) // look for a criminal in view of the bot diff --git a/code/game/machinery/bots/floorbot.dm b/code/game/machinery/bots/floorbot.dm index 986728f5c66..bb984a1787b 100644 --- a/code/game/machinery/bots/floorbot.dm +++ b/code/game/machinery/bots/floorbot.dm @@ -244,7 +244,6 @@ src.path = AStar(src.loc, src.target.loc, /turf/proc/AdjacentTurfsSpace, /turf/proc/Distance, 0, 30) else src.path = AStar(src.loc, src.target, /turf/proc/AdjacentTurfsSpace, /turf/proc/Distance, 0, 30) - src.path = reverselist(src.path) if(src.path.len == 0) src.oldtarget = src.target src.target = null diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index df7b8b0ff81..71cccfdc3ee 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -299,7 +299,6 @@ if(src.patient && src.path.len == 0 && (get_dist(src,src.patient) > 1)) spawn(0) src.path = AStar(src.loc, get_turf(src.patient), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 30,id=botcard) - src.path = reverselist(src.path) if(src.path.len == 0) src.oldpatient = src.patient src.patient = null diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index c21e2554899..ece42334b7f 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -706,7 +706,6 @@ // given an optional turf to avoid /obj/machinery/bot/mulebot/proc/calc_path(var/turf/avoid = null) src.path = AStar(src.loc, src.target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 250, id=botcard, exclude=avoid) - src.path = reverselist(src.path) // sets the current destination diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 2f61a6cc9d1..b528e452130 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -553,7 +553,6 @@ Auto Patrol: []"}, // given an optional turf to avoid /obj/machinery/bot/secbot/proc/calc_path(var/turf/avoid = null) src.path = AStar(src.loc, patrol_target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id=botcard, exclude=avoid) - src.path = reverselist(src.path) // look for a criminal in view of the bot diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index feee5d2d86a..99cd5afc9fc 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -90,6 +90,8 @@ //This is needed due to BYOND limitations in controlling visibility heat_proof = 1 + flags = ON_BORDER + CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(istype(mover) && mover.checkpass(PASSGLASS)) return 1 diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm index bb991c0e1d7..c447dd4cbc1 100644 --- a/code/game/machinery/embedded_controller/embedded_controller_base.dm +++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm @@ -75,7 +75,7 @@ obj/machinery/embedded_controller if(radio_connection) return radio_connection.post_signal(src, signal) else - del(signal) + signal = null proc set_frequency(new_frequency) diff --git a/code/game/machinery/telecomms/logbrowser.dm b/code/game/machinery/telecomms/logbrowser.dm index 608f74b7eb0..488b02051fc 100644 --- a/code/game/machinery/telecomms/logbrowser.dm +++ b/code/game/machinery/telecomms/logbrowser.dm @@ -70,23 +70,28 @@ var/race // The actual race of the mob var/language = "Human" // MMIs, pAIs, Cyborgs and humans all speak Human var/mobtype = C.parameters["mobtype"] - var/mob/M = new mobtype - if(ishuman(M) || isbrain(M)) + var/list/humans = typesof(/mob/living/carbon/human, /mob/living/carbon/brain) + var/list/monkeys = typesof(/mob/living/carbon/monkey) + var/list/silicons = typesof(/mob/living/silicon) + var/list/slimes = typesof(/mob/living/carbon/slime) + var/list/animals = typesof(/mob/living/simple_animal) + + if(mobtype in humans) race = "Human" - else if(ismonkey(M)) + else if(mobtype in monkeys) race = "Monkey" language = race - else if(issilicon(M) || C.parameters["job"] == "AI") // sometimes M gets deleted prematurely for AIs... just check the job + else if(mobtype in silicons || C.parameters["job"] == "AI") // sometimes M gets deleted prematurely for AIs... just check the job race = "Artificial Life" - else if(isslime(M)) // NT knows a lot about slimes, but not aliens. Can identify slimes + else if(mobtype in slimes) // NT knows a lot about slimes, but not aliens. Can identify slimes race = "slime" language = race - else if(isanimal(M)) + else if(mobtype in animals) race = "Domestic Animal" language = race @@ -94,7 +99,6 @@ race = "Unidentifiable" language = race - del(M) // -- If the orator is a human, or universal translate is active, OR mob has universal speech on -- diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index f3d8372353f..0a6c8b8f71e 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -101,7 +101,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() copy.data["original"] = signal.data["original"] else - del(copy) + copy = null send_count++ diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 27a1505636e..36a59557b81 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -96,6 +96,7 @@ layer = 2.7 health = 3 var/amount_grown = 0 + var/grow_as = null var/obj/machinery/atmospherics/unary/vent_pump/entry_vent var/travelling_in_vent = 0 New() @@ -179,8 +180,9 @@ if(isturf(loc)) amount_grown += rand(0,2) if(amount_grown >= 100) - var/spawn_type = pick(typesof(/mob/living/simple_animal/hostile/giant_spider)) - new spawn_type(src.loc) + if(!grow_as) + grow_as = pick(typesof(/mob/living/simple_animal/hostile/giant_spider)) + new grow_as(src.loc) del(src) /obj/effect/spider/cocoon diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index d8a89eb59c0..03807db4f9b 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -159,6 +159,7 @@ var/intercom_range_display_status = 0 src.verbs += /client/proc/kill_air_processing src.verbs += /client/proc/disable_communication src.verbs += /client/proc/disable_movement + src.verbs += /client/proc/print_pointers //src.verbs += /client/proc/cmd_admin_rejuvenate feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm index c578c94cf33..d8d57e5c7bb 100644 --- a/code/modules/events/spider_infestation.dm +++ b/code/modules/events/spider_infestation.dm @@ -23,6 +23,8 @@ while((spawncount >= 1) && vents.len) var/obj/vent = pick(vents) - new /obj/effect/spider/spiderling(vent.loc) + var/obj/effect/spider/spiderling/S = new(vent.loc) + if(prob(66)) + S.grow_as = /mob/living/simple_animal/hostile/giant_spider/nurse vents -= vent spawncount-- \ No newline at end of file diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 6780d1cffe2..0bd9c9e967b 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -52,7 +52,7 @@ msg += "POWER: [alarm_types_show["Power"]] alarms detected. - " if(alarm_types_show["Camera"]) - msg += "CAMERA: [alarm_types_show["Power"]] alarms detected. - " + msg += "CAMERA: [alarm_types_show["Camera"]] alarms detected. - " msg += "\[Show Alerts\]" src << msg @@ -77,7 +77,7 @@ msg += "POWER: [alarm_types_clear["Power"]] alarms cleared. - " if(alarm_types_show["Camera"]) - msg += "CAMERA: [alarm_types_show["Power"]] alarms detected. - " + msg += "CAMERA: [alarm_types_clear["Camera"]] alarms cleared. - " msg += "\[Show Alerts\]" src << msg @@ -85,10 +85,10 @@ alarms_to_show = list() alarms_to_clear = list() - for(var/i = 1; i < alarm_types_show.len; i++) - alarm_types_show[i] = 0 - for(var/i = 1; i < alarm_types_clear.len; i++) - alarm_types_clear[i] = 0 + for(var/key in alarm_types_show) + alarm_types_show[key] = 0 + for(var/key in alarm_types_clear) + alarm_types_clear[key] = 0 /mob/living/silicon/drop_item() return diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 16e62ebc3a5..5892429c013 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -5,7 +5,7 @@ var/global/list/uneatable = list( /obj/effect/overlay ) -/obj/machinery/singularity/ +/obj/machinery/singularity name = "Gravitational Singularity" desc = "A Gravitational Singularity." icon = 'icons/obj/singularity.dmi' @@ -212,7 +212,7 @@ var/global/list/uneatable = list( for(var/atom/X in orange(grav_pull,src)) var/dist = get_dist(X, src) // Movable atoms only - if(dist > consume_range && istype(X, /atom/movable)) + if(!contained && dist > consume_range && istype(X, /atom/movable)) if(is_type_in_list(X, uneatable)) continue if(((X) &&(!X:anchored) && (!istype(X,/mob/living/carbon/human)))|| (src.current_size >= 9)) step_towards(X,src) diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 1d0a1302798..5df30d55a05 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -984,6 +984,25 @@ datum )//exclusion list for things you don't want the reaction to create. var/list/critters = typesof(/mob/living/simple_animal/hostile) - blocked // list of possible hostile mobs + var/message = "A gold slime reaction has occured" + + var/atom/A = holder.my_atom + if(A) + var/turf/T = get_turf(A) + var/area/my_area = get_area(T) + message += " in [my_area.name]. (JMP)" + message += " (VV)" + + var/mob/M = get(A, /mob) + if(M) + message += " - Carried By: [M.real_name] ([M.key]) (PP) (?)" + else + message += " - Last Fingerprint: [(A.fingerprintslast ? A.fingerprintslast : "N/A")]" + else + message += "." + + message_admins(message, 0, 1) + playsound(get_turf_loc(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) for(var/mob/living/carbon/human/M in viewers(get_turf_loc(holder.my_atom), null))