Skip to content

Commit

Permalink
[9171] Update pet and minipet monster move flag at player toggle walk…
Browse files Browse the repository at this point in the history
…/run

Signed-off-by: NoFantasy <nofantasy@nf.no>
  • Loading branch information
NoFantasy committed Jan 13, 2010
1 parent 7305eea commit b16ce82
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions src/game/MovementHandler.cpp
Expand Up @@ -299,6 +299,29 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
if (opcode == MSG_MOVE_FALL_LAND && plMover && !plMover->isInFlight())
plMover->HandleFall(movementInfo);

if ((opcode == MSG_MOVE_SET_WALK_MODE || opcode == MSG_MOVE_SET_RUN_MODE) && plMover)
{
Pet* pPet = plMover->GetPet();
Pet* pMiniPet = plMover->GetMiniPet();

if (movementInfo.HasMovementFlag(MOVEMENTFLAG_WALK_MODE))
{
if (pPet && !pPet->isInCombat())
pPet->SetMonsterMoveFlags(MONSTER_MOVE_WALK);

if (pMiniPet)
pMiniPet->SetMonsterMoveFlags(MONSTER_MOVE_WALK);
}
else
{
if (pPet)
pPet->RemoveMonsterMoveFlag(MONSTER_MOVE_WALK);

if (pMiniPet)
pMiniPet->RemoveMonsterMoveFlag(MONSTER_MOVE_WALK);
}
}

if (plMover && (movementInfo.HasMovementFlag(MOVEMENTFLAG_SWIMMING) != plMover->IsInWater()))
{
// now client not include swimming flag in case jumping under water
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9170"
#define REVISION_NR "9171"
#endif // __REVISION_NR_H__

0 comments on commit b16ce82

Please sign in to comment.