From 3f32bfda7c638dd0e4208ae7379243847f4a2640 Mon Sep 17 00:00:00 2001 From: Orkuncakilkaya Date: Mon, 28 Sep 2026 16:00:18 +0300 Subject: [PATCH] ludic.wildlife: the table a guest draws the host's animals into is made once and emptied per join, not new each time Co-Authored-By: Claude Opus 5.5 --- packages/ludic.wildlife/guest.ludic | 10 +++++++++- packages/ludic.wildlife/species.ludic | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/ludic.wildlife/guest.ludic b/packages/ludic.wildlife/guest.ludic index e1664892..bed127f0 100644 --- a/packages/ludic.wildlife/guest.ludic +++ b/packages/ludic.wildlife/guest.ludic @@ -4,13 +4,21 @@ export function wildlife_put_away(wildlife_st: mut WildlifeState) -> void { if wildlife_st.wl_own != null { return } wildlife_st.wl_own = wildlife_st.wl - wildlife_st.wl = wl__new() + wl__empty(wildlife_st.wl_host) + wildlife_st.wl = wildlife_st.wl_host } export function wildlife_bring_back(wildlife_st: mut WildlifeState) -> void { if wildlife_st.wl_own == null { return } + wildlife_st.wl_host = wildlife_st.wl wildlife_st.wl = wildlife_st.wl_own wildlife_st.wl_own = null } export function wildlife_away(wildlife_st: WildlifeState) -> bool { return wildlife_st.wl_own != null } + +# every animal gone from a table, keeping its rows' room for the next party +function wl__empty(w: WildTable) -> void { + tb_clear(w.tab) + imap_clear(w.nids) +} diff --git a/packages/ludic.wildlife/species.ludic b/packages/ludic.wildlife/species.ludic index c563dfd3..f6abc9de 100644 --- a/packages/ludic.wildlife/species.ludic +++ b/packages/ludic.wildlife/species.ludic @@ -39,6 +39,7 @@ export state WildlifeState { wl_ffree: []WildFact = new []WildFact # of those, the ones free at the last look wl_fnext: []int = words(1) # the next of them to hand out wl_own: WildTable = null # a guest's own animals, put away whole while it draws the host's + wl_host: WildTable = wl__new() # the table the host's are drawn into: made once, cleared per join wl_px: float = 0.0 wl_pz: float = 0.0 wl_ask: WildLure = new WildLure