mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 11:06:44 +01:00
attempt to fix uninitialized level number happening sometimes...
This commit is contained in:
parent
bad5c07f7f
commit
44c5c06ff4
1 changed files with 1 additions and 1 deletions
|
@ -64,6 +64,7 @@ int Map_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||||
if (game->fx) al_play_sample(game->map.click_sample, 1.0, 0.0, 1.0, ALLEGRO_PLAYMODE_ONCE, NULL);
|
if (game->fx) al_play_sample(game->map.click_sample, 1.0, 0.0, 1.0, ALLEGRO_PLAYMODE_ONCE, NULL);
|
||||||
} else if (ev->keyboard.keycode==ALLEGRO_KEY_ENTER) {
|
} else if (ev->keyboard.keycode==ALLEGRO_KEY_ENTER) {
|
||||||
if (game->fx) al_play_sample(game->map.click_sample, 1.0, 0.0, 1.0, ALLEGRO_PLAYMODE_ONCE, NULL);
|
if (game->fx) al_play_sample(game->map.click_sample, 1.0, 0.0, 1.0, ALLEGRO_PLAYMODE_ONCE, NULL);
|
||||||
|
game->level.current_level = game->map.selected;
|
||||||
PrintConsole(game, "Selecting level %d...", game->map.selected);
|
PrintConsole(game, "Selecting level %d...", game->map.selected);
|
||||||
UnloadGameState(game);
|
UnloadGameState(game);
|
||||||
game->gamestate = GAMESTATE_LOADING;
|
game->gamestate = GAMESTATE_LOADING;
|
||||||
|
@ -128,7 +129,6 @@ void Map_Preload(struct Game *game) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Map_Unload(struct Game *game) {
|
void Map_Unload(struct Game *game) {
|
||||||
game->level.current_level = game->map.selected;
|
|
||||||
ALLEGRO_EVENT ev;
|
ALLEGRO_EVENT ev;
|
||||||
int fadeloop;
|
int fadeloop;
|
||||||
for(fadeloop=255; fadeloop>=0; fadeloop-=tps(game, 600)){
|
for(fadeloop=255; fadeloop>=0; fadeloop-=tps(game, 600)){
|
||||||
|
|
Loading…
Reference in a new issue