Move carried item around with unit.

This commit is contained in:
Steve 2018-03-07 21:37:31 +00:00
parent 36b5265b08
commit 9270607d6e
1 changed files with 7 additions and 6 deletions

View File

@ -80,11 +80,6 @@ static void init(void)
u->startX = (int) u->x; u->startX = (int) u->x;
u->startY = (int) u->y; u->startY = (int) u->y;
} }
if (u->isMissionTarget)
{
u->flags |= EF_BOMB_SHIELD;
}
} }
static void tick(void) static void tick(void)
@ -128,7 +123,7 @@ static void tick(void)
if (u->spawnedIn) if (u->spawnedIn)
{ {
if (getDistance(u->x, u->y, world.bob->x, world.bob->y) < 1000) if (getDistance(u->x, u->y, world.bob->x, world.bob->y) < SCREEN_WIDTH)
{ {
u->spawnedInTimer = FPS * 5; u->spawnedInTimer = FPS * 5;
} }
@ -138,6 +133,12 @@ static void tick(void)
u->alive = ALIVE_DEAD; u->alive = ALIVE_DEAD;
} }
} }
if (u->carriedItem != NULL)
{
u->carriedItem->x = u->carriedItem->startX = u->x;
u->carriedItem->y = u->carriedItem->startY = u->y;
}
} }
static void reappear(void) static void reappear(void)