Save adventure location with team and inventory

This commit is contained in:
LyokoAgents committed 2026-10-28 23:59:14 +00:00
1 parent 1141765231
commit 59c44c2b45
16 files changed
+444 -203

No files matched your search

+9 -13
View File
@@ -12,14 +12,12 @@ void check_progress(void)
load_progress();
assert_empty_progress();
save_from_menu();
const unsigned char empty[] = {'F','Q','S','P',5,0,0,0,255,255,255,255,255,0x5f,0x5a};
const unsigned char empty[] = {'F','Q','S','P',6,0,0,0,255,255,255,255,255,0,0,108,103,0xde,0x32};
assert(memcmp(test_save, empty, sizeof(empty)) == 0);
partner_owned = balls_given = 1;
ball_count = 5;
save_from_menu();
const unsigned char gifts[] = {'F','Q','S','P',5,3,5,0,255,255,255,255,255,0x59,0x5a};
assert(memcmp(test_save, gifts, sizeof(gifts)) == 0);
/* An unsaved expanded team and rod roll back to the previous v5 snapshot. */
/* An unsaved expanded team and rod roll back to the previous snapshot. */
rod_owned = 1;
caught_count = active_member = 1;
caught_species[0] = TIDEFIN;
@@ -32,8 +30,6 @@ void check_progress(void)
caught_species[1] = TIDEFIN;
ball_count = 3;
save_from_menu();
const unsigned char team[] = {'F','Q','S','P',5,0x17,3,2,1,4,255,255,255,0x4c,0x5a};
assert(memcmp(test_save, team, sizeof(team)) == 0);
unsigned char saved[sizeof(test_save)];
memcpy(saved, test_save, sizeof(saved));
partner_owned = balls_given = rod_owned = caught_count = active_member = ball_count = 0;
@@ -58,17 +54,17 @@ void check_progress(void)
int state[] = {partner_owned, balls_given, rod_owned, ball_count, caught_count, active_member};
unsigned char kinds[CAUGHT_CAPACITY];
memcpy(kinds, caught_species, sizeof(kinds));
assert(!save_menu_input(0, 1));
assert(save_menu_input(START, 1));
assert(!save_menu_input(0, 1));
assert(save_menu_input(A, 1) && save_menu.phase == SAVE_MENU_FAILED);
assert(!menu_input(0, 1));
assert(menu_input(START, 1));
assert(!menu_input(0, 1));
assert(menu_input(A, 1) && save_menu.phase == SAVE_MENU_FAILED);
int after[] = {partner_owned, balls_given, rod_owned, ball_count, caught_count, active_member};
assert(memcmp(state, after, sizeof(state)) == 0);
assert(memcmp(kinds, caught_species, sizeof(kinds)) == 0);
assert(memcmp(saved, test_save, sizeof(saved)) == 0);
assert(!save_menu_input(A, 1));
assert(!save_menu_input(0, 1));
assert(save_menu_input(B, 1));
assert(!menu_input(A, 1));
assert(!menu_input(0, 1));
assert(menu_input(B, 1));
}
load_progress();
partner_owned = 2; balls_given = 7; rod_owned = -1;