NULL check against player, when getting camera position.

This commit is contained in:
Steve 2015-11-01 16:11:56 +00:00
parent 9debf3be56
commit ee05399652
1 changed files with 5 additions and 2 deletions

View File

@ -157,8 +157,11 @@ static void draw(void)
{ {
prepareScene(); prepareScene();
battle.camera.x = player->x - (SCREEN_WIDTH / 2); if (player != NULL)
battle.camera.y = player->y - (SCREEN_HEIGHT / 2); {
battle.camera.x = player->x - (SCREEN_WIDTH / 2);
battle.camera.y = player->y - (SCREEN_HEIGHT / 2);
}
drawBackground(battle.background); drawBackground(battle.background);