mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Fixes baseturf helpers (#79697)
## About The Pull Request Baseturf helpers do this:  And they also do this (up to 3x):  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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user