Skip to content

fix: bind row id collision between spells and spell_projectiles#965

Closed
HarleyGilpin wants to merge 1 commit intoGregHib:mainfrom
HarleyGilpin:fixes/spell_projectiles-`bind`-row-id-collision-in-clone
Closed

fix: bind row id collision between spells and spell_projectiles#965
HarleyGilpin wants to merge 1 commit intoGregHib:mainfrom
HarleyGilpin:fixes/spell_projectiles-`bind`-row-id-collision-in-clone

Conversation

@HarleyGilpin
Copy link
Copy Markdown
Contributor

fix: bind row id collision between spells and spell_projectiles

Bug

After #964, both tables declare a [.bind] row:

File Columns
spell_projectiles.tables.toml 4
spells.tables.toml 17

clone = "bind" in spells matches by rowId only. spell_projectiles loads first, so the 4-column projectile row gets cloned into the 17-column spell row, throwing ArrayIndexOutOfBoundsException at clone[4]. This crashes Main.preload via Koin.

Fix

Rename the projectile row to bind_projectile and update its one reference.

 # spell_projectiles.tables.toml
-[.bind]
+[.bind_projectile]
 # spells.tables.toml
-projectiles = ["spell_projectiles.bind"]
+projectiles = ["spell_projectiles.bind_projectile"]

Note

[.ice_barrage] also collides but isn't cloned, so it's harmless for now.

…spells.bind

Tables.readTableRow resolves clone = "..." by trailing rowId only, so the
spell_projectiles.bind (4 cols) and spells.bind (17 cols) rows from GregHib#964
collided. The 4-column row was returned for [.snare]/[.entangle] clones in
spells, throwing ArrayIndexOutOfBoundsException at boot before the Koin
graph could finish.

Renamed the projectile row to bind_projectile and updated the one self-
reference in spells.bind.projectiles. No engine change — Tables.kt and the
rest of GregHib#964's refactor are byte-identical to upstream.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HarleyGilpin HarleyGilpin force-pushed the fixes/spell_projectiles-`bind`-row-id-collision-in-clone branch from 73e6aaf to a8e0faa Compare April 29, 2026 17:21
@GregHib
Copy link
Copy Markdown
Owner

GregHib commented Apr 29, 2026

Not sure I follow this one, projectiles is using list<row> not clone, so cloning bind means that only a list is copied.
Loading order of spell_projectiles therefore also doesn't matter.

I'm unable to replicate the error on load nor when using bind or other spells

@HarleyGilpin
Copy link
Copy Markdown
Contributor Author

Root cause was actually due to using Linux FS. I suspect that is why you could not replicate the issue on your box. I am opening a new PR because this PR won't fix the underlying issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants