From e636ec1e53d6441e7659986dc738abbc9e42e84a Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Wed, 4 Mar 2020 21:50:51 +0100 Subject: [PATCH] Don't delete saves from other architectures on death --- src/save.c | 10 +++++++++- src/skill.c | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/save.c b/src/save.c index 0d89163..420cfdd 100644 --- a/src/save.c +++ b/src/save.c @@ -40,7 +40,15 @@ DbQuery MIGRATE_COMMAND = { }; 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 create_table(void) diff --git a/src/skill.c b/src/skill.c index c0f1540..8ceb4a1 100644 --- a/src/skill.c +++ b/src/skill.c @@ -888,10 +888,11 @@ skill_blink(Skill *skill, SkillData *data) // Find collider destination.x += (int) data->direction.x; destination.y += (int) data->direction.y; - RoomSpace *space = &matrix->spaces[destination.x][destination.y]; Position lastAvailableDest = playerStartPos; while (position_in_roommatrix(&destination)) { + RoomSpace *space = &matrix->spaces[destination.x][destination.y]; + if (space->occupied) { break; } @@ -900,10 +901,9 @@ skill_blink(Skill *skill, SkillData *data) lastAvailableDest = destination; } + perform_pickups_for_space(space, player); destination.x += (int) data->direction.x; destination.y += (int) data->direction.y; - space = &matrix->spaces[destination.x][destination.y]; - perform_pickups_for_space(space, player); } destination = lastAvailableDest;