ludic.inventory: a change's record comes from a ring made once (512), not new per change
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
21b828fe5c
commit
665b689410
2 changed files with 10 additions and 1 deletions
|
|
@ -3,7 +3,11 @@ function iv_change(inventory_st: mut InventoryState, it: int, after: int) -> voi
|
|||
let before = inventory_st.iv_counts[it]
|
||||
if before == after { return }
|
||||
inventory_st.iv_counts[it] = after
|
||||
let c = new ItemChanged
|
||||
var c: ItemChanged = null
|
||||
if len(inventory_st.iv_pool) > 0 {
|
||||
c = inventory_st.iv_pool[inventory_st.iv_at]
|
||||
inventory_st.iv_at = (inventory_st.iv_at + 1) % len(inventory_st.iv_pool)
|
||||
} else { c = new ItemChanged }
|
||||
c.item = it
|
||||
c.before = before
|
||||
c.after = after
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue