From 03a7fc38184de625e90f2734835f6968b3b26014 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Fri, 8 Nov 2019 19:15:58 +0100 Subject: [PATCH 1/3] rad flags fixes. --- code/__DEFINES/flags.dm | 1 + code/__HELPERS/radiation.dm | 2 +- code/datums/radiation_wave.dm | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 9e8a4f71c2..dc9a439b70 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -90,3 +90,4 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 // radiation #define RAD_PROTECT_CONTENTS (1<<0) #define RAD_NO_CONTAMINATE (1<<1) +#define RAD_PROTECT_SELF (1<<2) diff --git a/code/__HELPERS/radiation.dm b/code/__HELPERS/radiation.dm index e082be7d1f..a1b781c467 100644 --- a/code/__HELPERS/radiation.dm +++ b/code/__HELPERS/radiation.dm @@ -15,7 +15,7 @@ while(processing_list.len) var/atom/thing = processing_list[1] processing_list -= thing - if(ignored_things[thing.type]) + if(ignored_things[thing.type] || CHECK_BITFIELD(thing.rad_flags, RAD_PROTECT_SELF)) continue . += thing if((thing.rad_flags & RAD_PROTECT_CONTENTS) || (SEND_SIGNAL(thing, COMSIG_ATOM_RAD_PROBE) & COMPONENT_BLOCK_RADIATION)) diff --git a/code/datums/radiation_wave.dm b/code/datums/radiation_wave.dm index 6118428547..8555e4cf3f 100644 --- a/code/datums/radiation_wave.dm +++ b/code/datums/radiation_wave.dm @@ -66,6 +66,8 @@ place = cmaster_turf for(var/i in 1 to distance) place = get_step(place, dir) + if(!place) + break atoms += get_rad_contents(place) return atoms @@ -108,7 +110,7 @@ if(!can_contaminate || blacklisted[thing.type]) continue if(prob(contamination_chance)) // Only stronk rads get to have little baby rads - if(SEND_SIGNAL(thing, COMSIG_ATOM_RAD_CONTAMINATING, strength) & COMPONENT_BLOCK_CONTAMINATION) + if(CHECK_BITFIELD(thing.rad_flags, RAD_NO_CONTAMINATE) || 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) From 4819cdc228bc6815908bc8003005c7a75f433a73 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Fri, 8 Nov 2019 19:29:52 +0100 Subject: [PATCH 2/3] mistakes were made. --- code/__HELPERS/radiation.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/radiation.dm b/code/__HELPERS/radiation.dm index a1b781c467..4104e267a7 100644 --- a/code/__HELPERS/radiation.dm +++ b/code/__HELPERS/radiation.dm @@ -15,9 +15,10 @@ while(processing_list.len) var/atom/thing = processing_list[1] processing_list -= thing - if(ignored_things[thing.type] || CHECK_BITFIELD(thing.rad_flags, RAD_PROTECT_SELF)) + if(ignored_things[thing.type]) continue - . += thing + if(CHECK_BITFIELD(thing.rad_flags, RAD_PROTECT_SELF)) + . += thing if((thing.rad_flags & RAD_PROTECT_CONTENTS) || (SEND_SIGNAL(thing, COMSIG_ATOM_RAD_PROBE) & COMPONENT_BLOCK_RADIATION)) continue processing_list += thing.contents From 84258c6e7388c08ae0ee3d0d932306afb496839c Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Fri, 8 Nov 2019 19:39:52 +0100 Subject: [PATCH 3/3] This is useless actually. --- code/__DEFINES/flags.dm | 1 - code/__HELPERS/radiation.dm | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index dc9a439b70..9e8a4f71c2 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -90,4 +90,3 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 // radiation #define RAD_PROTECT_CONTENTS (1<<0) #define RAD_NO_CONTAMINATE (1<<1) -#define RAD_PROTECT_SELF (1<<2) diff --git a/code/__HELPERS/radiation.dm b/code/__HELPERS/radiation.dm index 4104e267a7..e082be7d1f 100644 --- a/code/__HELPERS/radiation.dm +++ b/code/__HELPERS/radiation.dm @@ -17,8 +17,7 @@ processing_list -= thing if(ignored_things[thing.type]) continue - if(CHECK_BITFIELD(thing.rad_flags, RAD_PROTECT_SELF)) - . += thing + . += thing if((thing.rad_flags & RAD_PROTECT_CONTENTS) || (SEND_SIGNAL(thing, COMSIG_ATOM_RAD_PROBE) & COMPONENT_BLOCK_RADIATION)) continue processing_list += thing.contents