sethballantyne / Plexis

A Breakout clone written in C++/CLI using DirectX 8, complete with level editor written in C#.
MIT License
2 stars 0 forks source link

6 figure score caused the game to crash, cos leet. #120

Closed sethballantyne closed 4 years ago

sethballantyne commented 4 years ago

Score was 99980. It's designed to handle scores of <= 5 figures, so it was probably caused by reaching 100,000. Scores probably shouldn't be capped at 5 figures.

[14/05/20 14:11:22] Fatal Error: System.ArgumentOutOfRangeException thrown. Non-negative number required.
Parameter name: count
Stack trace: 
   at System.Text.StringBuilder.Insert(Int32 index, String value, Int32 count)
   at NumericField.Pad(Int32 value) in c:\users\seth\desktop\project ball buster\src\pbb\game\numericfield.h:line 71
   at NumericField.set_Value(Int32 value) in c:\users\seth\desktop\project ball buster\src\pbb\game\numericfield.h:line 152
   at GameLogic.OnCollisionWithPaddle_BonusPointsPowerUp(Object sender, EventArgs args) in c:\users\seth\desktop\project ball buster\src\pbb\game\gamelogic.h:line 780
   at PowerUp.raise_CollisionWithPaddle(Object value0, EventArgs value1) in c:\users\seth\desktop\project ball buster\src\pbb\game\powerup.h:line 151
   at PowerUp.PlayerCollision() in c:\users\seth\desktop\project ball buster\src\pbb\game\powerup.h:line 120
   at GameLogic.UpdatePowerUps() in c:\users\seth\desktop\project ball buster\src\pbb\game\gamelogic.h:line 604
   at GameLogic.Update(Keys keyboardState, Mouse mouseState) in c:\users\seth\desktop\project ball buster\src\pbb\game\gamelogic.cpp:line 287
   at GameView.Update(Keys keyboardState, Mouse mouseState) in c:\users\seth\desktop\project ball buster\src\pbb\game\gameview.h:line 60
   at Scene.Update(Keys keyboardState, Mouse mouseState) in c:\users\seth\desktop\project ball buster\src\pbb\game\scene.cpp:line 47
   at Game.Update() in c:\users\seth\desktop\project ball buster\src\pbb\game\game.cpp:line 243
   at WinMain(HINSTANCE__* hInstance, HINSTANCE__* hPrevInstance, SByte* lpCmdLine, Int32 nCmdShow) in c:\users\seth\desktop\project ball buster\src\pbb\game\main.cpp:line 196

The whole 5 figure limit for scores is BS anyway. If it changes, the highscore table will need to updated.