Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
fix(gamestate): the game state should now be cloned completely, preve…
Browse files Browse the repository at this point in the history
…nting strange errors from happening.
  • Loading branch information
seiyria committed Dec 1, 2015
1 parent cb830eb commit 351b345
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/js/rogue/init/gameupgrades.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

import _ from 'lodash';

const baseState = {
dungeon: {
itemsInDungeon: 0,
Expand Down Expand Up @@ -44,7 +46,7 @@ const baseState = {
}
};

export const NewState = () => baseState;
export const NewState = () => _.cloneDeep(baseState);

let curState = NewState();

Expand Down

0 comments on commit 351b345

Please sign in to comment.