diff --git a/code/_helpers/lists.dm b/code/_helpers/lists.dm index 1ebb3e4f14..fb4cd3874e 100644 --- a/code/_helpers/lists.dm +++ b/code/_helpers/lists.dm @@ -210,23 +210,14 @@ proc/listclearnulls(list/list) return (result + R.Copy(Ri, 0)) //Mergesort: divides up the list into halves to begin the sort -/proc/sortAtom(var/list/atom/L, var/order = 1, first = 1) +/proc/sortAtom(var/list/atom/L, var/order = 1) if(isnull(L) || L.len < 2) - if(!L) - testing("sortAtom() called with null as first parameter!") return L - if(first) - var/msg = "sortAtom() called with list([L.len]): " - for(var/x in L) - msg += "'[x]'; " - testing(msg) var/middle = L.len / 2 + 1 - return mergeAtoms(sortAtom(L.Copy(0,middle), order, 0), sortAtom(L.Copy(middle), order, 0), order) + return mergeAtoms(sortAtom(L.Copy(0,middle)), sortAtom(L.Copy(middle)), order) //Mergsort: does the actual sorting and returns the results back to sortAtom /proc/mergeAtoms(var/list/atom/L, var/list/atom/R, var/order = 1) - if(!L || !R) - testing("mergeAtoms([L] ([L ? L.len : "*null*"]), [R] ([R ? R.len : "*null*"]))") var/Li=1 var/Ri=1 var/list/result = new() @@ -239,14 +230,8 @@ proc/listclearnulls(list/list) result += R[Ri++] if(Li <= L.len) - . = (result + L.Copy(Li, 0)) - if(!.) - testing("mergeAtoms returning [.]") - return - . = (result + R.Copy(Ri, 0)) - if(!.) - testing("mergeAtoms returning [.]") - return + return (result + L.Copy(Li, 0)) + return (result + R.Copy(Ri, 0)) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 1bb29eb4c8..a859f81932 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -21,9 +21,14 @@ if(auto_init && ticker && ticker.current_state == GAME_STATE_PLAYING) initialize() +/proc/generate_debug_runtime() // Guaranteed to runtime and print a stack trace to the runtime log + var/t = 0 // BYOND won't let us do var/t = 1/0 directly, but it's fine with this. + t = 1 / t + /atom/movable/Del() if(isnull(gcDestroyed) && loc) testing("GC: -- [type] was deleted via del() rather than qdel() --") + generate_debug_runtime() // stick a stack trace in the runtime logs // else if(isnull(gcDestroyed)) // testing("GC: [type] was deleted via GC without qdel()") //Not really a huge issue but from now on, please qdel() // else diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index 99c1847961..d1ac6df4c5 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -47,11 +47,13 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() signal.data["slow"] += rand(0, round((100-integrity))) // apply some lag based on integrity + /* + // Edit by Atlantis: Commented out as emergency fix due to causing extreme delays in communications. // Apply some lag based on traffic rates var/netlag = round(traffic / 50) if(netlag > signal.data["slow"]) signal.data["slow"] = netlag - + */ // Loop through all linked machines and send the signal or copy. for(var/obj/machinery/telecomms/machine in links) if(filter && !istype( machine, text2path(filter) )) diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 0e6db03bd6..886fa4eac7 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -68,10 +68,7 @@ if (istype(E, /datum/stack_recipe_list)) var/datum/stack_recipe_list/srl = E - if (src.get_amount() >= srl.req_amount) - t1 += "[srl.title] ([srl.req_amount] [src.singular_name]\s)" - else - t1 += "[srl.title] ([srl.req_amount] [src.singular_name]\s)
" + t1 += "[srl.title]" if (istype(E, /datum/stack_recipe)) var/datum/stack_recipe/R = E @@ -360,8 +357,6 @@ /datum/stack_recipe_list var/title = "ERROR" var/list/recipes = null - var/req_amount = 1 - New(title, recipes, req_amount = 1) + New(title, recipes) src.title = title src.recipes = recipes - src.req_amount = req_amount diff --git a/code/modules/materials/material_recipes.dm b/code/modules/materials/material_recipes.dm index 67e60fc4c4..a5a0608f06 100644 --- a/code/modules/materials/material_recipes.dm +++ b/code/modules/materials/material_recipes.dm @@ -28,7 +28,7 @@ recipes += new/datum/stack_recipe_list("office chairs",list( \ new/datum/stack_recipe("dark office chair", /obj/structure/bed/chair/office/dark, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("light office chair", /obj/structure/bed/chair/office/light, 5, one_per_turf = 1, on_floor = 1) \ - ), 5) + )) recipes += new/datum/stack_recipe_list("comfy chairs", list( \ new/datum/stack_recipe("beige comfy chair", /obj/structure/bed/chair/comfy/beige, 2, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("black comfy chair", /obj/structure/bed/chair/comfy/black, 2, one_per_turf = 1, on_floor = 1), \ @@ -39,7 +39,7 @@ new/datum/stack_recipe("blue comfy chair", /obj/structure/bed/chair/comfy/blue, 2, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("purple comfy chair", /obj/structure/bed/chair/comfy/purp, 2, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("green comfy chair", /obj/structure/bed/chair/comfy/green, 2, one_per_turf = 1, on_floor = 1), \ - ), 2) + )) recipes += new/datum/stack_recipe("table frame", /obj/structure/table, 1, time = 10, one_per_turf = 1, on_floor = 1) recipes += new/datum/stack_recipe("rack", /obj/structure/table/rack, 1, time = 5, one_per_turf = 1, on_floor = 1) @@ -69,7 +69,7 @@ new/datum/stack_recipe("high security airlock assembly", /obj/structure/door_assembly/door_assembly_highsecurity, 4, time = 50, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("emergency shutter", /obj/structure/firedoor_assembly, 4, time = 50, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("multi-tile airlock assembly", /obj/structure/door_assembly/multi_tile, 4, time = 50, one_per_turf = 1, on_floor = 1), \ - ), 4) + )) recipes += new/datum/stack_recipe("grenade casing", /obj/item/weapon/grenade/chem_grenade) recipes += new/datum/stack_recipe("light fixture frame", /obj/item/frame/light, 2) @@ -86,7 +86,7 @@ /material/sandstone/generate_recipes() ..() - recipes += new/datum/stack_recipe("pile of dirt", /obj/machinery/portable_atmospherics/hydroponics/soil, 3, time = 10, one_per_turf = 1, on_floor = 1) + recipes += new/datum/stack_recipe("planting bed", /obj/machinery/portable_atmospherics/hydroponics/soil, 3, time = 10, one_per_turf = 1, on_floor = 1) /material/plastic/generate_recipes() ..() @@ -122,4 +122,4 @@ new/datum/stack_recipe("red folder", /obj/item/weapon/folder/red), \ new/datum/stack_recipe("white folder", /obj/item/weapon/folder/white), \ new/datum/stack_recipe("yellow folder", /obj/item/weapon/folder/yellow), \ - ), 3) \ No newline at end of file + )) diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index 1645a2b575..153b4313c4 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -359,7 +359,7 @@ var/list/name_to_material weight = 15 door_icon_base = "stone" destruction_desc = "shatters" - window_options = list("One Direction", "Full Window") + window_options = list("One Direction" = 1, "Full Window" = 4) created_window = /obj/structure/window/basic wire_product = /obj/item/stack/light_w rod_product = /obj/item/stack/material/glass/reinforced @@ -417,9 +417,8 @@ var/list/name_to_material return 1 var/build_path = /obj/structure/windoor_assembly - var/sheets_needed = 4 + var/sheets_needed = window_options[choice] if(choice == "Windoor") - sheets_needed = 5 build_dir = user.dir else build_path = created_window @@ -450,7 +449,7 @@ var/list/name_to_material weight = 30 stack_origin_tech = "materials=2" composite_material = list(DEFAULT_WALL_MATERIAL = 1875,"glass" = 3750) - window_options = list("One Direction", "Full Window", "Windoor") + window_options = list("One Direction" = 1, "Full Window" = 4, "Windoor" = 5) created_window = /obj/structure/window/reinforced wire_product = null rod_product = null diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 4f3f52a364..dc34cfec3c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1023,23 +1023,29 @@ return(visible_implants) +/mob/living/carbon/human/embedded_needs_process() + for(var/obj/item/organ/external/organ in src.organs) + for(var/obj/item/O in organ.implants) + if(!istype(O, /obj/item/weapon/implant)) //implant type items do not cause embedding effects, see handle_embedded_objects() + return 1 + return 0 + /mob/living/carbon/human/proc/handle_embedded_objects() for(var/obj/item/organ/external/organ in src.organs) if(organ.status & ORGAN_SPLINTED) //Splints prevent movement. continue - for(var/obj/item/weapon/O in organ.implants) + for(var/obj/item/O in organ.implants) if(!istype(O,/obj/item/weapon/implant) && prob(5)) //Moving with things stuck in you could be bad. // All kinds of embedded objects cause bleeding. - var/msg = null - switch(rand(1,3)) - if(1) - msg ="A spike of pain jolts your [organ.name] as you bump [O] inside." - if(2) - msg ="Your movement jostles [O] in your [organ.name] painfully." - if(3) - msg ="[O] in your [organ.name] twists painfully as you move." - src << msg + if(species.flags & NO_PAIN) + src << "You feel [O] moving inside your [organ.name]." + else + var/msg = pick( \ + "A spike of pain jolts your [organ.name] as you bump [O] inside.", \ + "Your movement jostles [O] in your [organ.name] painfully.", \ + "Your movement jostles [O] in your [organ.name] painfully.") + src << msg organ.take_damage(rand(1,3), 0, 0) if(!(organ.status & ORGAN_ROBOT) && !(species.flags & NO_BLOOD)) //There is no blood in protheses. diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 2dec075afa..d69f6e57cc 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -134,28 +134,29 @@ continue if(E.is_broken() || E.is_dislocated()) - if(E.body_part == HAND_LEFT) - if(!l_hand) - continue - drop_from_inventory(l_hand) - else - if(!r_hand) - continue - drop_from_inventory(r_hand) + switch(E.body_part) + if(HAND_LEFT, ARM_LEFT) + if(!l_hand) + continue + drop_from_inventory(l_hand) + if(HAND_RIGHT, ARM_RIGHT) + if(!r_hand) + continue + drop_from_inventory(r_hand) var/emote_scream = pick("screams in pain and ", "lets out a sharp cry and ", "cries out and ") emote("me", 1, "[(species.flags & NO_PAIN) ? "" : emote_scream ]drops what they were holding in their [E.name]!") else if(E.is_malfunctioning()) - - if(E.body_part == HAND_LEFT) - if(!l_hand) - continue - drop_from_inventory(l_hand) - else - if(!r_hand) - continue - drop_from_inventory(r_hand) + switch(E.body_part) + if(HAND_LEFT, ARM_LEFT) + if(!l_hand) + continue + drop_from_inventory(l_hand) + if(HAND_RIGHT, ARM_RIGHT) + if(!r_hand) + continue + drop_from_inventory(r_hand) emote("me", 1, "drops what they were holding, their [E.name] malfunctioning!") @@ -176,4 +177,4 @@ /mob/living/carbon/human/proc/sync_organ_dna() var/list/all_bits = internal_organs|organs for(var/obj/item/organ/O in all_bits) - O.set_dna(dna) \ No newline at end of file + O.set_dna(dna) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index cdd556034d..282831641c 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1015,6 +1015,10 @@ // Check everything else. + //Periodically double-check embedded_flag + if(embedded_flag && !(life_tick % 10)) + if(!embedded_needs_process()) + embedded_flag = 0 //Vision var/obj/item/organ/vision if(species.vision_organ) diff --git a/code/modules/mob/living/silicon/robot/drone/drone_items.dm b/code/modules/mob/living/silicon/robot/drone/drone_items.dm index 84611ecb95..0ec65be420 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_items.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_items.dm @@ -14,6 +14,7 @@ /obj/item/weapon/firealarm_electronics, /obj/item/weapon/airalarm_electronics, /obj/item/weapon/airlock_electronics, + /obj/item/weapon/tracker_electronics, /obj/item/weapon/module/power_control, /obj/item/weapon/stock_parts, /obj/item/frame, diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index 3197c6023c..daf7b3768e 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -59,8 +59,13 @@ var/mob/dead/observer/spook = locate() in range(src,5) if(spook) var/turf/T = spook.loc - var/obj/O = pick(T.contents) - visible_emote("suddenly stops and stares at something unseen[istype(O) ? " near [O]":""].") + var/list/visible = list() + for(var/obj/O in T.contents) + if(!O.invisibility && O.name) + visible += O + if(visible.len) + var/atom/A = pick(visible) + visible_emote("suddenly stops and stares at something unseen[istype(A) ? " near [A]":""].") /mob/living/simple_animal/cat/proc/handle_movement_target() //if our target is neither inside a turf or inside a human(???), stop diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 10a8daa868..9f24c4e1a1 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -872,6 +872,9 @@ visible_implants += O return visible_implants +/mob/proc/embedded_needs_process() + return (embedded.len > 0) + mob/proc/yank_out_object() set category = "Object" set name = "Yank out object" diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index ad4021adf3..1b6108c238 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -53,7 +53,7 @@ var/joint = "joint" // Descriptive string used in dislocation. var/amputation_point // Descriptive string used in amputation. var/dislocated = 0 // If you target a joint, you can dislocate the limb, causing temporary damage to the organ. - var/can_grasp + var/can_grasp //It would be more appropriate if these two were named "affects_grasp" and "affects_stand" at this point var/can_stand /obj/item/organ/external/Destroy() diff --git a/html/changelog.html b/html/changelog.html index 85762f5503..8b14246c1e 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -56,6 +56,16 @@ -->
+

13 August 2015

+

GinjaNinja32 updated:

+ +

Orelbon updated:

+ +

11 August 2015

PsiOmegaDelta updated: