Item to reset items that are stuck in walls are mission start.
This commit is contained in:
parent
47ae458edd
commit
01448698ad
|
@ -86,8 +86,8 @@ static void reset(void)
|
|||
|
||||
i = (Item*)self;
|
||||
|
||||
i->startX = (int) self->x;
|
||||
i->startY = (int) self->y;
|
||||
self->x = i->startX;
|
||||
self->y = i->startY;
|
||||
}
|
||||
|
||||
static void tick(void)
|
||||
|
|
|
@ -472,6 +472,13 @@ static void checkStuckInWall(void)
|
|||
if (hasHitWorld(mx, my))
|
||||
{
|
||||
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "%s (%d): in wall at %d,%d", self->name, self->type, mx, my);
|
||||
|
||||
if (self->type == ET_KEY || self->type == ET_ITEM)
|
||||
{
|
||||
SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_WARN, "Attempting to reset stuck item");
|
||||
|
||||
self->reset();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue