Skip to content

Commit

Permalink
KOTOR: Stop PC and camera movement when opening containers
Browse files Browse the repository at this point in the history
  • Loading branch information
vkremianskii committed May 26, 2018
1 parent a7dfe64 commit 3205691
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/engines/kotor/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,12 @@ void Module::clickObject(Object *object) {
Placeable *placeable = ObjectContainer::toPlaceable(object);
if (placeable) {
if (placeable->hasInventory()) {
stopCameraMovement();
stopPCMovement();

_ingame->showContainer();
placeable->close(_pc.get());
_prevTimestamp = EventMan.getTimestamp();
}
}
}
Expand Down Expand Up @@ -803,15 +807,26 @@ void Module::startConversation(const Common::UString &name) {
_dialog->startConversation(name);

if (_dialog->isConversationActive()) {
_forwardBtnPressed = false;
_backwardsBtnPressed = false;
SatelliteCam.clearInput();
stopCameraMovement();
stopPCMovement();

_ingame->hide();
_dialog->show();
_inDialog = true;
}
}

void Module::stopCameraMovement() {
SatelliteCam.clearInput();
}

void Module::stopPCMovement() {
_forwardBtnPressed = false;
_backwardsBtnPressed = false;
_pc->getModel()->playDefaultAnimation();
_pcRunning = false;
}

} // End of namespace KotOR

} // End of namespace Engines
3 changes: 3 additions & 0 deletions src/engines/kotor/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ class Module : public KotOR::Object, public KotOR::ObjectContainer {

void handleActions();
void handlePCMovement();

void stopCameraMovement();
void stopPCMovement();
};

} // End of namespace KotOR
Expand Down

0 comments on commit 3205691

Please sign in to comment.