mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
- Fixes Paper and font tags stacking across rounds, as shown in:  - Fixes Graffiti being persistent for over 50 rounds (10+ days) - Sets Trash to be persistent for 4 rounds instead of 5 - Fixes Persistence being always-on because of if("persistence_enabled") config.persistence_enabled = 1. As explained: > it's on by default, which means config.txt will be read and if it's not there it stays at 1. If it is there,it gets set to 1. There is no way to disable it - Adds config options to enable/disable **Persistence for Maploaded objects**, as well as a verb to toggle such. - Adds Persistence to config. Currently IGNORE_MAPLOAD for Persistance is **Disabled.** Maploaded objects/dirt/etc will be saved by persistence, preserving current behavior.
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
/datum/persistent/filth
|
|
name = "filth"
|
|
tokens_per_line = 5
|
|
entries_expire_at = 4 // 4 rounds, 24 hours.
|
|
|
|
/datum/persistent/filth/LabelTokens(var/list/tokens)
|
|
var/list/labelled_tokens = ..()
|
|
labelled_tokens["path"] = text2path(tokens[LAZYLEN(labelled_tokens)+1])
|
|
return labelled_tokens
|
|
|
|
/datum/persistent/filth/IsValidEntry(var/atom/entry)
|
|
. = ..() && entry.invisibility == 0
|
|
|
|
/datum/persistent/filth/CheckTokenSanity(var/list/tokens)
|
|
return ..() && ispath(tokens["path"])
|
|
|
|
/datum/persistent/filth/CheckTurfContents(var/turf/T, var/list/tokens)
|
|
var/_path = tokens["path"]
|
|
return (locate(_path) in T) ? FALSE : TRUE
|
|
|
|
/datum/persistent/filth/CreateEntryInstance(var/turf/creating, var/list/tokens)
|
|
var/_path = tokens["path"]
|
|
new _path(creating, tokens["age"]+1)
|
|
|
|
/datum/persistent/filth/GetEntryAge(var/atom/entry)
|
|
var/obj/effect/decal/cleanable/filth = entry
|
|
return filth.age
|
|
|
|
/datum/persistent/filth/proc/GetEntryPath(var/atom/entry)
|
|
var/obj/effect/decal/cleanable/filth = entry
|
|
return filth.generic_filth ? /obj/effect/decal/cleanable/filth : filth.type
|
|
|
|
/datum/persistent/filth/CompileEntry(var/atom/entry)
|
|
. = ..()
|
|
LAZYADD(., "[GetEntryPath(entry)]") |