Item to reset items that are stuck in walls are mission start.

This commit is contained in:
Steve 2018-04-28 15:55:01 +01:00
parent 47ae458edd
commit 01448698ad
2 changed files with 9 additions and 2 deletions

View File

@ -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)

View File

@ -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;
}