Fixed creative.lua invalidating iterator in loop #4354
No reviewers
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#4354
Loading…
Reference in New Issue
No description provided.
Delete Branch "it_inval_fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Alternative to #4341 (fixes #4339).
Background
Somehow, call to
tt.reload_itemstack_description()
invalidates iterators tominetest.registered_items
, which are used internally bypairs()
in thefor
loop in creative.lua which fills the creative inventory with items. While I haven't managed to pinpoint where exactly the aforementioned function invalidates the iterators, abstracting the calls into another loop running through the already picked inventory lists (which doesn't rely on iterators tominetest.registered_items
) fixes the issue.Testing
See the referenced issue and PR.
Looks good to me.