Skip to content

Commit

Permalink
save/bson: allow land and water animal exchanges
Browse files Browse the repository at this point in the history
Resolves #441
  • Loading branch information
rr- committed Feb 18, 2022
1 parent c768a68 commit 1cf555e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## [Unreleased](https://github.com/rr-/Tomb1Main/compare/2.6.2...master)
- ...
- fixed croc and rats breaking saves after a flipmap (#441, regression from 2.6)

## [2.6.2](https://github.com/rr-/Tomb1Main/compare/2.6.1...2.6.2) - 2022-02-17
- fixed equipping gun after starting a demo (#440, regression from 2.6)
Expand Down
7 changes: 7 additions & 0 deletions src/game/savegame_bson.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,21 @@ static bool Savegame_BSON_IsValidItemObject(

// clang-format off
switch (saved_obj_num) {
// used keyholes
case O_PUZZLE_DONE1: return initial_obj_num == O_PUZZLE_HOLE1;
case O_PUZZLE_DONE2: return initial_obj_num == O_PUZZLE_HOLE2;
case O_PUZZLE_DONE3: return initial_obj_num == O_PUZZLE_HOLE3;
case O_PUZZLE_DONE4: return initial_obj_num == O_PUZZLE_HOLE4;
// pickups
case O_GUN_AMMO_ITEM: return initial_obj_num == O_PISTOLS;
case O_SG_AMMO_ITEM: return initial_obj_num == O_SHOTGUN_ITEM;
case O_MAG_AMMO_ITEM: return initial_obj_num == O_MAGNUM_ITEM;
case O_UZI_AMMO_ITEM: return initial_obj_num == O_UZI_ITEM;
// dual-state animals
case O_ALLIGATOR: return initial_obj_num == O_CROCODILE;
case O_CROCODILE: return initial_obj_num == O_ALLIGATOR;
case O_RAT: return initial_obj_num == O_VOLE;
case O_VOLE: return initial_obj_num == O_RAT;
}
// clang-format on

Expand Down

0 comments on commit 1cf555e

Please sign in to comment.