mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Persistence Patch
- 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.
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
var/spam_flag = 0
|
||||
var/age = 0
|
||||
var/last_modified_ckey
|
||||
|
||||
var/was_maploaded = FALSE // This tracks if the paper was created on mapload.
|
||||
|
||||
var/const/deffont = "Verdana"
|
||||
var/const/signfont = "Times New Roman"
|
||||
@@ -103,6 +105,12 @@
|
||||
|
||||
//lipstick wiping is in code/game/objects/items/weapons/cosmetics.dm!
|
||||
|
||||
/obj/item/weapon/paper/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
if(mapload) // Jank, but we do this to prevent maploaded papers from somehow stacking across rounds if re-added to the board by a player.
|
||||
was_maploaded = TRUE
|
||||
|
||||
/obj/item/weapon/paper/New(var/newloc, var/text, var/title)
|
||||
..()
|
||||
pixel_y = rand(-8, 8)
|
||||
@@ -463,6 +471,7 @@
|
||||
//t = html_encode(t)
|
||||
t = replacetext(t, "\n", "<BR>")
|
||||
t = parsepencode(t, i, usr, iscrayon) // Encode everything from pencode to html
|
||||
was_maploaded = FALSE // Set this to FALSE because a user has written on us. This is for persistence purposes.
|
||||
|
||||
|
||||
if(fields > 50)//large amount of fields creates a heavy load on the server, see updateinfolinks() and addtofield()
|
||||
|
||||
Reference in New Issue
Block a user