Don't delete saves from other architectures on death

This commit is contained in:
Linus Probert 2020-03-04 21:50:51 +01:00
parent 417e7d3cc8
commit e636ec1e53
2 changed files with 12 additions and 4 deletions

View File

@ -40,7 +40,15 @@ DbQuery MIGRATE_COMMAND = {
}; };
static static
DbQuery CLEAR_SAVE = { "DELETE FROM saves", NULL, NULL }; DbQuery CLEAR_SAVE = {
"DELETE FROM saves "
#ifdef _WIN32
"WHERE arch = 1",
#else // _WIN32
"WHERE arch = 2",
#endif // _WIN32
NULL,
NULL };
static void static void
create_table(void) create_table(void)

View File

@ -888,10 +888,11 @@ skill_blink(Skill *skill, SkillData *data)
// Find collider // Find collider
destination.x += (int) data->direction.x; destination.x += (int) data->direction.x;
destination.y += (int) data->direction.y; destination.y += (int) data->direction.y;
RoomSpace *space = &matrix->spaces[destination.x][destination.y];
Position lastAvailableDest = playerStartPos; Position lastAvailableDest = playerStartPos;
while (position_in_roommatrix(&destination)) while (position_in_roommatrix(&destination))
{ {
RoomSpace *space = &matrix->spaces[destination.x][destination.y];
if (space->occupied) { if (space->occupied) {
break; break;
} }
@ -900,10 +901,9 @@ skill_blink(Skill *skill, SkillData *data)
lastAvailableDest = destination; lastAvailableDest = destination;
} }
perform_pickups_for_space(space, player);
destination.x += (int) data->direction.x; destination.x += (int) data->direction.x;
destination.y += (int) data->direction.y; destination.y += (int) data->direction.y;
space = &matrix->spaces[destination.x][destination.y];
perform_pickups_for_space(space, player);
} }
destination = lastAvailableDest; destination = lastAvailableDest;