From adcd4af1ffc5e63afedb8d96f097886bcc116e4f Mon Sep 17 00:00:00 2001 From: AnturK Date: Wed, 30 Dec 2020 17:47:57 +0100 Subject: [PATCH] Meat statue fixes (#55790) Fixes few statue bugs with textured materials. Makes materials use managed filters. This can have side effects on things that already had unmanaged filters on. --- code/datums/materials/_material.dm | 11 +++++------ code/game/objects/structures/statues.dm | 4 +++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/datums/materials/_material.dm b/code/datums/materials/_material.dm index fdd44d8a04b..3f55b6aa12b 100644 --- a/code/datums/materials/_material.dm +++ b/code/datums/materials/_material.dm @@ -34,16 +34,15 @@ Simple datum which is instanced once per type and is used for every object of sa var/turf_sound_override ///what texture icon state to overlay var/texture_layer_icon_state - ///a cached filter for the texture icon - var/cached_texture_filter + ///a cached icon for the texture filter + var/cached_texture_filter_icon ///What type of shard the material will shatter to var/obj/item/shard_type /datum/material/New() . = ..() if(texture_layer_icon_state) - var/texture_icon = icon('icons/materials/composite.dmi', texture_layer_icon_state) - cached_texture_filter = filter(type="layer", icon=texture_icon, blend_mode = BLEND_INSET_OVERLAY) + cached_texture_filter_icon = icon('icons/materials/composite.dmi', texture_layer_icon_state) @@ -56,7 +55,7 @@ Simple datum which is instanced once per type and is used for every object of sa source.alpha = alpha if(texture_layer_icon_state) ADD_KEEP_TOGETHER(source, MATERIAL_SOURCE(src)) - source.filters += cached_texture_filter + source.add_filter("material_texture_[name]",1,layering_filter(icon=cached_texture_filter_icon,blend_mode=BLEND_INSET_OVERLAY)) if(alpha < 255) source.opacity = FALSE @@ -125,7 +124,7 @@ Simple datum which is instanced once per type and is used for every object of sa if(color) source.remove_atom_colour(FIXED_COLOUR_PRIORITY, color) if(texture_layer_icon_state) - source.filters -= cached_texture_filter + source.remove_filter("material_texture_[name]") REMOVE_KEEP_TOGETHER(source, MATERIAL_SOURCE(src)) source.alpha = initial(source.alpha) diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm index 275b18cdd94..0da02ebd1ea 100644 --- a/code/game/objects/structures/statues.dm +++ b/code/game/objects/structures/statues.dm @@ -487,7 +487,8 @@ Moving interrupts return if(!target_appearance_with_filters) target_appearance_with_filters = new(current_target) - target_appearance_with_filters.appearance_flags |= KEEP_TOGETHER + // KEEP_APART in case carving block gets KEEP_TOGETHER from somewhere like material texture filters. + target_appearance_with_filters.appearance_flags |= KEEP_TOGETHER | KEEP_APART //Doesn't use filter helpers because MAs aren't atoms target_appearance_with_filters.filters = filter(type="color",color=greyscale_with_value_bump,space=FILTER_COLOR_HSV) completion = value @@ -549,6 +550,7 @@ Moving interrupts content_ma.pixel_x = 0 content_ma.pixel_y = 0 content_ma.alpha = 255 + content_ma.appearance_flags &= ~KEEP_APART //Don't want this content_ma.filters = filter(type="color",color=greyscale_with_value_bump,space=FILTER_COLOR_HSV) update_icon()