summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-25 02:35:39 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-25 02:35:39 +0300
commite15445f0f8f95f1547798b886b002146d282c006 (patch)
treed29b49d8d7d0c8d997cbd58ce3733dba5c2c5a9a /src/net
parent992f105f78fb0e4c42fcc7941e289a2348a3ccaf (diff)
downloadplus-e15445f0f8f95f1547798b886b002146d282c006.tar.gz
plus-e15445f0f8f95f1547798b886b002146d282c006.tar.bz2
plus-e15445f0f8f95f1547798b886b002146d282c006.tar.xz
plus-e15445f0f8f95f1547798b886b002146d282c006.zip
Save camera mode before speaking with npc and restore after.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tmwa/npchandler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp
index c395eb1b8..eed10ab7c 100644
--- a/src/net/tmwa/npchandler.cpp
+++ b/src/net/tmwa/npchandler.cpp
@@ -131,6 +131,8 @@ void NpcHandler::closeDialog(int npcId)
{
if ((*it).second.dialog)
(*it).second.dialog->close();
+ if ((*it).second.dialog == mDialog)
+ mDialog = nullptr;
mNpcDialogs.erase(it);
}
}
@@ -226,6 +228,7 @@ int NpcHandler::getNpc(Net::MessageIn &msg, bool haveLength)
else
{
mDialog = new NpcDialog(npcId);
+ mDialog->saveCamera();
if (player_node)
player_node->stopWalking(false);
Wrapper wrap;
@@ -235,7 +238,11 @@ int NpcHandler::getNpc(Net::MessageIn &msg, bool haveLength)
}
else
{
+ if (mDialog && mDialog != diag->second.dialog)
+ mDialog->restoreCamera();
mDialog = diag->second.dialog;
+ if (mDialog)
+ mDialog->saveCamera();
}
return npcId;
}