Build error fixes

2 build errors left at this point.

The weather system needs to be implemented in the same way as the
previous cores. That should resolve one or even both of the last errors.
This commit is contained in:
Charles A Edwards 2016-02-04 16:21:30 +00:00 committed by Antz
parent bb2f41482c
commit 9e94234bdf
12 changed files with 124 additions and 18 deletions

View file

@ -74,6 +74,11 @@ TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
return NULL; return NULL;
} }
void VendorItemData::AddItem(uint32 item, uint8 type, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, uint16 conditonId)
{
m_items.push_back(new VendorItem(item, type, maxcount, ptime, ExtendedCost, conditonId));
}
bool VendorItemData::RemoveItem(uint32 item_id, uint8 type) bool VendorItemData::RemoveItem(uint32 item_id, uint8 type)
{ {
bool found = false; bool found = false;

View file

@ -357,10 +357,7 @@ struct VendorItemData
} }
bool Empty() const { return m_items.empty(); } bool Empty() const { return m_items.empty(); }
uint8 GetItemCount() const { return m_items.size(); } uint8 GetItemCount() const { return m_items.size(); }
void AddItem(uint32 item, uint8 type, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, uint16 conditonId) void AddItem(uint32 item, uint8 type, uint32 maxcount, uint32 ptime, uint32 ExtendedCost, uint16 conditonId);
{
m_items.push_back(new VendorItem(item, type, maxcount, ptime, ExtendedCost, conditonId));
}
bool RemoveItem(uint32 item_id, uint8 type); bool RemoveItem(uint32 item_id, uint8 type);
VendorItem const* FindItemCostPair(uint32 item_id, uint8 type, uint32 extendedCost) const; VendorItem const* FindItemCostPair(uint32 item_id, uint8 type, uint32 extendedCost) const;
VendorItem const* FindItem(uint32 item_id) const; VendorItem const* FindItem(uint32 item_id) const;

View file

@ -204,7 +204,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
break; break;
case HUNTER_PET: case HUNTER_PET:
SetByteFlag(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_CAN_BE_ABANDONED : UNIT_CAN_BE_RENAMED | UNIT_CAN_BE_ABANDONED); SetByteFlag(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_CAN_BE_ABANDONED : UNIT_CAN_BE_RENAMED | UNIT_CAN_BE_ABANDONED);
setPowerType(POWER_FOCUS); SetPowerType(POWER_FOCUS);
break; break;
default: default:
sLog.outError("Pet have incorrect type (%u) for pet loading.", getPetType()); sLog.outError("Pet have incorrect type (%u) for pet loading.", getPetType());
@ -824,7 +824,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
} }
SetDisplayId(creature->GetDisplayId()); SetDisplayId(creature->GetDisplayId());
SetNativeDisplayId(creature->GetNativeDisplayId()); SetNativeDisplayId(creature->GetNativeDisplayId());
setPowerType(POWER_FOCUS); SetPowerType(POWER_FOCUS);
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0); SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForPetLevel(creature->getLevel())); SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForPetLevel(creature->getLevel()));

View file

@ -19397,20 +19397,20 @@ void Player::InitDataForForm(bool reapplyMods)
case FORM_CAT: case FORM_CAT:
{ {
if (GetPowerType() != POWER_ENERGY) if (GetPowerType() != POWER_ENERGY)
setPowerType(POWER_ENERGY); SetPowerType(POWER_ENERGY);
break; break;
} }
case FORM_BEAR: case FORM_BEAR:
{ {
if (GetPowerType() != POWER_RAGE) if (GetPowerType() != POWER_RAGE)
setPowerType(POWER_RAGE); SetPowerType(POWER_RAGE);
break; break;
} }
default: // 0, for example default: // 0, for example
{ {
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass()); ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass());
if (cEntry && cEntry->powerType < MAX_POWERS && uint32(GetPowerType()) != cEntry->powerType) if (cEntry && cEntry->powerType < MAX_POWERS && uint32(GetPowerType()) != cEntry->powerType)
setPowerType(Powers(cEntry->powerType)); SetPowerType(Powers(cEntry->powerType));
break; break;
} }
} }

View file

@ -5717,7 +5717,7 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, SpellSchoolMask d
SendAttackStateUpdate(&dmgInfo); SendAttackStateUpdate(&dmgInfo);
} }
void Unit::setPowerType(Powers new_powertype) void Unit::SetPowerType(Powers new_powertype)
{ {
SetByteValue(UNIT_FIELD_BYTES_0, 3, new_powertype); SetByteValue(UNIT_FIELD_BYTES_0, 3, new_powertype);

View file

@ -1728,7 +1728,7 @@ class Unit : public WorldObject
* @return The type of power this Unit uses * @return The type of power this Unit uses
*/ */
Powers GetPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, 3)); } Powers GetPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, 3)); }
void setPowerType(Powers power); void SetPowerType(Powers power);
uint32 GetPower(Powers power) const; uint32 GetPower(Powers power) const;
uint32 GetPowerByIndex(uint32 index) const; uint32 GetPowerByIndex(uint32 index) const;
uint32 GetMaxPower(Powers power) const; uint32 GetMaxPower(Powers power) const;
@ -3082,7 +3082,6 @@ class Unit : public WorldObject
SpellSchools GetSpellSchoolByAuraGroup(UnitMods unitMod) const; SpellSchools GetSpellSchoolByAuraGroup(UnitMods unitMod) const;
Stats GetStatByAuraGroup(UnitMods unitMod) const; Stats GetStatByAuraGroup(UnitMods unitMod) const;
Powers GetPowerTypeByAuraGroup(UnitMods unitMod) const; Powers GetPowerTypeByAuraGroup(UnitMods unitMod) const;
void SetPowerType(Powers new_powertype);
bool CanModifyStats() const { return m_canModifyStats; } bool CanModifyStats() const { return m_canModifyStats; }
void SetCanModifyStats(bool modifyStats) { m_canModifyStats = modifyStats; } void SetCanModifyStats(bool modifyStats) { m_canModifyStats = modifyStats; }
virtual bool UpdateStats(Stats stat) = 0; virtual bool UpdateStats(Stats stat) = 0;

View file

@ -224,10 +224,12 @@ namespace MaNGOS
template<class Check> template<class Check>
struct WorldObjectLastSearcher struct WorldObjectLastSearcher
{ {
uint32 i_phaseMask;
WorldObject*& i_object; WorldObject*& i_object;
Check& i_check; Check& i_check;
WorldObjectLastSearcher(WorldObject* & result, Check& check) : i_object(result), i_check(check) {} WorldObjectLastSearcher(WorldObject* & result, Check& check)
: i_phaseMask(check.GetFocusObject().GetPhaseMask()), i_object(result), i_check(check) {}
void Visit(PlayerMapType& m); void Visit(PlayerMapType& m);
void Visit(CreatureMapType& m); void Visit(CreatureMapType& m);
@ -238,6 +240,24 @@ namespace MaNGOS
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {} template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
}; };
/*
template<class Check>
struct WorldObjectLastSearcher
{
WorldObject*& i_object;
Check& i_check;
WorldObjectLastSearcher(WorldObject* & result, Check& check) : i_object(result), i_check(check) {}
void Visit(PlayerMapType& m); // causing Unresolved External Symbol !!!
void Visit(CreatureMapType& m);
void Visit(CorpseMapType& m);
void Visit(GameObjectMapType& m);
void Visit(DynamicObjectMapType& m);
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED>&) {}
}; */
template<class Check> template<class Check>
struct WorldObjectListSearcher struct WorldObjectListSearcher
{ {

View file

@ -315,6 +315,87 @@ void MaNGOS::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType& m)
} }
} }
template<class Check>
void MaNGOS::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType& m)
{
for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
}
}
}
template<class Check>
void MaNGOS::WorldObjectLastSearcher<Check>::Visit(PlayerMapType& m)
{
for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
}
}
}
template<class Check>
void MaNGOS::WorldObjectLastSearcher<Check>::Visit(CreatureMapType& m)
{
for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
}
}
}
template<class Check>
void MaNGOS::WorldObjectLastSearcher<Check>::Visit(CorpseMapType& m)
{
for (CorpseMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
}
}
}
template<class Check>
void MaNGOS::WorldObjectLastSearcher<Check>::Visit(DynamicObjectMapType& m)
{
for (DynamicObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
if (!itr->getSource()->InSamePhase(i_phaseMask))
continue;
if (i_check(itr->getSource()))
{
i_object = itr->getSource();
return;
}
}
}
template<class Check> template<class Check>
void MaNGOS::WorldObjectListSearcher<Check>::Visit(PlayerMapType& m) void MaNGOS::WorldObjectListSearcher<Check>::Visit(PlayerMapType& m)
{ {

View file

@ -3666,7 +3666,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
{ {
// reset power to default values only at power change // reset power to default values only at power change
if (target->GetPowerType() != PowerType) if (target->GetPowerType() != PowerType)
target->setPowerType(PowerType); target->SetPowerType(PowerType);
switch (form) switch (form)
{ {
@ -3745,7 +3745,7 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real)
target->SetDisplayId(target->GetNativeDisplayId()); target->SetDisplayId(target->GetNativeDisplayId());
if (target->getClass() == CLASS_DRUID) if (target->getClass() == CLASS_DRUID)
target->setPowerType(POWER_MANA); target->SetPowerType(POWER_MANA);
target->SetShapeshiftForm(FORM_NONE); target->SetShapeshiftForm(FORM_NONE);

View file

@ -5537,7 +5537,7 @@ bool Spell::DoSummonGuardian(CreatureSummonPositions& list, SummonPropertiesEntr
// spawnCreature->SetName(""); // generated by client // spawnCreature->SetName(""); // generated by client
spawnCreature->SetOwnerGuid(m_caster->GetObjectGuid()); spawnCreature->SetOwnerGuid(m_caster->GetObjectGuid());
spawnCreature->setPowerType(POWER_MANA); spawnCreature->SetPowerType(POWER_MANA);
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, spawnCreature->GetCreatureInfo()->npcflag); spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, spawnCreature->GetCreatureInfo()->npcflag);
spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0); spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
@ -5741,7 +5741,7 @@ bool Spell::DoSummonPet(SpellEffectEntry const* effect)
spawnCreature->SetOwnerGuid(m_caster->GetObjectGuid()); spawnCreature->SetOwnerGuid(m_caster->GetObjectGuid());
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
spawnCreature->setPowerType(POWER_MANA); spawnCreature->SetPowerType(POWER_MANA);
spawnCreature->setFaction(m_caster->getFaction()); spawnCreature->setFaction(m_caster->getFaction());
spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0); spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
spawnCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0); spawnCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);

View file

@ -1898,7 +1898,11 @@ namespace LuaGlobalFunctions
if (!eObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, maxcount, incrtime, extendedcost, 0)) if (!eObjectMgr->IsVendorItemValid(false, "npc_vendor", entry, item, maxcount, incrtime, extendedcost, 0))
return 0; return 0;
#ifndef CLASSIC #ifndef CLASSIC
#ifdef CATA
eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime, extendedcost, 1);
#else
eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime, extendedcost); eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime, extendedcost);
#endif
#else #else
eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime); eObjectMgr->AddVendorItem(entry, item, maxcount, incrtime);
#endif #endif

View file

@ -1561,7 +1561,7 @@ namespace LuaUnit
return luaL_argerror(L, 2, "valid Powers expected"); return luaL_argerror(L, 2, "valid Powers expected");
#ifdef TRINITY #ifdef TRINITY
unit->setPowerType((Powers)type); unit->SetPowerType((Powers)type);
#else #else
unit->SetPowerType((Powers)type); unit->SetPowerType((Powers)type);
#endif #endif