[MIRROR] Correct instances of destroying baseturfs in ChangeTurf & Select dimensional anomaly theme [MDB IGNORE] (#19255)

* Correct instances of destroying baseturfs in ChangeTurf & Select dimensional anomaly theme

* events

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: lessthnthree <three@lessthanthree.dk>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-03-10 02:39:30 +00:00
committed by GitHub
co-authored by Jacquerel lessthnthree Gandalf
parent 68b1ed193f
commit f48b604aff
10 changed files with 208 additions and 79 deletions
@@ -42,10 +42,12 @@
/**
* Prepare a new area for transformation into a new theme.
* Optionally pass in the typepath of an anomaly theme to use that one.
*/
/obj/effect/anomaly/dimensional/proc/prepare_area()
var/datum/dimension_theme/themes = new()
theme = themes.get_random_theme()
/obj/effect/anomaly/dimensional/proc/prepare_area(new_theme_path)
if (!new_theme_path)
new_theme_path = pick(subtypesof(/datum/dimension_theme))
theme = new new_theme_path()
apply_theme_icon()
target_turfs = new()
@@ -32,13 +32,6 @@
var/datum/material/using_mat = GET_MATERIAL_REF(material)
window_colour = using_mat.greyscale_colors
/**
* Returns a subtype of dimensional theme.
*/
/datum/dimension_theme/proc/get_random_theme()
var/subtype = pick(subtypesof(/datum/dimension_theme))
return new subtype()
/**
* Applies themed transformation to the provided turf.
*
@@ -105,7 +98,7 @@
/datum/dimension_theme/proc/transform_floor(turf/open/floor/affected_floor)
if (replace_floors.len == 0)
return FALSE
affected_floor.ChangeTurf(pick_weight(replace_floors), flags = CHANGETURF_INHERIT_AIR)
affected_floor.replace_floor(pick_weight(replace_floors), flags = CHANGETURF_INHERIT_AIR)
return TRUE
/**
@@ -191,6 +184,7 @@
if (!permit_replace_material(thing))
continue
thing.set_custom_materials(custom_materials)
thing.update_appearance(updates = UPDATE_ICON)
#undef PERMITTED_MATERIAL_REPLACE_TYPES