mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 15:17:01 +01:00
[MIRROR] Makes the ChangeTurf same turf optimization work properly again, and converts baseturfs into a string_list (#1601)
* Makes the ChangeTurf same turf optimization work properly again, and converts baseturfs into a string_list (#54277) I've converted baseturfs into a string list, I had to add a helper proc for baseturf stringlistifying, as the system expects single length baseturfs to not be a list, and I needed to support that. I added a length check of 100 to the helper proc, to help prevent more stuff like what got us into this mess in the first place, the kilo oom bug. Makes ChangeTurf a lot faster in some cases, as it should be, and saves a lot of memory with cached lists. * Makes the ChangeTurf same turf optimization work properly again, and converts baseturfs into a string_list Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
co-authored by
LemonInTheDark
parent
5d2c3da593
commit
7813465ef3
@@ -34,11 +34,12 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/baseturf_helper/proc/replace_baseturf(turf/thing)
|
||||
var/list/baseturf_cache = thing.baseturfs
|
||||
if(length(baseturf_cache))
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user