From 8b3c805bc0a83c5551bd4d05595e516a19257af3 Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 29 Apr 2021 23:16:31 -0700 Subject: [PATCH] Fix Super Gravitron pattern oversight There is a pattern in the Super Gravitron that is meant to "staircase", similar to the Gravitron in Intermission 2. Something like: [] [] [] [] [] [] [] Unfortunately, due to an oversight, this pattern can only ever produce 1 square or 4 squares, which look out of place. Both gravitrons are state machines (of course). States 20 and 21 in the Super Gravitron are this staircase pattern (state 20 spawns the squares on the left, state 21 spawns the squares on the right). The only way states 20 and 21 can be reached is through state 1, and the only way state 1 can be reached is through state 3. The only way state 3 can be reached is through states 28, 29, 30, and 31. In states 20 and 21, the variable used to keep track of the amount of squares spawned is swnstate4. However, states 28, 29, 30, and 31 all end up using swnstate4, and at the end of states 28 and 29, swnstate4 will be 7, and at the end of states 30 and 31, swnstate4 will be 3. This means if we go to states 20 and 21 after coming from states 28 and 29, we will only get 1 square, and if we go to states 20 and 21 after coming from states 30 and 31, we will only get 4 squares. This can be clearly filed under a failure to reset appropriate state. What's the solution here? Just reset swnstate4 in state 3, so there will be 7 squares, as intended. This also fixes the bug for state 22 as well, which is affected in the same manner. --- desktop_version/src/Entity.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index aabec8a8..c7cb1fc7 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -418,6 +418,7 @@ void entityclass::generateswnwave( int t ) case 3: //Choose a major action game.swnstate2 = int(fRandom() * 100); + game.swnstate4 = 0; if (game.swnstate2 < 25) { //complex