diff options
| author | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-07-12 15:36:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-12 15:36:55 +0200 |
| commit | c92950b3e1f6366d85d707365a8ad2caddafeecc (patch) | |
| tree | 9c034dc61e7b8dc5d480bfd476a6631b8d9dd592 /src/server/game/Entities/Unit | |
| parent | 352944266822f8c8d3bfdd6078c6f82d3555dd85 (diff) | |
Core/DataStores: Update DBC field names to generated ones (#24999)
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index a7495b4e9e6..5ee821ed284 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3160,15 +3160,15 @@ void Unit::ProcessTerrainStatusUpdate(ZLiquidStatus status, Optional<LiquidData> curLiquid = sLiquidTypeStore.LookupEntry(liquidData->entry); if (curLiquid != _lastLiquid) { - if (_lastLiquid && _lastLiquid->SpellId) - RemoveAurasDueToSpell(_lastLiquid->SpellId); + if (_lastLiquid && _lastLiquid->SpellID) + RemoveAurasDueToSpell(_lastLiquid->SpellID); Player* player = GetCharmerOrOwnerPlayerOrPlayerItself(); // Set _lastLiquid before casting liquid spell to avoid infinite loops _lastLiquid = curLiquid; - if (curLiquid && curLiquid->SpellId && (!player || !player->IsGameMaster())) - CastSpell(this, curLiquid->SpellId, true); + if (curLiquid && curLiquid->SpellID && (!player || !player->IsGameMaster())) + CastSpell(this, curLiquid->SpellID, true); } } @@ -5436,15 +5436,15 @@ void Unit::UpdateDisplayPower() if (GetTypeId() == TYPEID_PLAYER) { ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(GetClass()); - if (cEntry && cEntry->powerType < MAX_POWERS) - displayPower = Powers(cEntry->powerType); + if (cEntry && cEntry->DisplayPower < MAX_POWERS) + displayPower = Powers(cEntry->DisplayPower); } else if (GetTypeId() == TYPEID_UNIT) { if (Vehicle* vehicle = GetVehicleKit()) { - if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(vehicle->GetVehicleInfo()->m_powerDisplayId)) - displayPower = Powers(powerDisplay->PowerType); + if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(vehicle->GetVehicleInfo()->PowerDisplayID)) + displayPower = Powers(powerDisplay->ActualType); else if (GetClass() == CLASS_ROGUE) displayPower = POWER_ENERGY; } @@ -5916,7 +5916,7 @@ void Unit::SetMinion(Minion *minion, bool apply) if (minion->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN)) AddGuidValue(UNIT_FIELD_SUMMON, minion->GetGUID()); - if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET) + if (minion->m_Properties && minion->m_Properties->Title == SUMMON_TYPE_MINIPET) SetCritterGUID(minion->GetGUID()); // PvP, FFAPvP @@ -5942,7 +5942,7 @@ void Unit::SetMinion(Minion *minion, bool apply) m_Controlled.erase(minion); - if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET) + if (minion->m_Properties && minion->m_Properties->Title == SUMMON_TYPE_MINIPET) if (GetCritterGUID() == minion->GetGUID()) SetCritterGUID(ObjectGuid::Empty); @@ -8871,9 +8871,9 @@ uint32 Unit::GetCreatureType() const if (GetTypeId() == TYPEID_PLAYER) { ShapeshiftForm form = GetShapeshiftForm(); - SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form); - if (ssEntry && ssEntry->creatureType > 0) - return ssEntry->creatureType; + SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form); + if (ssEntry && ssEntry->CreatureType > 0) + return ssEntry->CreatureType; else { ChrRacesEntry const* raceEntry = sChrRacesStore.AssertEntry(GetRace()); @@ -8909,11 +8909,11 @@ bool Unit::IsInDisallowedMountForm() const if (ShapeshiftForm form = GetShapeshiftForm()) { - SpellShapeshiftEntry const* shapeshift = sSpellShapeshiftStore.LookupEntry(form); + SpellShapeshiftFormEntry const* shapeshift = sSpellShapeshiftFormStore.LookupEntry(form); if (!shapeshift) return true; - if (!(shapeshift->flags1 & 0x1)) + if (!(shapeshift->Flags & 0x1)) return true; } @@ -8924,12 +8924,12 @@ bool Unit::IsInDisallowedMountForm() const if (!display) return true; - CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtraId); + CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtendedDisplayInfoID); if (!displayExtra) return true; - CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelId); - ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->Race); + CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelID); + ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->DisplayRaceID); if (model && !(model->HasFlag(CREATURE_MODEL_DATA_FLAGS_CAN_MOUNT))) if (race && !(race->HasFlag(CHRRACES_FLAGS_CAN_MOUNT))) @@ -12326,22 +12326,22 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const } uint32 modelid = 0; - SpellShapeshiftEntry const* formEntry = sSpellShapeshiftStore.LookupEntry(form); - if (formEntry && formEntry->modelID_A) + SpellShapeshiftFormEntry const* formEntry = sSpellShapeshiftFormStore.LookupEntry(form); + if (formEntry && formEntry->CreatureDisplayID[0]) { // Take the alliance modelid as default if (GetTypeId() != TYPEID_PLAYER) - return formEntry->modelID_A; + return formEntry->CreatureDisplayID[0]; else { if (Player::TeamForRace(GetRace()) == ALLIANCE) - modelid = formEntry->modelID_A; + modelid = formEntry->CreatureDisplayID[0]; else - modelid = formEntry->modelID_H; + modelid = formEntry->CreatureDisplayID[1]; // If the player is horde but there are no values for the horde modelid - take the alliance modelid if (!modelid && Player::TeamForRace(GetRace()) == HORDE) - modelid = formEntry->modelID_A; + modelid = formEntry->CreatureDisplayID[0]; } } @@ -12524,7 +12524,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a // If vehicle flag for fixed position set (cannons), or if the following hardcoded units, then set state rooted // 30236 | Argent Cannon // 39759 | Tankbuster Cannon - if ((vehicle->GetVehicleInfo()->m_flags & VEHICLE_FLAG_FIXED_POSITION) || vehicle->GetBase()->GetEntry() == 30236 || vehicle->GetBase()->GetEntry() == 39759) + if ((vehicle->GetVehicleInfo()->Flags & VEHICLE_FLAG_FIXED_POSITION) || vehicle->GetBase()->GetEntry() == 30236 || vehicle->GetBase()->GetEntry() == 39759) SetControlled(true, UNIT_STATE_ROOT); ASSERT(!m_vehicle); @@ -12882,7 +12882,7 @@ void Unit::StopAttackFaction(uint32 faction_id) { if (Unit* victim = GetVictim()) { - if (victim->GetFactionTemplateEntry()->faction == faction_id) + if (victim->GetFactionTemplateEntry()->Faction == faction_id) { AttackStop(); if (IsNonMeleeSpellCast(false)) @@ -12897,7 +12897,7 @@ void Unit::StopAttackFaction(uint32 faction_id) AttackerSet const& attackers = getAttackers(); for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();) { - if ((*itr)->GetFactionTemplateEntry()->faction == faction_id) + if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id) { (*itr)->AttackStop(); itr = attackers.begin(); @@ -12908,7 +12908,7 @@ void Unit::StopAttackFaction(uint32 faction_id) std::vector<CombatReference*> refsToEnd; for (auto const& pair : m_combatManager.GetPvECombatRefs()) - if (pair.second->GetOther(this)->GetFactionTemplateEntry()->faction == faction_id) + if (pair.second->GetOther(this)->GetFactionTemplateEntry()->Faction == faction_id) refsToEnd.push_back(pair.second); for (CombatReference* ref : refsToEnd) ref->EndCombat(); @@ -13514,11 +13514,11 @@ float Unit::GetCollisionHeight() const { if (CreatureDisplayInfoEntry const* mountDisplayInfo = sCreatureDisplayInfoStore.LookupEntry(GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID))) { - if (CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId)) + if (CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelID)) { CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.AssertEntry(GetNativeDisplayId()); - CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelId); - float const collisionHeight = scaleMod * (mountModelData->MountHeight + modelData->CollisionHeight * modelData->Scale * displayInfo->scale * 0.5f); + CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelID); + float const collisionHeight = scaleMod * (mountModelData->MountHeight + modelData->CollisionHeight * modelData->ModelScale * displayInfo->CreatureModelScale * 0.5f); return collisionHeight == 0.0f ? DEFAULT_COLLISION_HEIGHT : collisionHeight; } } @@ -13526,9 +13526,9 @@ float Unit::GetCollisionHeight() const //! Dismounting case - use basic default model data CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.AssertEntry(GetNativeDisplayId()); - CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelId); + CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelID); - float const collisionHeight = scaleMod * modelData->CollisionHeight * modelData->Scale * displayInfo->scale; + float const collisionHeight = scaleMod * modelData->CollisionHeight * modelData->ModelScale * displayInfo->CreatureModelScale; return collisionHeight == 0.0f ? DEFAULT_COLLISION_HEIGHT : collisionHeight; } |
