Open jonvaldes opened 7 years ago
At this point in net.c, the variable num_games has never been initialized, and thus contains garbage: https://github.com/DIVGAMES/DIV-Games-Studio/blob/master/src/runtime/net.c#L546
Looking at the next lines suggests the solution would be to turn the if into something like this:
if (num_games=_net_get_games(game_id)) {
However, if we do that then the next if would never be executed?
Another option would be to initialize the variable to 0, 1, or whatever a sensible default value is.
The netplay code is probably one of the weakest parts of DIV. it only ever worked with IPX, and that was always a bit fickle.
The current version using SDL_Net is also fairly poor, but sort of works.
At this point in net.c, the variable num_games has never been initialized, and thus contains garbage: https://github.com/DIVGAMES/DIV-Games-Studio/blob/master/src/runtime/net.c#L546
Looking at the next lines suggests the solution would be to turn the if into something like this:
However, if we do that then the next if would never be executed?
Another option would be to initialize the variable to 0, 1, or whatever a sensible default value is.