mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-01-30 02:44:26 +00:00
better dirt persistence
This commit is contained in:
@@ -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
|
||||
|
||||
21
code/modules/persistence/effects/filth_vr.dm
Normal file
21
code/modules/persistence/effects/filth_vr.dm
Normal 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))
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user