Delete your own board messages; drop chips name their item

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-19 09:56:11 +01:00
parent 70246f78ea
commit 2eed9b7ec4
4 changed files with 28 additions and 4 deletions

View file

@ -496,7 +496,7 @@ RAID_TRAITS = ["lightly armoured, heavy on archers", "mounted and fast, few bows
# --- world ---------------------------------------------------------------
WORLD_VERSION = 8
WORLD_VERSION = 9
def new_world(now: float, speed: float = 1.0) -> dict:
@ -528,6 +528,7 @@ def new_world(now: float, speed: float = 1.0) -> dict:
"next_event_id": 1,
"ledger": [],
"board": [],
"next_message_id": 1,
}
@ -592,6 +593,12 @@ def migrate(world: dict, now: float | None = None) -> dict:
world.setdefault("next_hardship_at", now + 24 * HOUR / speed(world))
world.setdefault("next_fortune_at", now + 8 * HOUR / speed(world))
world["version"] = 8
if world["version"] < 9:
# Board messages get ids so their authors can delete them.
for number, message in enumerate(world["board"], 1):
message["id"] = number
world["next_message_id"] = len(world["board"]) + 1
world["version"] = 9
return world