aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Map.cpp7
-rw-r--r--src/game/PetHandler.cpp6
-rw-r--r--src/game/SpellAuras.cpp7
-rw-r--r--src/game/Unit.cpp2
4 files changed, 10 insertions, 12 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 43676bd1dc6..bc81b0bbec4 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -1015,7 +1015,6 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell);
AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell);
- c->SetCurrentCell(new_cell);
}
else
{
@@ -1040,7 +1039,6 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell);
AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell);
- c->SetCurrentCell(new_cell);
return true;
}
@@ -1056,7 +1054,6 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell)
RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell);
EnsureGridCreated(GridPair(new_cell.GridX(), new_cell.GridY()));
AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell);
- c->SetCurrentCell(new_cell);
return true;
}
@@ -1730,7 +1727,7 @@ void Map::AddToActive( Creature* c )
AddToActiveHelper(c);
// also not allow unloading spawn grid to prevent creating creature clone at load
- if(c->GetDBTableGUIDLow())
+ if(!c->isPet() && c->GetDBTableGUIDLow())
{
float x,y,z;
c->GetRespawnCoord(x,y,z);
@@ -1751,7 +1748,7 @@ void Map::RemoveFromActive( Creature* c )
RemoveFromActiveHelper(c);
// also allow unloading spawn grid
- if(c->GetDBTableGUIDLow())
+ if(!c->isPet() && c->GetDBTableGUIDLow())
{
float x,y,z;
c->GetRespawnCoord(x,y,z);
diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp
index 45fcbbb3219..0a506c2fbcc 100644
--- a/src/game/PetHandler.cpp
+++ b/src/game/PetHandler.cpp
@@ -124,11 +124,9 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data )
if (pet->getVictim())
pet->AttackStop();
- if(pet->GetTypeId() != TYPEID_PLAYER)
+ if(pet->GetTypeId() != TYPEID_PLAYER && ((Creature*)pet)->IsAIEnabled)
{
- pet->GetMotionMaster()->Clear();
- if (((Creature*)pet)->IsAIEnabled)
- ((Creature*)pet)->AI()->AttackStart(TargetUnit);
+ ((Creature*)pet)->AI()->AttackStart(TargetUnit);
//10% chance to play special pet attack talk, else growl
if(((Creature*)pet)->isPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != TargetUnit && urand(0, 100) < 10)
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 7639e8e7619..012b576d432 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6536,11 +6536,14 @@ void Aura::HandleModPossessPet(bool apply, bool Real)
Unit* caster = GetCaster();
if(!caster || caster->GetTypeId() != TYPEID_PLAYER)
return;
- if(caster->GetPet() != m_target)
- return;
if(apply)
+ {
+ if(caster->GetPet() != m_target)
+ return;
+
m_target->SetCharmedOrPossessedBy(caster, true);
+ }
else
{
m_target->RemoveCharmedOrPossessedBy(caster);
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 53d0b06416f..6df058fbc36 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7704,7 +7704,7 @@ bool Unit::AttackStop()
void Unit::CombatStop(bool cast)
{
- if(cast& IsNonMeleeSpellCasted(false))
+ if(cast && IsNonMeleeSpellCasted(false))
InterruptNonMeleeSpells(false);
AttackStop();