Merge pull request #16415 from Kashargul/merge-some-vR

merges filth files
This commit is contained in:
Heroman3003
2024-10-04 06:47:32 +10:00
committed by GitHub
3 changed files with 16 additions and 27 deletions
+16 -3
View File
@@ -9,7 +9,7 @@
/datum/persistent/filth/CheckTokenSanity(var/list/token)
// byond's json implementation is "questionable", and uses types as keys and values without quotes sometimes even though they aren't valid json
token["path"] = istext(token["path"]) ? text2path(token["path"]) : token["path"]
return ..() && ispath(token["path"])
return ..() && ispath(token["path"]) && (!saves_dirt || isnum(token["dirt"]))
/datum/persistent/filth/CheckTurfContents(var/turf/T, var/list/token)
var/_path = token["path"]
@@ -17,16 +17,29 @@
/datum/persistent/filth/CreateEntryInstance(var/turf/creating, var/list/token)
var/_path = token["path"]
new _path(creating, token["age"]+1)
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/GetEntryAge(var/atom/entry)
var/obj/effect/decal/cleanable/filth = entry
return filth.age
/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/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)
. = ..()
LAZYADDASSOC(., "path", "[GetEntryPath(entry)]")
LAZYADDASSOC(., "path", "[GetEntryPath(entry)]")
if (saves_dirt)
LAZYADDASSOC(., "dirt", GetEntryDirt(entry))
@@ -1,23 +0,0 @@
/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))
-1
View File
@@ -3605,7 +3605,6 @@
#include "code\modules\persistence\serialize.dm"
#include "code\modules\persistence\datum\persistence_datum.dm"
#include "code\modules\persistence\effects\filth.dm"
#include "code\modules\persistence\effects\filth_vr.dm"
#include "code\modules\persistence\effects\graffiti.dm"
#include "code\modules\persistence\effects\paper.dm"
#include "code\modules\persistence\effects\paper_sticky.dm"