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 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-28 16:00:18 +03:00
parent 07a6c35470
commit 3f32bfda7c
2 changed files with 10 additions and 1 deletions

View file

@ -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)
}