Files
Polaris/code/game/objects/effects/decals/cleanable.dm
Rykka 2ad7b475ec Persistence Patch
- Fixes Paper and font tags stacking across rounds, as shown in: ![](https://cdn.discordapp.com/attachments/187013248309002240/741937939382141000/164fdd3a37fb22f18dfa9b5c431ffc04.png)

- 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.

You will need to update config.txt with the following lines:
\## Uncomment this to DISABLE persistence 
\#PERSISTENCE_DISABLED 
 
\## Uncomment this to DISABLE maploaded trash/paper/etc from being saved by the persistence system. 
\#PERSISTENCE_IGNORE_MAPLOAD
2020-08-16 09:58:57 -04:00

38 lines
1.3 KiB
Plaintext

/*
USAGE NOTE
For decals, the var Persistent = 'has already been saved', and is primarily used to prevent duplicate savings of generic filth (filth.dm).
This also means 'TRUE' can be used to define a decal as "Do not save at all, even as a generic replacement." if a dirt decal is considered 'too common' to save.
generic_filth = TRUE means when the decal is saved, it will be switched out for a generic green 'filth' decal.
*/
/obj/effect/decal/cleanable
plane = DIRTY_PLANE
var/persistent = FALSE
var/generic_filth = FALSE
var/age = 0
var/list/random_icon_states = list()
/obj/effect/decal/cleanable/Initialize(var/mapload, var/_age)
if(!isnull(_age))
age = _age
if(random_icon_states && length(src.random_icon_states) > 0)
src.icon_state = pick(src.random_icon_states)
if(!mapload || !config.persistence_ignore_mapload)
SSpersistence.track_value(src, /datum/persistent/filth)
. = ..()
/obj/effect/decal/cleanable/Destroy()
SSpersistence.forget_value(src, /datum/persistent/filth)
. = ..()
/obj/effect/decal/cleanable/clean_blood(var/ignore = 0)
if(!ignore)
qdel(src)
return
..()
/obj/effect/decal/cleanable/New()
if (random_icon_states && length(src.random_icon_states) > 0)
src.icon_state = pick(src.random_icon_states)
..()