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
This commit is contained in:
Rykka
2020-08-16 09:58:57 -04:00
parent 0f2fddde6a
commit 2ad7b475ec
11 changed files with 58 additions and 18 deletions
@@ -24,11 +24,13 @@
if(requires_noticeboard && LAZYLEN(board.notices) >= board.max_notices)
return
var/obj/item/weapon/paper/paper = new paper_type(creating)
paper.set_content(tokens["message"], tokens["title"])
paper.info = tokens["message"]
paper.title = tokens["title"]
paper.last_modified_ckey = tokens["author"]
if(requires_noticeboard)
board.add_paper(paper)
SSpersistence.track_value(paper, type)
if(!paper.was_maploaded) // If we were created/loaded when the map was made, skip us!
SSpersistence.track_value(paper, type)
return paper
/datum/persistent/paper/GetEntryAge(var/atom/entry)
@@ -6,8 +6,8 @@
var/name
var/filename
var/tokens_per_line
var/entries_expire_at
var/entries_decay_at
var/entries_expire_at // Set in rounds, this controls when the item is finally removed permanently regardless if cleaned or not.
var/entries_decay_at // Set in rounds. This controls when item messages start getting scrambled.
var/entry_decay_weight = 0.5
var/file_entry_split_character = "\t"
var/file_entry_substitute_character = " "
+2 -1
View File
@@ -27,7 +27,8 @@
random_icon_states.Remove(W.icon_state)
if(random_icon_states.len)
icon_state = pick(random_icon_states)
SSpersistence.track_value(src, /datum/persistent/graffiti)
if(!mapload || !config.persistence_ignore_mapload)
SSpersistence.track_value(src, /datum/persistent/graffiti)
. = ..()
/obj/effect/decal/writing/Destroy()