Merge pull request #7612 from deathride58/imalwaysaslutformorememory

Mirrors tgstation/tgstation#40662 (100mb memory freed up roundstart, hell ya)
This commit is contained in:
LetterJay
2018-10-03 22:33:16 -05:00
committed by GitHub
25 changed files with 60 additions and 97 deletions
+2 -1
View File
@@ -69,6 +69,7 @@
#define COMSIG_ATOM_RAD_CONTAMINATING "atom_rad_contam" //from base of datum/radiation_wave/radiate(): (strength)
#define COMPONENT_BLOCK_CONTAMINATION 1
#define COMSIG_ATOM_RAD_WAVE_PASSING "atom_rad_wave_pass" //from base of datum/radiation_wave/check_obstructions(): (datum/radiation_wave, width)
#define COMPONENT_RAD_WAVE_HANDLED 1
#define COMSIG_ATOM_CANREACH "atom_can_reach" //from internal loop in atom/movable/proc/CanReach(): (list/next)
#define COMPONENT_BLOCK_REACH 1
#define COMSIG_ATOM_SCREWDRIVER_ACT "atom_screwdriver_act" //from base of atom/screwdriver_act(): (mob/living/user, obj/item/I)
@@ -257,4 +258,4 @@
//Ouch my toes!
#define CALTROP_BYPASS_SHOES 1
#define CALTROP_IGNORE_WALKERS 2
#define CALTROP_IGNORE_WALKERS 2
+4
View File
@@ -80,3 +80,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define EMP_PROTECT_SELF (1<<0)
#define EMP_PROTECT_CONTENTS (1<<1)
#define EMP_PROTECT_WIRES (1<<2)
// radiation
#define RAD_PROTECT_CONTENTS (1<<0)
#define RAD_NO_CONTAMINATE (1<<1)
+2 -2
View File
@@ -18,7 +18,7 @@
if(ignored_things[thing.type])
continue
. += thing
if(SEND_SIGNAL(thing, COMSIG_ATOM_RAD_PROBE) & COMPONENT_BLOCK_RADIATION)
if((thing.rad_flags & RAD_PROTECT_CONTENTS) || (SEND_SIGNAL(thing, COMSIG_ATOM_RAD_PROBE) & COMPONENT_BLOCK_RADIATION))
continue
processing_list += thing.contents
@@ -42,4 +42,4 @@
if(log)
var/turf/_source_T = isturf(source) ? source : get_turf(source)
log_game("Radiation pulse with intensity: [intensity] and range modifier: [range_modifier] in [loc_name(_source_T)] ")
return TRUE
return TRUE
+4
View File
@@ -169,4 +169,8 @@ GLOBAL_LIST_INIT(bitfields, list(
"car_traits" = list(
"CAN_KIDNAP" = CAN_KIDNAP,
),
"rad_flags" = list(
"RAD_PROTECT_CONTENTS" = RAD_PROTECT_CONTENTS,
"RAD_NO_CONTAMINATE" = RAD_NO_CONTAMINATE,
),
))
+1 -1
View File
@@ -4,7 +4,7 @@
/datum/component/mirage_border/Initialize(turf/target, direction, range=world.view)
if(!isturf(parent))
return COMPONENT_INCOMPATIBLE
if(!target || !istype(target) || !direction)
if(!target || !direction)
. = COMPONENT_INCOMPATIBLE
CRASH("[type] improperly instanced with the following args: target=\[[target]\], direction=\[[direction]\], range=\[[range]\]")
+2 -1
View File
@@ -21,4 +21,5 @@
return COMPONENT_BLOCK_CONTAMINATION
/datum/component/rad_insulation/proc/rad_pass(datum/source, datum/radiation_wave/wave, width)
wave.intensity = wave.intensity*(1-((1-amount)/width)) // The further out the rad wave goes the less it's affected by insulation (larger width)
wave.intensity = wave.intensity*(1-((1-amount)/width)) // The further out the rad wave goes the less it's affected by insulation (larger width)
return COMPONENT_RAD_WAVE_HANDLED
+6 -3
View File
@@ -81,7 +81,10 @@
var/atom/thing = atoms[k]
if(!thing)
continue
SEND_SIGNAL(thing, COMSIG_ATOM_RAD_WAVE_PASSING, src, width)
if (SEND_SIGNAL(thing, COMSIG_ATOM_RAD_WAVE_PASSING, src, width) & COMPONENT_RAD_WAVE_HANDLED)
continue
if (thing.rad_insulation != RAD_NO_INSULATION)
intensity *= (1-((1-thing.rad_insulation)/width))
/datum/radiation_wave/proc/radiate(list/atoms, strength)
var/contamination_chance = (strength-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_CHANCE_COEFFICIENT * min(1, 1/(steps*range_modifier))
@@ -92,7 +95,7 @@
thing.rad_act(strength)
// This list should only be for types which don't get contaminated but you want to look in their contents
// If you don't want to look in their contents and you don't want to rad_act them:
// If you don't want to look in their contents and you don't want to rad_act them:
// modify the ignored_things list in __HELPERS/radiation.dm instead
var/static/list/blacklisted = typecacheof(list(
/turf,
@@ -109,4 +112,4 @@
if(SEND_SIGNAL(thing, COMSIG_ATOM_RAD_CONTAMINATING, strength) & COMPONENT_BLOCK_CONTAMINATION)
continue
var/rad_strength = (strength-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_STR_COEFFICIENT
thing.AddComponent(/datum/component/radioactive, rad_strength, source)
thing.AddComponent(/datum/component/radioactive, rad_strength, source)
+4 -2
View File
@@ -32,6 +32,9 @@
var/list/filter_data //For handling persistent filters
var/rad_flags = NONE // Will move to flags_1 when i can be arsed to
var/rad_insulation = RAD_NO_INSULATION
/atom/New(loc, ...)
//atom creation method that preloads variables at creation
if(GLOB.use_preloader && (src.type == GLOB._preloader.target_path))//in case the instanciated atom is creating other atoms in New()
@@ -697,10 +700,9 @@ Proc for attack log creation, because really why not
/atom/movable/proc/get_filter(name)
if(filter_data && filter_data[name])
return filters[filter_data.Find(name)]
/atom/movable/proc/remove_filter(name)
if(filter_data[name])
filter_data -= name
update_filters()
return TRUE
+3 -1
View File
@@ -95,6 +95,9 @@
var/air_tight = FALSE //TRUE means density will be set as soon as the door begins to close
var/prying_so_hard = FALSE
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
rad_insulation = RAD_MEDIUM_INSULATION
var/static/list/airlock_overlays = list()
/obj/machinery/door/airlock/Initialize()
@@ -152,7 +155,6 @@
/obj/machinery/door/airlock/ComponentInitialize()
. = ..()
AddComponent(/datum/component/ntnet_interface)
AddComponent(/datum/component/rad_insulation, RAD_MEDIUM_INSULATION)
/obj/machinery/door/airlock/proc/update_other_id()
for(var/obj/machinery/door/airlock/A in GLOB.airlocks)
+2 -4
View File
@@ -24,6 +24,8 @@
smooth = SMOOTH_TRUE
can_be_unanchored = FALSE
CanAtmosPass = ATMOS_PASS_DENSITY
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
rad_insulation = RAD_MEDIUM_INSULATION
var/mineral = /obj/item/stack/sheet/metal
var/mineral_amount = 2
var/walltype = /turf/closed/wall
@@ -34,10 +36,6 @@
. = ..()
air_update_turf(TRUE)
/obj/structure/falsewall/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_MEDIUM_INSULATION)
/obj/structure/falsewall/ratvar_act()
new /obj/structure/falsewall/brass(loc)
qdel(src)
+2 -4
View File
@@ -9,10 +9,8 @@
var/girderpasschance = 20 // percentage chance that a projectile passes through the girder.
var/can_displace = TRUE //If the girder can be moved around by wrenching it
max_integrity = 200
/obj/structure/girder/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_VERY_LIGHT_INSULATION)
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/girder/examine(mob/user)
. = ..()
+1 -4
View File
@@ -16,10 +16,7 @@
var/rods_broken = TRUE
var/grille_type = null
var/broken_type = /obj/structure/grille/broken
/obj/structure/grille/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_NO_INSULATION)
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
/obj/structure/grille/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
. = ..()
+3 -5
View File
@@ -63,10 +63,8 @@
/obj/structure/holosign/barrier/engineering
icon_state = "holosign_engi"
/obj/structure/holosign/barrier/engineering/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_LIGHT_INSULATION)
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
rad_insulation = RAD_LIGHT_INSULATION
/obj/structure/holosign/barrier/atmos
name = "holo firelock"
@@ -168,4 +166,4 @@
var/mob/living/M = AM
M.electrocute_act(15,"Energy Barrier", safety=1)
shockcd = TRUE
addtimer(CALLBACK(src, .proc/cooldown), 5)
addtimer(CALLBACK(src, .proc/cooldown), 5)
+7 -18
View File
@@ -21,15 +21,14 @@
var/openSound = 'sound/effects/stonedoor_openclose.ogg'
var/closeSound = 'sound/effects/stonedoor_openclose.ogg'
CanAtmosPass = ATMOS_PASS_DENSITY
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
rad_insulation = RAD_MEDIUM_INSULATION
/obj/structure/mineral_door/Initialize()
. = ..()
initial_state = icon_state
air_update_turf(TRUE)
/obj/structure/mineral_door/ComponentInitialize()
AddComponent(/datum/component/rad_insulation, RAD_MEDIUM_INSULATION)
/obj/structure/mineral_door/Move()
var/turf/T = loc
. = ..()
@@ -150,17 +149,13 @@
icon_state = "silver"
sheetType = /obj/item/stack/sheet/mineral/silver
max_integrity = 300
/obj/structure/mineral_door/silver/ComponentInitialize()
AddComponent(/datum/component/rad_insulation, RAD_HEAVY_INSULATION)
rad_insulation = RAD_HEAVY_INSULATION
/obj/structure/mineral_door/gold
name = "gold door"
icon_state = "gold"
sheetType = /obj/item/stack/sheet/mineral/gold
/obj/structure/mineral_door/gold/ComponentInitialize()
AddComponent(/datum/component/rad_insulation, RAD_HEAVY_INSULATION)
rad_insulation = RAD_HEAVY_INSULATION
/obj/structure/mineral_door/uranium
name = "uranium door"
@@ -180,9 +175,7 @@
/obj/structure/mineral_door/transparent
opacity = FALSE
/obj/structure/mineral_door/transparent/ComponentInitialize()
AddComponent(/datum/component/rad_insulation, RAD_VERY_LIGHT_INSULATION)
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/mineral_door/transparent/Close()
..()
@@ -218,9 +211,7 @@
icon_state = "diamond"
sheetType = /obj/item/stack/sheet/mineral/diamond
max_integrity = 1000
/obj/structure/mineral_door/transparent/diamond/ComponentInitialize()
AddComponent(/datum/component/rad_insulation, RAD_EXTREME_INSULATION)
rad_insulation = RAD_EXTREME_INSULATION
/obj/structure/mineral_door/wood
name = "wood door"
@@ -230,9 +221,7 @@
sheetType = /obj/item/stack/sheet/mineral/wood
resistance_flags = FLAMMABLE
max_integrity = 200
/obj/structure/mineral_door/wood/ComponentInitialize()
AddComponent(/datum/component/rad_insulation, RAD_VERY_LIGHT_INSULATION)
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/mineral_door/paperframe
name = "paper frame door"
+1 -4
View File
@@ -7,10 +7,7 @@
max_integrity = 100
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
var/buildable_sign = 1 //unwrenchable and modifiable
/obj/structure/sign/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_NO_INSULATION) // Since this is on a wall if it becomes irradiated it will smuggle the radiation past the wall
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
/obj/structure/sign/basic
name = "blank sign"
+3 -3
View File
@@ -25,7 +25,8 @@
var/real_explosion_block //ignore this, just use explosion_block
var/breaksound = "shatter"
var/hitsound = 'sound/effects/Glasshit.ogg'
var/rad_insulation = RAD_VERY_LIGHT_INSULATION
rad_insulation = RAD_VERY_LIGHT_INSULATION
rad_flags = RAD_PROTECT_CONTENTS
/obj/structure/window/examine(mob/user)
..()
@@ -63,7 +64,6 @@
/obj/structure/window/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, rad_insulation, TRUE, FALSE)
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS ,null,CALLBACK(src, .proc/can_be_rotated),CALLBACK(src,.proc/after_rotation))
/obj/structure/window/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd)
@@ -735,4 +735,4 @@
update_icon()
return
..()
update_icon()
update_icon()
+2 -4
View File
@@ -3,10 +3,8 @@
opacity = 1
density = TRUE
blocks_air = 1
/turf/closed/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_MEDIUM_INSULATION)
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
rad_insulation = RAD_MEDIUM_INSULATION
/turf/closed/AfterChange()
. = ..()
@@ -12,10 +12,7 @@
sheet_amount = 1
girder_type = /obj/structure/girder/reinforced
explosion_block = 2
/turf/closed/wall/r_wall/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_HEAVY_INSULATION)
rad_insulation = RAD_HEAVY_INSULATION
/turf/closed/wall/r_wall/deconstruction_hints(mob/user)
switch(d_state)
@@ -229,4 +226,4 @@
/turf/closed/wall/r_wall/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
if(the_rcd.canRturf)
return ..()
return ..()
+2 -10
View File
@@ -126,10 +126,7 @@
equip_delay_other = 60
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
resistance_flags = NONE
/obj/item/clothing/head/radiation/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_NO_INSULATION, TRUE, FALSE)
rad_flags = RAD_PROTECT_CONTENTS
/obj/item/clothing/suit/radiation
name = "radiation suit"
@@ -148,9 +145,4 @@
equip_delay_other = 60
flags_inv = HIDEJUMPSUIT
resistance_flags = NONE
/obj/item/clothing/suit/radiation/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_NO_INSULATION, TRUE, FALSE)
// Just don't want things to be irradiated inside this
// Except things on the mob aren't even inside the suit so ehhhhhh
rad_flags = RAD_PROTECT_CONTENTS
+1 -4
View File
@@ -11,6 +11,7 @@
weather_immunities = list("ash")
possible_a_intents = list(INTENT_HELP, INTENT_HARM)
mob_biotypes = list(MOB_ROBOTIC)
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS
var/last_lawchange_announce = 0
@@ -52,10 +53,6 @@
diag_hud_set_status()
diag_hud_set_health()
/mob/living/silicon/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_NO_INSULATION, TRUE, TRUE)
/mob/living/silicon/med_hud_set_health()
return //we use a different hud
+2 -5
View File
@@ -26,14 +26,11 @@
var/bitcoinproduction_drain = 0.15
var/bitcoinmining = FALSE
rad_insulation = RAD_EXTREME_INSULATION
/obj/machinery/power/rad_collector/anchored
anchored = TRUE
/obj/machinery/power/rad_collector/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_EXTREME_INSULATION, FALSE, FALSE)
/obj/machinery/power/rad_collector/Destroy()
return ..()
@@ -234,4 +231,4 @@
#undef RAD_COLLECTOR_COEFFICIENT
#undef RAD_COLLECTOR_STORED_OUT
#undef RAD_COLLECTOR_MINING_CONVERSION_RATE
#undef RAD_COLLECTOR_OUTPUT
#undef RAD_COLLECTOR_OUTPUT
+1 -4
View File
@@ -10,6 +10,7 @@
resistance_flags = FIRE_PROOF
interaction_flags_machine = INTERACT_MACHINE_OPEN | INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON
obj_flags = CAN_BE_HIT | USES_TGUI
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
var/datum/gas_mixture/air_contents // internal reservoir
var/full_pressure = FALSE
var/pressure_charging = TRUE
@@ -42,10 +43,6 @@
return INITIALIZE_HINT_LATELOAD //we need turfs to have air
/obj/machinery/disposal/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_NO_INSULATION)
/obj/machinery/disposal/proc/trunk_check()
trunk = locate() in loc
if(!trunk)
+1 -4
View File
@@ -7,6 +7,7 @@
invisibility = INVISIBILITY_MAXIMUM
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
dir = NONE
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
var/datum/gas_mixture/gas // gas used to flush, will appear at exit point
var/active = FALSE // true if the holder is moving, otherwise inactive
var/count = 1000 // can travel 1000 steps before going inactive (in case of loops)
@@ -14,10 +15,6 @@
var/tomail = FALSE // contains wrapped package
var/hasmob = FALSE // contains a mob
/obj/structure/disposalholder/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_NO_INSULATION)
/obj/structure/disposalholder/Destroy()
QDEL_NULL(gas)
active = FALSE
+1 -4
View File
@@ -6,6 +6,7 @@
icon_state = "outlet"
density = TRUE
anchored = TRUE
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
var/active = FALSE
var/turf/target // this will be where the output objects are 'thrown' to.
var/obj/structure/disposalpipe/trunk/trunk // the attached pipe trunk
@@ -28,10 +29,6 @@
if(trunk)
trunk.linked = src // link the pipe trunk to self
/obj/structure/disposaloutlet/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_NO_INSULATION)
/obj/structure/disposaloutlet/Destroy()
if(trunk)
trunk.linked = null
+1 -4
View File
@@ -12,6 +12,7 @@
max_integrity = 200
armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 90, "acid" = 30)
layer = DISPOSAL_PIPE_LAYER // slightly lower than wires and other pipes
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
var/dpdir = NONE // bitmask of pipe directions
var/initialize_dirs = NONE // bitflags of pipe directions added on init, see \code\_DEFINES\pipe_construction.dm
var/flip_type // If set, the pipe is flippable and becomes this type when flipped
@@ -42,10 +43,6 @@
dpdir |= turn(dir, 180)
update()
/obj/structure/disposalpipe/ComponentInitialize()
. = ..()
AddComponent(/datum/component/rad_insulation, RAD_NO_INSULATION)
// pipe is deleted
// ensure if holder is present, it is expelled
/obj/structure/disposalpipe/Destroy()