Adjusted chase modes to work correctly, added new option for auto chase override. Fixed NPC speak messages to appear in the correct position.

This commit is contained in:
BeniS
2012-07-08 02:09:50 +12:00
parent 6a85c31a77
commit 4453242bee
6 changed files with 34 additions and 9 deletions

View File

@@ -161,7 +161,9 @@ void Game::processTextMessage(const std::string& type, const std::string& messag
void Game::processCreatureSpeak(const std::string& name, int level, Otc::SpeakType type, const std::string& message, int channelId, const Position& creaturePos)
{
if(creaturePos.isValid() && (type == Otc::SpeakSay || type == Otc::SpeakWhisper || type == Otc::SpeakYell || type == Otc::SpeakMonsterSay || type == Otc::SpeakMonsterYell)) {
if(creaturePos.isValid() && (type == Otc::SpeakSay || type == Otc::SpeakWhisper || type == Otc::SpeakYell
|| type == Otc::SpeakMonsterSay || type == Otc::SpeakMonsterYell || type == Otc::SpeakPrivateNpcToPlayer))
{
StaticTextPtr staticText = StaticTextPtr(new StaticText);
staticText->addMessage(name, type, message);
g_map.addThing(staticText, creaturePos);
@@ -456,6 +458,8 @@ void Game::walk(Otc::Direction direction)
m_localPlayer->lockWalk();
forceWalk(direction);
g_lua.callGlobalField("g_game", "onWalk", direction);
}
void Game::autoWalk(const std::vector<Otc::Direction>& dirs)
@@ -487,6 +491,8 @@ void Game::autoWalk(const std::vector<Otc::Direction>& dirs)
nextDirs.erase(nextDirs.begin());
if(nextDirs.size() > 0)
m_protocolGame->sendAutoWalk(nextDirs);
g_lua.callGlobalField("g_game", "onAutoWalk", direction);
}
void Game::forceWalk(Otc::Direction direction)
@@ -494,9 +500,6 @@ void Game::forceWalk(Otc::Direction direction)
if(!canPerformGameAction())
return;
// always cancel chasing attacks
setChaseMode(Otc::DontChase);
switch(direction) {
case Otc::North:
m_protocolGame->sendWalkNorth();