ludic.things: a Thing's dawn (the last day a restock reached it, saved); things_restock takes the day; things_catch_up restocks a chunk's Things that missed a dawn once a morning would reach them, as that morning would have

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 21:14:42 +03:00
parent 0634116d59
commit b053bf625c
7 changed files with 57 additions and 8 deletions

View file

@ -31,6 +31,7 @@ function th_to_json(t: Thing) -> Val {
sv_put_float(o, "syaw", t.syaw)
sv_put_int(o, "seat", t.seat)
sv_put_int(o, "seats", t.seats)
sv_put_int(o, "dawn", t.dawn)
return o
}
@ -61,6 +62,7 @@ function th_from_json(things_st: mut ThingsState, o: Val) -> void {
t.syaw = sv_float(o, "syaw", 0.0)
t.seat = sv_int(o, "seat", -1)
t.seats = sv_int(o, "seats", 0)
t.dawn = sv_int(o, "dawn", 0)
let x = sv_float(o, "x", 0.0)
let z = sv_float(o, "z", 0.0)
let y = sv_float(o, "y", ThingsWorld.ground(x, z))