[Bugfix] entity.at() lazy init guard also has gridstate.size()==0 bug #278
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
john/McRogueFace#278
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
UIEntity::at()(entity.at(x, y)) has the samegridstate.size() == 0lazy initialization guard asupdateVisibility(). If the entity was moved to a larger grid without proper gridstate resize, the guard is skipped and the function proceeds to index into the undersized vector.Root Cause
UIEntity.cpp:112-119:Then at line 130:
If
xandyare within the new grid's bounds but the gridstate vector is sized for the old grid, this index can be out of bounds.Reproduction
Fix
Same defense-in-depth as #276 — validate gridstate size against current grid dimensions:
Severity
Medium — defense-in-depth. The primary fix is in the grid transfer methods (#258-#263), but this prevents crashes if those are bypassed.
Related