Skip to content

Commit

Permalink
Bugfix: game loading shop data now read correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael R. Cook committed Nov 6, 2017
1 parent c189a39 commit 579ef1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
## HEAD


### Bug Fixes

- Game loading fix where shops data was being read twice, and the second time
resulted in incorrect data. Oops! Broken during save game refactor:
https://github.com/dungeons-of-moria/umoria/commit/ce2c756


## 5.7.6 (2017-11-05)

### Bug Fixes
Expand Down
19 changes: 0 additions & 19 deletions src/save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,25 +834,6 @@ bool loadGame(bool &generate) {

generate = false; // We have restored a cave - no need to generate.

for (auto &store : stores) {
store.turns_left_before_closing = rd_long();
store.insults_counter = rd_short();
store.owner_id = rd_byte();
store.unique_items_counter = rd_byte();
store.good_purchases = rd_short();
store.bad_purchases = rd_short();
if (store.unique_items_counter > STORE_MAX_DISCRETE_ITEMS) {
goto error;
}
for (int j = 0; j < store.unique_items_counter; j++) {
store.inventory[j].cost = rd_long();
rd_item(store.inventory[j].item);
}
}

// read the time that the file was saved
time_saved = rd_long();

if (ferror(fileptr) != 0) {
goto error;
}
Expand Down

0 comments on commit 579ef1a

Please sign in to comment.