Fixes baseturf helpers (#79697)

## About The Pull Request
Baseturf helpers do this:

![image](https://github.com/tgstation/tgstation/assets/42397676/f73887cc-10b1-4b24-b123-dc99c02ad45a)

And they also do this (up to 3x):
![Screenshot 2023-11-12
164334](https://github.com/tgstation/tgstation/assets/42397676/ac555d9a-785b-4e02-b85d-e90ded3b08ad)

When trying to debug `PlaceOnBottom` I couldn't help but notice it's
trying to encompass use cases that simply aren't used anywhere. YAGNI -
this makes it much more complex than it needs to be.
## Why It's Good For The Game
Fixes weird baseturf handling
FIxes #79172
## Changelog
N/A nothing player facing

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
Jeremiah
2023-11-13 20:09:37 -07:00
committed by GitHub
co-authored by Mothblocks
parent cad1f28427
commit 2b8e7196d7
3 changed files with 17 additions and 24 deletions
+10 -2
View File
@@ -6,8 +6,9 @@
name = "baseturf editor"
icon = 'icons/effects/mapping_helpers.dmi'
icon_state = ""
/// Replacing a specific turf
var/list/baseturf_to_replace
/// The desired bottom turf
var/baseturf
plane = POINT_PLANE
@@ -33,9 +34,16 @@
qdel(src)
/// Replaces all the requested baseturfs (usually space/baseturfbottom) with the desired baseturf. Skips if its already there
/obj/effect/baseturf_helper/proc/replace_baseturf(turf/thing)
thing.remove_baseturfs_from_typecache(baseturf_to_replace)
thing.PlaceOnBottom(fake_turf_type = baseturf)
if(length(thing.baseturfs))
var/turf/tile = thing.baseturfs[1]
if(tile == baseturf)
return
thing.place_on_bottom(baseturf)
/obj/effect/baseturf_helper/space
name = "space baseturf editor"