Commit ce08dcc
committed
fix(lua.endpoint): add nil checks for race condition in
The condition in next_round.lua was accessing G.blind_select_opts
immediately when G.STATE became BLIND_SELECT, but the UI elements
are created asynchronously via Events in update_blind_select().
This caused crashes when loading saves from SHOP state because
G.blind_select_opts wasn't populated yet when the state changed.
Now properly waits for each component to be initialized:
- G.STATE to be BLIND_SELECT
- G.blind_select_opts table to exist
- The specific blind pane (small/big/boss) to exist
- The select button UI element to existnext_round endpoint1 parent 4af3d39 commit ce08dcc
1 file changed
Lines changed: 20 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
36 | 49 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 50 | + | |
| 51 | + | |
41 | 52 | | |
42 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
43 | 57 | | |
44 | 58 | | |
45 | 59 | | |
| |||
0 commit comments