mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-23 20:17:15 +01:00
Merge branch 'master' into upstream-merge-8298
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
return
|
||||
|
||||
var/_z = token["z"]
|
||||
if(_z in using_map.station_levels)
|
||||
if(_z in using_map.persist_levels)
|
||||
. = GetValidTurf(locate(token["x"], token["y"], _z), token)
|
||||
if(.)
|
||||
CreateEntryInstance(., token)
|
||||
@@ -82,7 +82,7 @@
|
||||
if(GetEntryAge(entry) >= entries_expire_at)
|
||||
return FALSE
|
||||
var/turf/T = get_turf(entry)
|
||||
if(!T || !(T.z in using_map.station_levels) )
|
||||
if(!T || !(T.z in using_map.persist_levels) )
|
||||
return FALSE
|
||||
var/area/A = get_area(T)
|
||||
if(!A || (A.flags & AREA_FLAG_IS_NOT_PERSISTENT))
|
||||
@@ -104,7 +104,7 @@
|
||||
/datum/persistent/proc/Shutdown()
|
||||
if(fexists(filename))
|
||||
fdel(filename)
|
||||
|
||||
|
||||
var/list/to_store = list()
|
||||
for(var/thing in SSpersistence.tracking_values[type])
|
||||
if(!IsValidEntry(thing))
|
||||
@@ -121,10 +121,10 @@
|
||||
var/list/my_tracks = SSpersistence.tracking_values[type]
|
||||
if(!my_tracks?.len)
|
||||
return
|
||||
|
||||
|
||||
. = list("<tr><td colspan = 4><b>[capitalize(name)]</b></td></tr>")
|
||||
. += "<tr><td colspan = 4><hr></td></tr>"
|
||||
|
||||
|
||||
for(var/thing in my_tracks)
|
||||
. += "<tr>[GetAdminDataStringFor(thing, can_modify, user)]</tr>"
|
||||
. += "<tr><td colspan = 4><hr></td></tr>"
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
/datum/persistent/filth/trash/CheckTurfContents(var/turf/T, var/list/tokens)
|
||||
var/too_much_trash = 0
|
||||
for(var/obj/item/trash/trash in T)
|
||||
//VOREStation Addition Start
|
||||
if(istype(T, /obj/item/trash/spitwad) || istype(T, /obj/item/trash/spitgum))
|
||||
return FALSE
|
||||
//VOREStation Addition End
|
||||
too_much_trash++
|
||||
if(too_much_trash >= 5)
|
||||
return FALSE
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/datum/persistent/paintings
|
||||
name = "paintings"
|
||||
entries_expire_at = 1000 // Basically forever
|
||||
//entries_expire_at = 1000 // Basically forever
|
||||
var/max_entries = 1000 //1000 paintings is a lot, and will take a long time to cycle through.
|
||||
|
||||
/datum/persistent/paintings/SetFilename()
|
||||
filename = "data/persistent/paintings.json"
|
||||
@@ -14,7 +15,7 @@
|
||||
token["age"]++ // Increment age!
|
||||
if(!CheckTokenSanity(token))
|
||||
tokens -= token
|
||||
|
||||
|
||||
SSpersistence.unpicked_paintings = SSpersistence.all_paintings.Copy()
|
||||
|
||||
for(var/obj/structure/sign/painting/P in SSpersistence.painting_frames)
|
||||
@@ -24,14 +25,29 @@
|
||||
var/png_filename = "data/paintings/[token["persistence_id"]]/[token["md5"]].png"
|
||||
if(!fexists(png_filename))
|
||||
return FALSE
|
||||
if(token["age"] > entries_expire_at)
|
||||
fdel(png_filename)
|
||||
return FALSE
|
||||
// if(token["age"] > entries_expire_at)
|
||||
// fdel(png_filename)
|
||||
// return FALSE
|
||||
|
||||
/datum/persistent/paintings/Shutdown()
|
||||
for(var/obj/structure/sign/painting/P in SSpersistence.painting_frames)
|
||||
P.save_persistent()
|
||||
|
||||
if(SSpersistence.all_paintings.len > max_entries)
|
||||
var/this_many = SSpersistence.all_paintings.len
|
||||
var/over = this_many - max_entries
|
||||
log_admin("There are [over] more painting(s) stored than the maximum allowed.")
|
||||
while(over > 0)
|
||||
var/list/d = SSpersistence.all_paintings[1]
|
||||
var/png_filename = "data/paintings/[d["persistence_id"]]/[d["md5"]].png"
|
||||
fdel(png_filename)
|
||||
if(SSpersistence.all_paintings.Remove(list(d)))
|
||||
log_admin("A painting was deleted")
|
||||
else
|
||||
log_and_message_admins("Attempted to delete a painting, but failed.")
|
||||
over --
|
||||
|
||||
|
||||
if(fexists(filename))
|
||||
fdel(filename)
|
||||
to_file(file(filename), json_encode(SSpersistence.all_paintings))
|
||||
to_file(file(filename), json_encode(SSpersistence.all_paintings))
|
||||
@@ -52,11 +52,11 @@
|
||||
// Delete some stacks if we want
|
||||
if(stacks_go_missing)
|
||||
var/fuzzy = rand(55,65)*0.01 // loss of 35-45% with rounding down
|
||||
count = round(count*fuzzy)
|
||||
count = round(count*fuzzy)
|
||||
if(count <= 0)
|
||||
continue
|
||||
|
||||
while(count > 0)
|
||||
|
||||
while(count > 0)
|
||||
inst = new real_path(null, min(count, max_amount))
|
||||
count -= inst.get_amount()
|
||||
. += inst
|
||||
@@ -72,6 +72,16 @@
|
||||
name = "fruit storage lossy"
|
||||
go_missing_chance = 12.5 // 10% loss between rounds
|
||||
|
||||
/datum/persistent/storage/smartfridge/produce/generate_items(var/list/L) // Mostly same as storage/generate_items() but without converting string to path
|
||||
. = list()
|
||||
for(var/fruit_type in L)
|
||||
for(var/i in 1 to L[fruit_type])
|
||||
if(prob(go_missing_chance))
|
||||
continue
|
||||
var/atom/A = create_item(fruit_type)
|
||||
if(!QDELETED(A))
|
||||
. += A
|
||||
|
||||
/datum/persistent/storage/smartfridge/produce/create_item(var/seedtype)
|
||||
return new /obj/item/weapon/reagent_containers/food/snacks/grown(null, seedtype) // Smartfridge will be stock()ed with it, loc is unimportant
|
||||
|
||||
|
||||
Reference in New Issue
Block a user