Skip to content

Commit

Permalink
Fixes some null runtimes (#10916)
Browse files Browse the repository at this point in the history
* Fixes some nulls

* It's been null always, huh

* and this can be null
  • Loading branch information
EvilDragonfiend authored May 7, 2024
1 parent 93199ac commit c24a2a0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
3 changes: 2 additions & 1 deletion code/__DEFINES/bodyparts.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define IS_ORGANIC_LIMB(A) (A.bodytype & BODYTYPE_ORGANIC)
#define IS_ORGANIC_LIMB(A) (A && (A.bodytype & BODYTYPE_ORGANIC))
#define IS_ROBOTIC_LIMB(A) (A && (A.bodytype & BODYTYPE_ROBOTIC))

#define BODYZONE_STYLE_DEFAULT 0
#define BODYZONE_STYLE_MEDICAL 1
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list(

#define ismecha(A) (istype(A, /obj/mecha))

#define ismopable(A) (A.layer <= HIGH_SIGIL_LAYER) //If something can be cleaned by floor-cleaning devices such as mops or clean bots
#define ismopable(A) (A && (A.layer <= HIGH_SIGIL_LAYER)) //If something can be cleaned by floor-cleaning devices such as mops or clean bots

#define isorgan(A) (istype(A, /obj/item/organ))

Expand Down
2 changes: 1 addition & 1 deletion code/game/mecha/equipment/tools/mining_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
target.apply_damage(10, BRUTE, BODY_ZONE_CHEST, target.run_armor_check(target_part, MELEE))

//blood splatters and sparks
if(issilicon(target) || isbot(target) || isswarmer(target) || !IS_ORGANIC_LIMB(target_part))
if(issilicon(target) || isbot(target) || isswarmer(target) || IS_ROBOTIC_LIMB(target_part))
do_sparks(rand(1, 3), FALSE, target.drop_location())
else
var/splatter_dir = get_dir(chassis, target)
Expand Down
20 changes: 11 additions & 9 deletions code/modules/reagents/chemistry/reagents/other_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1115,16 +1115,18 @@
O?.wash(clean_types)

/datum/reagent/space_cleaner/reaction_turf(turf/T, reac_volume)
if(reac_volume >= 1)
T.wash(clean_types)
for(var/am in T)
var/atom/movable/movable_content
if(ismopable(movable_content)) // Mopables will be cleaned anyways by the turf wash
continue
movable_content.wash(clean_types)
if(reac_volume < 1)
return

for(var/mob/living/simple_animal/slime/M in T)
M.adjustToxLoss(rand(5,10))
T.wash(clean_types)
for(var/am in T)
var/atom/movable/movable_content = am
if(ismopable(movable_content)) // Mopables will be cleaned anyways by the turf wash
continue
movable_content.wash(clean_types)

for(var/mob/living/simple_animal/slime/M in T)
M.adjustToxLoss(rand(5,10))

/datum/reagent/space_cleaner/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
if(method == TOUCH || method == VAPOR)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/research/destructive_analyzer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Note: Must be placed within 3 tiles of the R&D Console
var/user_mode_string = ""
if(length(point_value))
user_mode_string = " for [json_encode(point_value)] points"
else if(loaded_item.custom_materials.len)
else if(length(loaded_item.custom_materials))
user_mode_string = " for material reclamation"
var/choice = input("Are you sure you want to destroy [loaded_item][user_mode_string]?") in list("Proceed", "Cancel")
if(choice != "Proceed")
Expand Down

0 comments on commit c24a2a0

Please sign in to comment.