mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-31 00:49:06 +01:00
Bugfix pile (#22823)
Fixes several runtimes from the past few weeks, some additional material repath regressions, and the fact that if I shoot you with a stream of ionized deuterium particles, it doesn't riddle you with cancer. changes: - bugfix: "Fixes emergency shields runtiming when hit by thrown objects." - bugfix: "Fixes several stale global list runtimes." - bugfix: "Fixes several health percentage checks that could use unset initial health values." - bugfix: "Fixes additional materials regressions in INDRA code." - bugfix: "Fixes invalid fuel injector depletion math." - bugfix: "Makes accelerated particles apply radiation damage to living mobs they pass through."
This commit is contained in:
@@ -251,7 +251,7 @@ Class Procs:
|
||||
if(prob(50))
|
||||
metal_to_spawn++
|
||||
else
|
||||
new /obj/item/material/shard(current_turf, DEFAULT_WALL_MATERIAL)
|
||||
new /obj/item/material/shard(current_turf, MATERIAL_STEEL)
|
||||
if(metal_to_spawn)
|
||||
new /obj/item/stack/material/steel(get_turf(src), metal_to_spawn)
|
||||
if(!should_use_health)
|
||||
|
||||
@@ -359,7 +359,7 @@ GLOBAL_LIST_EMPTY(total_active_bonfires)
|
||||
fuel = 0 //don't start with fuel
|
||||
if(!material_name)
|
||||
material_name = MATERIAL_MARBLE
|
||||
material = GET_SINGLETON(material_name)
|
||||
material = SSmaterials.get_material_by_id(material_name)
|
||||
if(!material)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -880,7 +880,7 @@
|
||||
icon = 'icons/obj/item/scanner.dmi'
|
||||
icon_state = "crate_scanner"
|
||||
item_state = "crate_scanner"
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 250, MATERIAL_GLASS = 140)
|
||||
matter = list(MATERIAL_STEEL = 250, MATERIAL_GLASS = 140)
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
obj_flags = OBJ_FLAG_CONDUCTABLE
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
/obj/structure/curtain/Initialize()
|
||||
. = ..()
|
||||
material = GET_SINGLETON(curtain_material)
|
||||
material = SSmaterials.get_material_by_id(curtain_material)
|
||||
AddComponent(/datum/component/turf_hand)
|
||||
|
||||
/obj/structure/curtain/open
|
||||
|
||||
@@ -261,13 +261,13 @@
|
||||
if(glass)
|
||||
to_chat(user, SPAN_WARNING("\The [src] already has glass installed."))
|
||||
return
|
||||
var/obj/item/stack/S = attacking_item
|
||||
var/material_name = S.get_material_name()
|
||||
var/obj/item/stack/material/S = attacking_item
|
||||
var/singleton/material/glass_material = S.get_material()
|
||||
if(S.get_amount() >= 2)
|
||||
if(material_name != MATERIAL_GLASS_REINFORCED)
|
||||
if(glass_material?.type != MATERIAL_GLASS_REINFORCED)
|
||||
to_chat(user, SPAN_WARNING("You can only use reinforced glass to install a window into an airlock assembly."))
|
||||
return
|
||||
if(material_name == MATERIAL_GLASS_REINFORCED)
|
||||
if(glass_material.type == MATERIAL_GLASS_REINFORCED)
|
||||
user.visible_message("<b>[user]</b> starts installing \the [S] into the airlock assembly.", SPAN_WARNING("You start installing \the [S] into the airlock assembly."))
|
||||
if(attacking_item.use_tool(src, user, 40, volume = 50) && !glass)
|
||||
if(S.use(2))
|
||||
|
||||
@@ -118,27 +118,26 @@
|
||||
to_chat(user, SPAN_NOTICE("\The [src] needs to be anchored."))
|
||||
return
|
||||
|
||||
var/material_name = attacking_item.get_material_name()
|
||||
if(material_name in list(MATERIAL_GLASS_REINFORCED, MATERIAL_GLASS_REINFORCED_PHORON))
|
||||
var/obj/item/stack/material/glass_stack = attacking_item
|
||||
var/singleton/material/glass_material = glass_stack.get_material()
|
||||
if(glass_material?.type in list(MATERIAL_GLASS_REINFORCED, MATERIAL_GLASS_REINFORCED_PHORON))
|
||||
if(has_glass_installed)
|
||||
to_chat(user, SPAN_NOTICE("\The [src] already has glass installed."))
|
||||
return
|
||||
|
||||
var/obj/item/stack/material/glass_stack = attacking_item
|
||||
|
||||
if(!do_after(user, 2 SECONDS))
|
||||
return
|
||||
|
||||
if(!glass_stack.use(glass_needed))
|
||||
var/message = "You need at least [glass_needed] sheets of " \
|
||||
+ "[material_name] to install a window in \the [src]."
|
||||
+ "[glass_material.use_name] to install a window in \the [src]."
|
||||
to_chat(user, SPAN_NOTICE(message))
|
||||
return
|
||||
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
to_chat(user, SPAN_NOTICE("You place the [material_name] in the window frame."))
|
||||
to_chat(user, SPAN_NOTICE("You place the [glass_material.use_name] in the window frame."))
|
||||
|
||||
switch(material_name)
|
||||
switch(glass_material.type)
|
||||
if(MATERIAL_GLASS_REINFORCED)
|
||||
new /obj/structure/window/full/reinforced(get_turf(src), constructed = TRUE)
|
||||
if(MATERIAL_GLASS_REINFORCED_PHORON)
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
/obj/structure/girder/assembly_hints(mob/user, distance, is_adjacent)
|
||||
. += ..()
|
||||
if (health < initial(health))
|
||||
if (health < maxhealth)
|
||||
. += "It could be repaired with a few choice <b>welds</b>."
|
||||
|
||||
if (anchored)
|
||||
@@ -232,7 +232,7 @@
|
||||
to_chat(user, SPAN_NOTICE("There isn't enough material here to construct a wall."))
|
||||
return 0
|
||||
|
||||
var/singleton/material/material = GET_SINGLETON(mat_stack.default_type)
|
||||
var/singleton/material/material = mat_stack.get_material()
|
||||
if(!istype(material))
|
||||
return 0
|
||||
|
||||
@@ -282,7 +282,7 @@
|
||||
to_chat(user, SPAN_NOTICE("There isn't enough material here to reinforce the girder."))
|
||||
return 0
|
||||
|
||||
var/singleton/material/material = GET_SINGLETON(mat_stack.default_type)
|
||||
var/singleton/material/material = mat_stack.get_material()
|
||||
if(!istype(material) || material.integrity < 50)
|
||||
to_chat(user, "You cannot reinforce \the [src] with that; it is too soft.")
|
||||
return 0
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
var/destroyed = 0
|
||||
|
||||
/obj/structure/grille/get_damage_condition_hints(mob/user, distance, is_adjacent)
|
||||
if(health < initial(health))
|
||||
if(health < maxhealth)
|
||||
var/state
|
||||
var/current_damage = health / initial(health)
|
||||
var/current_damage = health / maxhealth
|
||||
switch(current_damage)
|
||||
if(0 to 0.3)
|
||||
state = SPAN_DANGER("The grille is barely in one piece!")
|
||||
|
||||
@@ -1073,7 +1073,7 @@ Just a object used in constructing air alarms
|
||||
icon_state = "door_electronics"
|
||||
desc = "Looks like a circuit. Probably is."
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50)
|
||||
matter = list(MATERIAL_STEEL = 50, MATERIAL_GLASS = 50)
|
||||
|
||||
#undef AALARM_MODE_SCRUBBING
|
||||
#undef AALARM_MODE_REPLACEMENT
|
||||
|
||||
@@ -74,8 +74,10 @@
|
||||
qdel(attacking_item)
|
||||
return TRUE
|
||||
// Steel for matter.
|
||||
if(prints_prosthetics && istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
|
||||
var/obj/item/stack/S = attacking_item
|
||||
var/obj/item/stack/material/metal_stack = attacking_item
|
||||
var/singleton/material/metal_material = metal_stack?.get_material()
|
||||
if(prints_prosthetics && istype(metal_stack) && metal_material?.type == MATERIAL_STEEL)
|
||||
var/obj/item/stack/S = metal_stack
|
||||
stored_matter += S.amount * 10
|
||||
user.drop_from_inventory(attacking_item, src)
|
||||
to_chat(user, "<span class='info'>\The [src] processes \the [attacking_item]. Levels of stored matter now: [stored_matter]</span>")
|
||||
|
||||
@@ -94,19 +94,21 @@
|
||||
A.amount = 5
|
||||
return TRUE
|
||||
|
||||
if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == MATERIAL_GLASS_REINFORCED)
|
||||
var/obj/item/stack/RG = attacking_item
|
||||
if (RG.get_amount() < 2)
|
||||
to_chat(user, SPAN_WARNING("You need two sheets of glass to put in the glass panel."))
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You start to put in the glass panel."))
|
||||
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if (do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) && state == 3)
|
||||
if(RG.use(2))
|
||||
to_chat(user, SPAN_NOTICE("You put in the glass panel."))
|
||||
state = 4
|
||||
icon_state = "4"
|
||||
return TRUE
|
||||
var/obj/item/stack/material/RG = attacking_item
|
||||
if(istype(RG))
|
||||
var/singleton/material/RG_material = RG.get_material()
|
||||
if(RG_material.type == MATERIAL_GLASS_REINFORCED)
|
||||
if (RG.get_amount() < 2)
|
||||
to_chat(user, SPAN_WARNING("You need two sheets of glass to put in the glass panel."))
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You start to put in the glass panel."))
|
||||
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
if (do_after(user, 2 SECONDS, src, DO_REPAIR_CONSTRUCT) && state == 3)
|
||||
if(RG.use(2))
|
||||
to_chat(user, SPAN_NOTICE("You put in the glass panel."))
|
||||
state = 4
|
||||
icon_state = "4"
|
||||
return TRUE
|
||||
|
||||
if(istype(attacking_item, /obj/item/aiModule/asimov))
|
||||
laws.add_inherent_law("You may not injure a human being or, through inaction, allow a human being to come to harm.")
|
||||
|
||||
@@ -94,8 +94,10 @@
|
||||
A.amount = 5
|
||||
return TRUE
|
||||
|
||||
if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == "glass")
|
||||
var/obj/item/stack/G = attacking_item
|
||||
var/obj/item/stack/material/glass_stack = attacking_item
|
||||
var/singleton/material/glass_material = glass_stack?.get_material()
|
||||
if(istype(glass_stack) && glass_material?.type == MATERIAL_GLASS)
|
||||
var/obj/item/stack/G = glass_stack
|
||||
if (G.get_amount() < 2)
|
||||
to_chat(user, SPAN_WARNING("You need two sheets of glass to put in the glass panel."))
|
||||
return TRUE
|
||||
|
||||
@@ -175,8 +175,15 @@
|
||||
if (!check_area)
|
||||
return
|
||||
|
||||
var/list/invalid_cameras
|
||||
for(var/cc in SSmachinery.all_cameras)
|
||||
if(!istype(cc, /obj/structure/machinery/camera))
|
||||
LAZYADD(invalid_cameras, cc)
|
||||
continue
|
||||
var/obj/structure/machinery/camera/camera = cc
|
||||
if(QDELETED(camera))
|
||||
LAZYADD(invalid_cameras, cc)
|
||||
continue
|
||||
if(!camera.loc)
|
||||
continue
|
||||
if (camera.loc.loc != check_area)
|
||||
@@ -189,6 +196,8 @@
|
||||
if(dist < best_dist)
|
||||
best_dist = dist
|
||||
jump_to = camera
|
||||
if(invalid_cameras)
|
||||
SSmachinery.all_cameras -= invalid_cameras
|
||||
if(isnull(jump_to))
|
||||
return
|
||||
if(can_access_camera(jump_to))
|
||||
|
||||
@@ -31,7 +31,7 @@ Deployable Kits
|
||||
/obj/structure/blocker/proc/set_material(var/material_name)
|
||||
if(force_material)
|
||||
material_name = force_material
|
||||
material = GET_SINGLETON(material_name)
|
||||
material = SSmaterials.get_material_by_id(material_name)
|
||||
if(!material)
|
||||
qdel(src)
|
||||
return
|
||||
@@ -61,7 +61,7 @@ Deployable Kits
|
||||
var/obj/item/I = usr.get_inactive_hand()
|
||||
if(I && istype(I, /obj/item/stack))
|
||||
var/obj/item/stack/D = I
|
||||
if(D.get_material_name() != material.name)
|
||||
if(D.get_material() != material)
|
||||
to_chat(user, SPAN_WARNING("You need one sheet of [material.display_name] to repair \the [src]."))
|
||||
return ..()
|
||||
if(health < maxhealth)
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
|
||||
if (glass)
|
||||
paintable |= AIRLOCK_PAINTABLE_WINDOW
|
||||
window_material = GET_SINGLETON(init_material_window)
|
||||
window_material = SSmaterials.get_material_by_id(init_material_window)
|
||||
opacity = FALSE
|
||||
update_icon()
|
||||
|
||||
@@ -283,8 +283,8 @@
|
||||
|
||||
/obj/structure/machinery/door/airlock/get_material()
|
||||
if(material)
|
||||
return GET_SINGLETON(material)
|
||||
return GET_SINGLETON(MATERIAL_STEEL)
|
||||
return SSmaterials.get_material_by_id(material)
|
||||
return SSmaterials.get_material_by_id(MATERIAL_STEEL)
|
||||
|
||||
/obj/structure/machinery/door/airlock/external//External airlocks start here
|
||||
name = "external airlock"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "door_electronics"
|
||||
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50)
|
||||
matter = list(MATERIAL_STEEL = 50, MATERIAL_GLASS = 50)
|
||||
|
||||
req_access = list(ACCESS_ENGINE)
|
||||
/// If set, then wires will be randomized and bolts will drop if the door is broken
|
||||
|
||||
@@ -150,12 +150,14 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == "plasteel")
|
||||
var/obj/item/stack/material/plasteel_stack = attacking_item
|
||||
var/singleton/material/plasteel_material = plasteel_stack?.get_material()
|
||||
if(istype(plasteel_stack) && plasteel_material?.type == MATERIAL_PLASTEEL)
|
||||
var/amt = Ceiling((maxhealth - health)/150)
|
||||
if(!amt)
|
||||
to_chat(usr, SPAN_NOTICE("\The [src] is already fully repaired."))
|
||||
return TRUE
|
||||
var/obj/item/stack/P = attacking_item
|
||||
var/obj/item/stack/P = plasteel_stack
|
||||
if(P.amount < amt)
|
||||
to_chat(usr, SPAN_WARNING("You don't have enough sheets to repair this! You need at least [amt] sheets."))
|
||||
return TRUE
|
||||
|
||||
@@ -316,7 +316,7 @@
|
||||
|
||||
if(attacking_item.tool_behaviour == TOOL_HAMMER && user.a_intent != I_HURT)
|
||||
var/obj/item/stack/stack = usr.get_inactive_hand()
|
||||
if(istype(stack) && stack.get_material_name() == get_material_name())
|
||||
if(istype(stack) && stack.get_material() == get_material())
|
||||
if(stat & BROKEN)
|
||||
to_chat(user, SPAN_NOTICE("It looks like \the [src] is pretty busted. It's going to need more than just patching up now."))
|
||||
return TRUE
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
..()
|
||||
|
||||
/obj/structure/machinery/door/firedoor/get_material()
|
||||
return GET_SINGLETON(DEFAULT_WALL_MATERIAL)
|
||||
return SSmaterials.get_material_by_id(MATERIAL_STEEL)
|
||||
|
||||
/obj/structure/machinery/door/firedoor/CollidedWith(atom/bumped_atom)
|
||||
if(p_open || operating)
|
||||
|
||||
@@ -305,4 +305,4 @@ Just a object used in constructing fire alarms
|
||||
icon_state = "door_electronics"
|
||||
desc = "A circuit. It has a label on it, it says \"Can handle heat levels up to 40 degrees celsius!\""
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 50, MATERIAL_GLASS = 50)
|
||||
matter = list(MATERIAL_STEEL = 50, MATERIAL_GLASS = 50)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 20
|
||||
power_channel = AREA_USAGE_LIGHT
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 2500, MATERIAL_GLASS = 2750)
|
||||
matter = list(MATERIAL_STEEL = 2500, MATERIAL_GLASS = 2750)
|
||||
recyclable = TRUE
|
||||
|
||||
var/on
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
/obj/structure/machinery/mecha_part_fabricator/dismantle()
|
||||
SSmaterials.normalize_material_amounts(materials)
|
||||
for(var/f in materials)
|
||||
for(var/f in materials.Copy())
|
||||
eject_materials(f, materials[f])
|
||||
|
||||
//Stop the queue building if you're dismantling
|
||||
|
||||
@@ -899,8 +899,10 @@
|
||||
return TRUE
|
||||
|
||||
if(1)
|
||||
if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
|
||||
var/obj/item/stack/M = attacking_item
|
||||
var/obj/item/stack/material/interior_metal_stack = attacking_item
|
||||
var/singleton/material/interior_metal_material = interior_metal_stack?.get_material()
|
||||
if(istype(interior_metal_stack) && interior_metal_material?.type == MATERIAL_STEEL)
|
||||
var/obj/item/stack/M = interior_metal_stack
|
||||
if(M.use(2))
|
||||
to_chat(user, SPAN_NOTICE("You add some metal armor to the interior frame."))
|
||||
build_step = 2
|
||||
@@ -994,8 +996,10 @@
|
||||
//attack_hand() removes the prox sensor
|
||||
|
||||
if(6)
|
||||
if(istype(attacking_item, /obj/item/stack/material) && attacking_item.get_material_name() == DEFAULT_WALL_MATERIAL)
|
||||
var/obj/item/stack/M = attacking_item
|
||||
var/obj/item/stack/material/exterior_metal_stack = attacking_item
|
||||
var/singleton/material/exterior_metal_material = exterior_metal_stack?.get_material()
|
||||
if(istype(exterior_metal_stack) && exterior_metal_material?.type == MATERIAL_STEEL)
|
||||
var/obj/item/stack/M = exterior_metal_stack
|
||||
if(M.use(2))
|
||||
to_chat(user, SPAN_NOTICE("You add some metal armor to the exterior frame."))
|
||||
ClearOverlays()
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
if(!non_material_object)
|
||||
if(!isnull(material) && !istype(material))
|
||||
material = GET_SINGLETON(material)
|
||||
material = SSmaterials.get_material_by_id(material)
|
||||
if(!istype(material))
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
..()
|
||||
if(!newmaterial)
|
||||
newmaterial = MATERIAL_STEEL
|
||||
material = GET_SINGLETON(newmaterial)
|
||||
material = SSmaterials.get_material_by_id(newmaterial)
|
||||
if(!material)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
@@ -80,12 +80,12 @@
|
||||
|
||||
/obj/structure/bed/New(newloc, new_material = MATERIAL_STEEL, new_padding_material, new_painted_colour)
|
||||
..(newloc)
|
||||
material = GET_SINGLETON(new_material)
|
||||
material = SSmaterials.get_material_by_id(new_material)
|
||||
if(!istype(material))
|
||||
qdel(src)
|
||||
return
|
||||
if(new_padding_material)
|
||||
padding_material = GET_SINGLETON(new_padding_material)
|
||||
padding_material = SSmaterials.get_material_by_id(new_padding_material)
|
||||
if(new_painted_colour)
|
||||
painted_colour = new_painted_colour
|
||||
update_icon()
|
||||
@@ -254,7 +254,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bed/proc/add_padding(var/padding_type)
|
||||
padding_material = GET_SINGLETON(padding_type)
|
||||
padding_material = SSmaterials.get_material_by_id(padding_type)
|
||||
generate_strings(TRUE)
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
/obj/item/material/stool/New(var/newloc, var/new_material, var/new_padding_material, var/new_painted_colour)
|
||||
..(newloc, new_material) // new_material handled in material_weapons.dm
|
||||
if(new_padding_material)
|
||||
padding_material = GET_SINGLETON(new_padding_material)
|
||||
padding_material = SSmaterials.get_material_by_id(new_padding_material)
|
||||
if(new_painted_colour)
|
||||
painted_colour = new_painted_colour
|
||||
update_icon()
|
||||
|
||||
Reference in New Issue
Block a user