Skip to content

Commit

Permalink
Fix a camera screw up situation in the Interior Selector
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellLVP committed Oct 30, 2016
1 parent efe6387 commit 3165a81
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions javascript/features/houses/utils/interior_selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ class InteriorSelector {
this.userInterface_ = new InteriorSelectorUI(player, availableMoney, this, interiorList);

this.resolve_ = null;
this.done_ = false;

this.finished_ = new Promise(resolve => {
this.resolve_ = resolve;
this.done_ = true;

}).then(selection => {
this.dispose(); // self-dispose the selector
Expand Down Expand Up @@ -125,6 +128,9 @@ class InteriorSelector {
if (this.interiorListIndex_ !== index)
return; // the player has navigated away from this scene

if (this.done_)
return; // the player has closed the interior selector

// Interpolate the player's camera to a different position to add interactivity.
this.player_.interpolateCamera(
new Vector(...interiorPreview.position[0]), // positionFrom
Expand Down

0 comments on commit 3165a81

Please sign in to comment.