mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 04:22:39 +01:00
Persistence code refactoring (#22044)
# Summary This PR refactores code and structure of the current persistence subsystem, in preparation for Persistency: Circles, Squares and Triangles. This should not contain any user facing changes. ~~This PR is based of branch #21925 and **needs** to be merged in order. The files changed display will be meaningless until then.~~ *Done.* ## Changes - Split subsystem in partial files. - Refactored proc names, added "persistentObject" format for current code. - Renamed SQL table. - Refactored logging and call hiearachy. - Fix CI labeler adding DB label on non-SQL files.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
/obj/item/trash/attack(mob/living/target_mob, mob/living/user, target_zone)
|
||||
return
|
||||
|
||||
/obj/item/trash/persistence_get_content()
|
||||
/obj/item/trash/persistent_objects_get_content()
|
||||
var/list/content = list()
|
||||
content["name"] = name
|
||||
content["desc"] = desc
|
||||
@@ -26,7 +26,7 @@
|
||||
content["pickup_sound"] = pickup_sound
|
||||
return content
|
||||
|
||||
/obj/item/trash/persistence_apply_content(content, x, y, z)
|
||||
/obj/item/trash/persistent_objects_apply_content(content, x, y, z)
|
||||
name = content["name"]
|
||||
desc = content["desc"]
|
||||
icon = file(content["icon"])
|
||||
|
||||
@@ -11,19 +11,19 @@
|
||||
|
||||
/obj/item/material/ashtray/Initialize(newloc, material_key)
|
||||
. = ..()
|
||||
persistance_expiration_time_days = rand(7, 180) // Imagine they get stolen, lost or break...
|
||||
persistant_objects_expiration_time_days = rand(7, 180) // Imagine they get stolen, lost or break...
|
||||
max_butts = round(material.hardness/10) //This is arbitrary but whatever.
|
||||
randpixel_xy()
|
||||
update_icon()
|
||||
SSpersistence.register_track(src, null)
|
||||
SSpersistence.objectsRegisterTrack(src, null)
|
||||
|
||||
/obj/item/material/ashtray/persistence_get_content()
|
||||
/obj/item/material/ashtray/persistent_objects_get_content()
|
||||
var/list/content = list()
|
||||
content["fill_count"] = length(contents)
|
||||
content["material"] = material.name
|
||||
return content
|
||||
|
||||
/obj/item/material/ashtray/persistence_apply_content(content, x, y, z)
|
||||
/obj/item/material/ashtray/persistent_objects_apply_content(content, x, y, z)
|
||||
src.x = x
|
||||
src.y = y
|
||||
src.z = z
|
||||
@@ -89,7 +89,7 @@
|
||||
attacking_item.forceMove(src)
|
||||
|
||||
if(istype(attacking_item, /obj/item/trash/cigbutt))
|
||||
SSpersistence.deregister_track(attacking_item) // Ashtray will handle the persistent contents in it itself
|
||||
SSpersistence.objectsDeregisterTrack(attacking_item) // Ashtray will handle the persistent contents in it itself
|
||||
|
||||
if (istype(attacking_item,/obj/item/clothing/mask/smokable/cigarette))
|
||||
var/obj/item/clothing/mask/smokable/cigarette/cig = attacking_item
|
||||
|
||||
Reference in New Issue
Block a user