Files
CHOMPStation2/code/modules/persistence/effects/filth_vr.dm
Heroman3003 b3684c7ec6 Merge pull request #14530 from Seris02/dirtnotspace
prevents persistent dirt (and other filth) from spawning in spess and walls
2023-02-23 03:32:40 +00:00

24 lines
685 B
Plaintext

/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 (isspace(creating) || iswall(creating) ||isopenspace(creating))
return
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))