Restore game state if the mission remains in incomplete status.
This commit is contained in:
parent
84c934a1cb
commit
e887e385c7
|
@ -354,7 +354,7 @@ static void draw(void)
|
||||||
case SHOW_NONE:
|
case SHOW_NONE:
|
||||||
if (selectedMission != NULL)
|
if (selectedMission != NULL)
|
||||||
{
|
{
|
||||||
drawMissionInfo();
|
drawMissionInfo();
|
||||||
drawWidgets();
|
drawWidgets();
|
||||||
}
|
}
|
||||||
blitRect(atlasTexture->texture, cursor.x, cursor.y, getCurrentFrame(cursorSpr), 1);
|
blitRect(atlasTexture->texture, cursor.x, cursor.y, getCurrentFrame(cursorSpr), 1);
|
||||||
|
|
|
@ -80,9 +80,13 @@ static void updateMissionStatus(void)
|
||||||
|
|
||||||
if (status != MS_INCOMPLETE)
|
if (status != MS_INCOMPLETE)
|
||||||
{
|
{
|
||||||
saveGame();
|
saveGame();
|
||||||
saveWorld();
|
saveWorld();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
restoreGameState();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void logic(void)
|
static void logic(void)
|
||||||
|
|
|
@ -35,6 +35,7 @@ extern float limit(float i, float low, float high);
|
||||||
extern void playSound(int snd, int ch);
|
extern void playSound(int snd, int ch);
|
||||||
extern int isAcceptControl(void);
|
extern int isAcceptControl(void);
|
||||||
extern void clearControls(void);
|
extern void clearControls(void);
|
||||||
|
extern void restoreGameState(void);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Colors colors;
|
extern Colors colors;
|
||||||
|
|
|
@ -54,8 +54,6 @@ void initAtlasTest(void)
|
||||||
case 3:
|
case 3:
|
||||||
STRNCPY(game.worldId, "beachFront1", MAX_NAME_LENGTH);
|
STRNCPY(game.worldId, "beachFront1", MAX_NAME_LENGTH);
|
||||||
initWorld();
|
initWorld();
|
||||||
stopMusic();
|
|
||||||
initPostMission();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ void doHud(void)
|
||||||
{
|
{
|
||||||
if (--messageTime <= 0)
|
if (--messageTime <= 0)
|
||||||
{
|
{
|
||||||
messageType = MSG_STANDARD;
|
messageType = MSG_STANDARD;
|
||||||
messageTime = 0;
|
messageTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -259,7 +259,7 @@ static void startMission(void)
|
||||||
world.state = WS_IN_PROGRESS;
|
world.state = WS_IN_PROGRESS;
|
||||||
world.betweenTimer = FPS / 2;
|
world.betweenTimer = FPS / 2;
|
||||||
|
|
||||||
r = &self->sprite[self->facing]->frames[self->spriteFrame]->rect;
|
r = &self->sprite[self->facing]->frames[self->spriteFrame]->rect;
|
||||||
self->w = r->w;
|
self->w = r->w;
|
||||||
self->h = r->h;
|
self->h = r->h;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue