Various external fixes - part 8 (#121)
* Ported commits from cm * Various external fixes - part 8 Ported commits from cmangos repositories - https://github.com/cmangos/mangos-classic/commit/f4b1f9f - https://github.com/cmangos/mangos-classic/commit/dc8b867 Simplify debug log output in Unit.cpp
This commit is contained in:
parent
4f176795ff
commit
b15f4711a3
@ -162,33 +162,19 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
|||||||
if (target == this) // building packet for yourself
|
if (target == this) // building packet for yourself
|
||||||
{ updateFlags |= UPDATEFLAG_SELF; }
|
{ updateFlags |= UPDATEFLAG_SELF; }
|
||||||
|
|
||||||
if (updateFlags & UPDATEFLAG_HAS_POSITION)
|
if (m_isNewObject)
|
||||||
{
|
{
|
||||||
// UPDATETYPE_CREATE_OBJECT2 dynamic objects, corpses...
|
switch (GetObjectGuid().GetHigh())
|
||||||
if (isType(TYPEMASK_DYNAMICOBJECT) || isType(TYPEMASK_CORPSE) || isType(TYPEMASK_PLAYER))
|
|
||||||
{ updatetype = UPDATETYPE_CREATE_OBJECT2; }
|
|
||||||
|
|
||||||
// UPDATETYPE_CREATE_OBJECT2 for pets...
|
|
||||||
if (target->GetPetGuid() == GetObjectGuid())
|
|
||||||
{ updatetype = UPDATETYPE_CREATE_OBJECT2; }
|
|
||||||
|
|
||||||
// UPDATETYPE_CREATE_OBJECT2 for some gameobject types...
|
|
||||||
if (isType(TYPEMASK_GAMEOBJECT))
|
|
||||||
{
|
{
|
||||||
switch (((GameObject*)this)->GetGoType())
|
case HighGuid::HIGHGUID_DYNAMICOBJECT:
|
||||||
{
|
case HighGuid::HIGHGUID_CORPSE:
|
||||||
case GAMEOBJECT_TYPE_TRAP:
|
case HighGuid::HIGHGUID_PLAYER:
|
||||||
case GAMEOBJECT_TYPE_DUEL_ARBITER:
|
case HighGuid::HIGHGUID_UNIT:
|
||||||
case GAMEOBJECT_TYPE_FLAGSTAND:
|
case HighGuid::HIGHGUID_GAMEOBJECT:
|
||||||
case GAMEOBJECT_TYPE_FLAGDROP:
|
updatetype = UPDATETYPE_CREATE_OBJECT2;
|
||||||
updatetype = UPDATETYPE_CREATE_OBJECT2;
|
break;
|
||||||
break;
|
default:
|
||||||
case GAMEOBJECT_TYPE_TRANSPORT:
|
break;
|
||||||
updateFlags |= UPDATEFLAG_TRANSPORT;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +186,6 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
|||||||
buf << uint8(m_objectTypeId);
|
buf << uint8(m_objectTypeId);
|
||||||
|
|
||||||
BuildMovementUpdate(&buf, updateFlags);
|
BuildMovementUpdate(&buf, updateFlags);
|
||||||
|
|
||||||
UpdateMask updateMask;
|
UpdateMask updateMask;
|
||||||
updateMask.SetCount(m_valuesCount);
|
updateMask.SetCount(m_valuesCount);
|
||||||
_SetCreateBits(&updateMask, target);
|
_SetCreateBits(&updateMask, target);
|
||||||
|
@ -404,6 +404,7 @@ class Object
|
|||||||
virtual bool HasQuest(uint32 /* quest_id */) const { return false; }
|
virtual bool HasQuest(uint32 /* quest_id */) const { return false; }
|
||||||
virtual bool HasInvolvedQuest(uint32 /* quest_id */) const { return false; }
|
virtual bool HasInvolvedQuest(uint32 /* quest_id */) const { return false; }
|
||||||
void _ReCreate(uint32 entry);
|
void _ReCreate(uint32 entry);
|
||||||
|
void SetAsNewObject(bool isNew) { m_isNewObject = isNew; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Object();
|
Object();
|
||||||
@ -440,6 +441,7 @@ class Object
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_inWorld;
|
bool m_inWorld;
|
||||||
|
bool m_isNewObject;
|
||||||
|
|
||||||
PackedGuid m_PackGUID;
|
PackedGuid m_PackGUID;
|
||||||
|
|
||||||
|
@ -2177,12 +2177,8 @@ void Unit::AttackerStateUpdate(Unit* pVictim, WeaponAttackType attType, bool ext
|
|||||||
ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType);
|
ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType);
|
||||||
DealMeleeDamage(&damageInfo, true);
|
DealMeleeDamage(&damageInfo, true);
|
||||||
|
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "AttackerStateUpdate: %s attacked %s for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
GetGuidStr().c_str(), pVictim->GetGuidStr().c_str(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
|
||||||
GetGUIDLow(), pVictim->GetGUIDLow(), pVictim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
|
|
||||||
else
|
|
||||||
DEBUG_FILTER_LOG(LOG_FILTER_COMBAT, "AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
|
|
||||||
GetGUIDLow(), pVictim->GetGUIDLow(), pVictim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);
|
|
||||||
|
|
||||||
// Owner of pet enters combat upon pet attack
|
// Owner of pet enters combat upon pet attack
|
||||||
if (Unit* owner = GetOwner())
|
if (Unit* owner = GetOwner())
|
||||||
|
@ -373,7 +373,9 @@ Map::Add(T* obj)
|
|||||||
DEBUG_LOG("%s enters grid[%u,%u]", obj->GetGuidStr().c_str(), cell.GridX(), cell.GridY());
|
DEBUG_LOG("%s enters grid[%u,%u]", obj->GetGuidStr().c_str(), cell.GridX(), cell.GridY());
|
||||||
|
|
||||||
obj->GetViewPoint().Event_AddedToWorld(&(*grid)(cell.CellX(), cell.CellY()));
|
obj->GetViewPoint().Event_AddedToWorld(&(*grid)(cell.CellX(), cell.CellY()));
|
||||||
|
obj->SetAsNewObject(true);
|
||||||
UpdateObjectVisibility(obj, cell, p);
|
UpdateObjectVisibility(obj, cell, p);
|
||||||
|
obj->SetAsNewObject(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Map::MessageBroadcast(Player const* player, WorldPacket* msg, bool to_self)
|
void Map::MessageBroadcast(Player const* player, WorldPacket* msg, bool to_self)
|
||||||
|
@ -2599,8 +2599,11 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
|||||||
m_caster->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
m_caster->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// execute triggered without cast time explicitly in call point
|
||||||
|
if (!m_timer)
|
||||||
|
cast(true);
|
||||||
// add non-triggered (with cast time and without)
|
// add non-triggered (with cast time and without)
|
||||||
if (!m_IsTriggeredSpell)
|
else if (!m_IsTriggeredSpell)
|
||||||
{
|
{
|
||||||
// add to cast type slot
|
// add to cast type slot
|
||||||
m_caster->SetCurrentCastedSpell(this);
|
m_caster->SetCurrentCastedSpell(this);
|
||||||
@ -2610,9 +2613,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
|
|||||||
|
|
||||||
TriggerGlobalCooldown();
|
TriggerGlobalCooldown();
|
||||||
}
|
}
|
||||||
// execute triggered without cast time explicitly in call point
|
|
||||||
else if (m_timer == 0)
|
|
||||||
{ cast(true); }
|
|
||||||
// else triggered with cast time will execute execute at next tick or later
|
// else triggered with cast time will execute execute at next tick or later
|
||||||
// without adding to cast type slot
|
// without adding to cast type slot
|
||||||
// will not show cast bar but will show effects at casting time etc
|
// will not show cast bar but will show effects at casting time etc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user