NULL check against player, when getting camera position.
This commit is contained in:
parent
9debf3be56
commit
ee05399652
|
@ -157,8 +157,11 @@ static void draw(void)
|
||||||
{
|
{
|
||||||
prepareScene();
|
prepareScene();
|
||||||
|
|
||||||
|
if (player != NULL)
|
||||||
|
{
|
||||||
battle.camera.x = player->x - (SCREEN_WIDTH / 2);
|
battle.camera.x = player->x - (SCREEN_WIDTH / 2);
|
||||||
battle.camera.y = player->y - (SCREEN_HEIGHT / 2);
|
battle.camera.y = player->y - (SCREEN_HEIGHT / 2);
|
||||||
|
}
|
||||||
|
|
||||||
drawBackground(battle.background);
|
drawBackground(battle.background);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue