From 91e2a1ba6ce321f7d9ce335914e7b7e1416929fd Mon Sep 17 00:00:00 2001 From: mikomyazaki <47489928+mikomyazaki@users.noreply.github.com> Date: Sat, 1 Aug 2020 00:50:45 +0100 Subject: [PATCH] Can now build all types of flooring without them existing first. (#9548) --- code/game/gamemodes/cult/cultify/turf.dm | 2 +- code/game/machinery/nuclear_bomb.dm | 2 +- code/game/turfs/flooring/flooring.dm | 9 --------- code/game/turfs/simulated/floor.dm | 2 +- code/game/turfs/simulated/floor_attackby.dm | 5 +++-- code/modules/mob/living/bot/floorbot.dm | 2 +- html/changelogs/impossible_floors.yml | 6 ++++++ 7 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 html/changelogs/impossible_floors.yml diff --git a/code/game/gamemodes/cult/cultify/turf.dm b/code/game/gamemodes/cult/cultify/turf.dm index 78ba4daf73a..f957a043bfd 100644 --- a/code/game/gamemodes/cult/cultify/turf.dm +++ b/code/game/gamemodes/cult/cultify/turf.dm @@ -44,7 +44,7 @@ pixel_y = 0 if(istype(src,/turf/simulated/floor)) var/turf/simulated/floor/F = src - F.set_flooring(get_flooring_data(/decl/flooring/reinforced/cult)) + F.set_flooring(decls_repository.get_decl(/decl/flooring/reinforced/cult)) /turf/proc/cultify_wall() ChangeTurf(/turf/unsimulated/wall/cult) diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 815cc506b43..09f7a28b4fa 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -434,7 +434,7 @@ var/bomb_set /obj/machinery/nuclearbomb/station/LateInitialize() for(var/turf/simulated/floor/T in RANGE_TURFS(1, src)) - T.set_flooring(get_flooring_data(/decl/flooring/reinforced/circuit/red)) + T.set_flooring(decls_repository.get_decl(/decl/flooring/reinforced/circuit/red)) flash_tiles += T update_icon() diff --git a/code/game/turfs/flooring/flooring.dm b/code/game/turfs/flooring/flooring.dm index 56fd3d9c00d..65d09cc331a 100644 --- a/code/game/turfs/flooring/flooring.dm +++ b/code/game/turfs/flooring/flooring.dm @@ -1,12 +1,3 @@ -var/list/flooring_types - -/proc/get_flooring_data(var/flooring_path) - if(!flooring_types) - flooring_types = list() - if(!flooring_types["[flooring_path]"]) - flooring_types["[flooring_path]"] = new flooring_path - return flooring_types["[flooring_path]"] - // State values: // [icon_base]: initial base icon_state without edges or corners. // if has_base_range is set, append 0-has_base_range ie. diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 0af8aadaf3d..6a17b187e4f 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -25,7 +25,7 @@ if(!floortype && initial_flooring) floortype = initial_flooring if(floortype) - set_flooring(get_flooring_data(floortype), mapload) + set_flooring(decls_repository.get_decl(floortype), mapload) /turf/simulated/floor/proc/set_flooring(decl/flooring/newflooring, mapload) if (!mapload) diff --git a/code/game/turfs/simulated/floor_attackby.dm b/code/game/turfs/simulated/floor_attackby.dm index 57bd4eaaf15..98183776d09 100644 --- a/code/game/turfs/simulated/floor_attackby.dm +++ b/code/game/turfs/simulated/floor_attackby.dm @@ -53,8 +53,9 @@ return var/obj/item/stack/S = C var/decl/flooring/use_flooring - for(var/flooring_type in flooring_types) - var/decl/flooring/F = flooring_types[flooring_type] + var/list/decls = decls_repository.get_decls_of_subtype(/decl/flooring) + for(var/flooring_type in decls) + var/decl/flooring/F = decls[flooring_type] if(!F.build_type) continue if(ispath(S.type, F.build_type) || ispath(S.build_type, F.build_type)) diff --git a/code/modules/mob/living/bot/floorbot.dm b/code/modules/mob/living/bot/floorbot.dm index f29d73fab89..e0ae75e5e15 100644 --- a/code/modules/mob/living/bot/floorbot.dm +++ b/code/modules/mob/living/bot/floorbot.dm @@ -249,7 +249,7 @@ visible_message("[src] begins to improve the floor.") if(do_after(src, 50)) if(!F.flooring) - F.set_flooring(get_flooring_data(floor_build_type)) + F.set_flooring(decls_repository.get_decl(floor_build_type)) addTiles(-1) target = null repairing = 0 diff --git a/html/changelogs/impossible_floors.yml b/html/changelogs/impossible_floors.yml new file mode 100644 index 00000000000..675ebbf1f16 --- /dev/null +++ b/html/changelogs/impossible_floors.yml @@ -0,0 +1,6 @@ +author: mikomyazaki + +delete-after: True + +changes: + - bugfix: "It is now possible to build many types of flooring that were previously bugged, including diamond, some carpet styles, silver, gold and uranium." \ No newline at end of file