surrsurus / edgequest

Edgequest Season Two
Mozilla Public License 2.0
8 stars 1 forks source link

Fix common list-index-out-of-range crash #40

Closed sudo-prime closed 6 years ago

sudo-prime commented 6 years ago

Describe the bug During normal game play (about 10 or so seconds from launching the game), taking a turn will cause the game to crash for the following error: thread 'main' panicked at 'index out of bounds: the len is 100 but the index is 18446744073709551615', C:\projects\rust\src\libcore\slice\mod.rs:865:10

To Reproduce This bug is easy to reproduce, but occurs for an unknown reason. Walk around in-game. That's it. It'll happen eventually.

Expected behavior Edgequest should not crash for index-out-of-range reasons.

Desktop

surrsurus commented 6 years ago

Turns out the BlinkAI actually didn't do a bounds check when it wasn't blinking, that is to say I was more worried about the AI teleporting out of bounds than I was actually having it just walk out of bounds. Will be closed via commit shortly.