Out of Bounds `PieSlice` `Direction` property crashes with no Abort
traunts opened this issue · comments
Describe the bug
PieSlice
property Direction
can be created with string reference to enums ("Up"
, "Down
" etc.) or their corresponding enum mapping from here:
/// <summary>
/// Enumeration and supporting maps for cardinal directions, as well as None and Any.
/// </summary>
enum Directions { None = -1, Up, Down, Left, Right, Any };
If a modder provides a direction reference out of this range [-1, 4]
then the reader allows it and the game crashes later when creating the PieSlice
in question.
To Reproduce
Steps to reproduce the behaviour:
- Edit a
PieSlice
ini
declaration to haveDirection = 5
(or any parseable int values outside of the range)
e.g. The Ronin Shovel,L209
. - Launch the game, and create/order a shovel. Game hard crashes.
Expected behaviour
The reader should catch and report invalid input directions at load time.
Additional context
The crash occurs with out-of-bounds .at()
access in PieMenu::AddPieSlice()
at L345
.