better dirt persistence

This commit is contained in:
Seris02
2023-01-16 14:30:11 +08:00
parent 9a690755cb
commit e634c802bb
5 changed files with 27 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
/datum/persistent/filth
name = "filth"
entries_expire_at = 4 // 4 rounds, 24 hours.
var/saves_dirt = TRUE //VOREStation edit
/datum/persistent/filth/IsValidEntry(var/atom/entry)
. = ..() && entry.invisibility == 0

View File

@@ -0,0 +1,21 @@
/datum/persistent/filth/CheckTokenSanity(var/list/token)
. = ..()
return saves_dirt ? . && isnum(token["dirt"]) : .
/datum/persistent/filth/CreateEntryInstance(var/turf/creating, var/list/token)
var/_path = token["path"]
if (saves_dirt)
new _path(creating, token["age"]+1, token["dirt"])
else
new _path(creating, token["age"]+1)
/datum/persistent/filth/proc/GetEntryDirt(var/atom/entry)
var/turf/simulated/T = get_turf(entry)
if (istype(T))
return T.dirt
return 0
/datum/persistent/filth/CompileEntry(var/atom/entry)
. = ..()
if (saves_dirt)
LAZYADDASSOC(., "dirt", GetEntryDirt(entry))

View File

@@ -1,5 +1,6 @@
/datum/persistent/filth/trash
name = "trash"
saves_dirt = FALSE //VOREStation edit
/datum/persistent/filth/trash/CheckTurfContents(var/turf/T, var/list/tokens)
var/too_much_trash = 0