mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
[MANUAL MIRROR] Abstract away stuff that acts on baseturfs directly into their own procs, and kills some dead code related to baseturfs + tests (#72117) (#18655)
Abstract away stuff that acts on baseturfs directly into their own procs, and kills some dead code related to baseturfs + tests (#72117) Adds some new procs relating to baseturfs that replaces some code that reads and sets them directly. Moves them to their own file. **To reviewers: Any proc in baseturfs.dm that is snake_case is mine, anything else is just moved**. Adds tests for the existing procs of baseturfs. I'm going to be doing some optimizations to baseturfs that change the actual representation of baseturfs, and so I'm prepping these to be implementation agnostic. Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
co-authored by
LemonInTheDark
Mothblocks
parent
29495d21a5
commit
c44843b738
@@ -34,22 +34,8 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/baseturf_helper/proc/replace_baseturf(turf/thing)
|
||||
if(length(thing.baseturfs))
|
||||
var/list/baseturf_cache = thing.baseturfs.Copy()
|
||||
for(var/i in baseturf_cache)
|
||||
if(baseturf_to_replace[i])
|
||||
baseturf_cache -= i
|
||||
thing.baseturfs = baseturfs_string_list(baseturf_cache, thing)
|
||||
if(!baseturf_cache.len)
|
||||
thing.assemble_baseturfs(baseturf)
|
||||
else
|
||||
thing.PlaceOnBottom(null, baseturf)
|
||||
else if(baseturf_to_replace[thing.baseturfs])
|
||||
thing.assemble_baseturfs(baseturf)
|
||||
else
|
||||
thing.PlaceOnBottom(null, baseturf)
|
||||
|
||||
|
||||
thing.remove_baseturfs_from_typecache(baseturf_to_replace)
|
||||
thing.PlaceOnBottom(fake_turf_type = baseturf)
|
||||
|
||||
/obj/effect/baseturf_helper/space
|
||||
name = "space baseturf editor"
|
||||
|
||||
Reference in New Issue
Block a user