mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 10:44:08 +00:00
Replace all auto with auto*
For components
This commit is contained in:
@@ -244,7 +244,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
||||
bool hadRemainingDowntime = m_SkillTime > 0.0f;
|
||||
if (m_SkillTime > 0.0f) m_SkillTime -= deltaTime;
|
||||
|
||||
auto rebuild = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||
auto* rebuild = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuild != nullptr) {
|
||||
const auto state = rebuild->GetState();
|
||||
@@ -254,7 +254,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
||||
}
|
||||
}
|
||||
|
||||
auto skillComponent = m_OwningEntity->GetComponent<SkillComponent>();
|
||||
auto* skillComponent = m_OwningEntity->GetComponent<SkillComponent>();
|
||||
|
||||
if (skillComponent == nullptr) {
|
||||
return;
|
||||
@@ -288,7 +288,7 @@ void BaseCombatAIComponent::CalculateCombat(const float deltaTime) {
|
||||
}
|
||||
|
||||
if (!m_TetherEffectActive && m_OutOfCombat && (m_OutOfCombatTime -= deltaTime) <= 0) {
|
||||
auto destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent != nullptr && destroyableComponent->HasFaction(4)) {
|
||||
auto serilizationRequired = false;
|
||||
@@ -548,13 +548,13 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto destroyable = entity->GetComponent<DestroyableComponent>();
|
||||
auto* destroyable = entity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto referenceDestroyable = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
auto* referenceDestroyable = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (referenceDestroyable == nullptr) {
|
||||
Game::logger->Log("BaseCombatAIComponent", "Invalid reference destroyable component on (%llu)!", m_OwningEntity->GetObjectID());
|
||||
@@ -562,7 +562,7 @@ bool BaseCombatAIComponent::IsEnemy(LWOOBJID target) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto quickbuild = entity->GetComponent<RebuildComponent>();
|
||||
auto* quickbuild = entity->GetComponent<RebuildComponent>();
|
||||
|
||||
if (quickbuild != nullptr) {
|
||||
const auto state = quickbuild->GetState();
|
||||
|
@@ -71,7 +71,7 @@ void BouncerComponent::LookupPetSwitch() {
|
||||
const auto& entities = EntityManager::Instance()->GetEntitiesInGroup(group);
|
||||
|
||||
for (auto* entity : entities) {
|
||||
auto switchComponent = entity->GetComponent<SwitchComponent>();
|
||||
auto* switchComponent = entity->GetComponent<SwitchComponent>();
|
||||
|
||||
if (switchComponent != nullptr) {
|
||||
switchComponent->SetPetBouncer(this);
|
||||
|
@@ -149,7 +149,7 @@ void BuffComponent::ApplyBuffEffect(int32_t id) {
|
||||
if (parameter.name == "max_health") {
|
||||
const auto maxHealth = parameter.value;
|
||||
|
||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable == nullptr) return;
|
||||
|
||||
@@ -157,7 +157,7 @@ void BuffComponent::ApplyBuffEffect(int32_t id) {
|
||||
} else if (parameter.name == "max_armor") {
|
||||
const auto maxArmor = parameter.value;
|
||||
|
||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable == nullptr) return;
|
||||
|
||||
@@ -165,13 +165,13 @@ void BuffComponent::ApplyBuffEffect(int32_t id) {
|
||||
} else if (parameter.name == "max_imagination") {
|
||||
const auto maxImagination = parameter.value;
|
||||
|
||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable == nullptr) return;
|
||||
|
||||
destroyable->SetMaxImagination(destroyable->GetMaxImagination() + maxImagination);
|
||||
} else if (parameter.name == "speed") {
|
||||
auto controllablePhysicsComponent = this->GetOwningEntity()->GetComponent<ControllablePhysicsComponent>();
|
||||
auto* controllablePhysicsComponent = this->GetOwningEntity()->GetComponent<ControllablePhysicsComponent>();
|
||||
if (!controllablePhysicsComponent) return;
|
||||
const auto speed = parameter.value;
|
||||
controllablePhysicsComponent->AddSpeedboost(speed);
|
||||
@@ -185,7 +185,7 @@ void BuffComponent::RemoveBuffEffect(int32_t id) {
|
||||
if (parameter.name == "max_health") {
|
||||
const auto maxHealth = parameter.value;
|
||||
|
||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable == nullptr) return;
|
||||
|
||||
@@ -193,7 +193,7 @@ void BuffComponent::RemoveBuffEffect(int32_t id) {
|
||||
} else if (parameter.name == "max_armor") {
|
||||
const auto maxArmor = parameter.value;
|
||||
|
||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable == nullptr) return;
|
||||
|
||||
@@ -201,13 +201,13 @@ void BuffComponent::RemoveBuffEffect(int32_t id) {
|
||||
} else if (parameter.name == "max_imagination") {
|
||||
const auto maxImagination = parameter.value;
|
||||
|
||||
auto destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyable == nullptr) return;
|
||||
|
||||
destroyable->SetMaxImagination(destroyable->GetMaxImagination() - maxImagination);
|
||||
} else if (parameter.name == "speed") {
|
||||
auto controllablePhysicsComponent = this->GetOwningEntity()->GetComponent<ControllablePhysicsComponent>();
|
||||
auto* controllablePhysicsComponent = this->GetOwningEntity()->GetComponent<ControllablePhysicsComponent>();
|
||||
if (!controllablePhysicsComponent) return;
|
||||
const auto speed = parameter.value;
|
||||
controllablePhysicsComponent->RemoveSpeedboost(speed);
|
||||
|
@@ -27,7 +27,7 @@ void BuildBorderComponent::OnUse(Entity* originator) {
|
||||
Game::logger->Log("BuildBorderComponent", "Using PropertyPlaque");
|
||||
}
|
||||
|
||||
auto inventoryComponent = originator->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = originator->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent == nullptr) {
|
||||
return;
|
||||
@@ -63,7 +63,7 @@ void BuildBorderComponent::OnUse(Entity* originator) {
|
||||
GameMessages::SendStartArrangingWithItem(originator, originator->GetSystemAddress(), true, buildArea, originator->GetPosition());
|
||||
}
|
||||
|
||||
auto inv = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
auto* inv = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
if (!inv) return;
|
||||
inv->PushEquippedItems(); // technically this is supposed to happen automatically... but it doesnt? so just keep this here
|
||||
}
|
||||
|
@@ -366,7 +366,7 @@ void CharacterComponent::SetLastRocketConfig(std::u16string config) {
|
||||
Item* CharacterComponent::GetRocket(Entity* player) {
|
||||
Item* rocket = nullptr;
|
||||
|
||||
auto inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||
|
||||
if (!inventoryComponent) return rocket;
|
||||
|
||||
|
@@ -321,7 +321,7 @@ void ControllablePhysicsComponent::RemoveSpeedboost(float value) {
|
||||
// Recalculate speedboost since we removed one
|
||||
m_SpeedBoost = 0.0f;
|
||||
if (m_ActiveSpeedBoosts.empty()) { // no active speed boosts left, so return to base speed
|
||||
auto levelProgressionComponent = m_OwningEntity->GetComponent<LevelProgressionComponent>();
|
||||
auto* levelProgressionComponent = m_OwningEntity->GetComponent<LevelProgressionComponent>();
|
||||
if (levelProgressionComponent) m_SpeedBoost = levelProgressionComponent->GetSpeedBase();
|
||||
} else { // Used the last applied speedboost
|
||||
m_SpeedBoost = m_ActiveSpeedBoosts.back();
|
||||
|
@@ -185,7 +185,7 @@ void DestroyableComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto buffComponent = m_OwningEntity->GetComponent<BuffComponent>();
|
||||
auto* buffComponent = m_OwningEntity->GetComponent<BuffComponent>();
|
||||
|
||||
if (buffComponent != nullptr) {
|
||||
buffComponent->LoadFromXml(doc);
|
||||
@@ -207,7 +207,7 @@ void DestroyableComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto buffComponent = m_OwningEntity->GetComponent<BuffComponent>();
|
||||
auto* buffComponent = m_OwningEntity->GetComponent<BuffComponent>();
|
||||
|
||||
if (buffComponent != nullptr) {
|
||||
buffComponent->UpdateXml(doc);
|
||||
@@ -224,7 +224,7 @@ void DestroyableComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
|
||||
void DestroyableComponent::SetHealth(int32_t value) {
|
||||
m_DirtyHealth = true;
|
||||
|
||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->TrackHealthDelta(value - m_iHealth);
|
||||
}
|
||||
@@ -262,14 +262,14 @@ void DestroyableComponent::SetArmor(int32_t value) {
|
||||
// If Destroyable Component already has zero armor do not trigger the passive ability again.
|
||||
bool hadArmor = m_iArmor > 0;
|
||||
|
||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->TrackArmorDelta(value - m_iArmor);
|
||||
}
|
||||
|
||||
m_iArmor = value;
|
||||
|
||||
auto inventroyComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
auto* inventroyComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
if (m_iArmor == 0 && inventroyComponent != nullptr && hadArmor) {
|
||||
inventroyComponent->TriggerPassiveAbility(PassiveAbilityTrigger::SentinelArmor);
|
||||
}
|
||||
@@ -300,14 +300,14 @@ void DestroyableComponent::SetMaxArmor(float value, bool playAnim) {
|
||||
void DestroyableComponent::SetImagination(int32_t value) {
|
||||
m_DirtyHealth = true;
|
||||
|
||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->TrackImaginationDelta(value - m_iImagination);
|
||||
}
|
||||
|
||||
m_iImagination = value;
|
||||
|
||||
auto inventroyComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
auto* inventroyComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
if (m_iImagination == 0 && inventroyComponent != nullptr) {
|
||||
inventroyComponent->TriggerPassiveAbility(PassiveAbilityTrigger::AssemblyImagination);
|
||||
}
|
||||
@@ -407,7 +407,7 @@ void DestroyableComponent::AddFaction(const int32_t factionID, const bool ignore
|
||||
}
|
||||
|
||||
bool DestroyableComponent::IsEnemy(const Entity* other) const {
|
||||
const auto otherDestroyableComponent = other->GetComponent<DestroyableComponent>();
|
||||
const auto* otherDestroyableComponent = other->GetComponent<DestroyableComponent>();
|
||||
if (otherDestroyableComponent != nullptr) {
|
||||
for (const auto enemyFaction : m_EnemyFactionIDs) {
|
||||
for (const auto otherFaction : otherDestroyableComponent->GetFactionIDs()) {
|
||||
@@ -421,7 +421,7 @@ bool DestroyableComponent::IsEnemy(const Entity* other) const {
|
||||
}
|
||||
|
||||
bool DestroyableComponent::IsFriend(const Entity* other) const {
|
||||
const auto otherDestroyableComponent = other->GetComponent<DestroyableComponent>();
|
||||
const auto* otherDestroyableComponent = other->GetComponent<DestroyableComponent>();
|
||||
if (otherDestroyableComponent != nullptr) {
|
||||
for (const auto enemyFaction : m_EnemyFactionIDs) {
|
||||
for (const auto otherFaction : otherDestroyableComponent->GetFactionIDs()) {
|
||||
@@ -455,8 +455,8 @@ bool DestroyableComponent::IsImmune() const {
|
||||
}
|
||||
|
||||
bool DestroyableComponent::IsKnockbackImmune() const {
|
||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto inventoryComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto* inventoryComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
|
||||
if (characterComponent != nullptr && inventoryComponent != nullptr && characterComponent->GetCurrentActivity() == eGameActivity::QUICKBUILDING) {
|
||||
const auto hasPassive = inventoryComponent->HasAnyPassive({
|
||||
@@ -493,13 +493,13 @@ bool DestroyableComponent::CheckValidity(const LWOOBJID target, const bool ignor
|
||||
return false;
|
||||
}
|
||||
|
||||
auto targetDestroyable = targetEntity->GetComponent<DestroyableComponent>();
|
||||
auto* targetDestroyable = targetEntity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (targetDestroyable == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto targetQuickbuild = targetEntity->GetComponent<RebuildComponent>();
|
||||
auto* targetQuickbuild = targetEntity->GetComponent<RebuildComponent>();
|
||||
|
||||
if (targetQuickbuild != nullptr) {
|
||||
const auto state = targetQuickbuild->GetState();
|
||||
@@ -616,13 +616,13 @@ void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, uint32
|
||||
SetIsShielded(absorb > 0);
|
||||
|
||||
// Dismount on the possessable hit
|
||||
auto possessable = m_OwningEntity->GetComponent<PossessableComponent>();
|
||||
auto* possessable = m_OwningEntity->GetComponent<PossessableComponent>();
|
||||
if (possessable && possessable->GetDepossessOnHit()) {
|
||||
possessable->Dismount();
|
||||
}
|
||||
|
||||
// Dismount on the possessor hit
|
||||
auto possessor = m_OwningEntity->GetComponent<PossessorComponent>();
|
||||
auto* possessor = m_OwningEntity->GetComponent<PossessorComponent>();
|
||||
if (possessor) {
|
||||
auto possessableId = possessor->GetPossessable();
|
||||
if (possessableId != LWOOBJID_EMPTY) {
|
||||
@@ -651,7 +651,7 @@ void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, uint32
|
||||
}
|
||||
|
||||
if (health != 0) {
|
||||
auto combatComponent = m_OwningEntity->GetComponent<BaseCombatAIComponent>();
|
||||
auto* combatComponent = m_OwningEntity->GetComponent<BaseCombatAIComponent>();
|
||||
|
||||
if (combatComponent != nullptr) {
|
||||
combatComponent->Taunt(source, sourceDamage * 10); // * 10 is arbatrary
|
||||
@@ -710,13 +710,13 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
|
||||
|
||||
const auto isEnemy = m_OwningEntity->GetComponent<BaseCombatAIComponent>() != nullptr;
|
||||
|
||||
auto inventoryComponent = owner->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = owner->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent != nullptr && isEnemy) {
|
||||
inventoryComponent->TriggerPassiveAbility(PassiveAbilityTrigger::EnemySmashed, m_OwningEntity);
|
||||
}
|
||||
|
||||
auto missions = owner->GetComponent<MissionComponent>();
|
||||
auto* missions = owner->GetComponent<MissionComponent>();
|
||||
|
||||
if (missions != nullptr) {
|
||||
if (team != nullptr) {
|
||||
@@ -725,7 +725,7 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
|
||||
|
||||
if (member == nullptr) continue;
|
||||
|
||||
auto memberMissions = member->GetComponent<MissionComponent>();
|
||||
auto* memberMissions = member->GetComponent<MissionComponent>();
|
||||
|
||||
if (memberMissions == nullptr) continue;
|
||||
|
||||
@@ -750,7 +750,7 @@ void DestroyableComponent::Smash(const LWOOBJID source, const eKillType killType
|
||||
|
||||
if (team != nullptr && m_OwningEntity->GetComponent<BaseCombatAIComponent>() != nullptr) {
|
||||
LWOOBJID specificOwner = LWOOBJID_EMPTY;
|
||||
auto scriptedActivityComponent = m_OwningEntity->GetComponent<ScriptedActivityComponent>();
|
||||
auto* scriptedActivityComponent = m_OwningEntity->GetComponent<ScriptedActivityComponent>();
|
||||
uint32_t teamSize = team->members.size();
|
||||
uint32_t lootMatrixId = GetLootMatrixID();
|
||||
|
||||
@@ -877,11 +877,11 @@ void DestroyableComponent::FixStats() {
|
||||
if (entity == nullptr) return;
|
||||
|
||||
// Reset skill component and buff component
|
||||
auto skillComponent = entity->GetComponent<SkillComponent>();
|
||||
auto buffComponent = entity->GetComponent<BuffComponent>();
|
||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||
auto destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||
auto* skillComponent = entity->GetComponent<SkillComponent>();
|
||||
auto* buffComponent = entity->GetComponent<BuffComponent>();
|
||||
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||
auto* destroyableComponent = entity->GetComponent<DestroyableComponent>();
|
||||
|
||||
// If any of the components are nullptr, return
|
||||
if (skillComponent == nullptr || buffComponent == nullptr || missionComponent == nullptr || inventoryComponent == nullptr || destroyableComponent == nullptr) {
|
||||
@@ -976,7 +976,7 @@ void DestroyableComponent::DoHardcoreModeDrops(const LWOOBJID source){
|
||||
//check if this is a player:
|
||||
if (m_OwningEntity->IsPlayer()) {
|
||||
//remove hardcore_lose_uscore_on_death_percent from the player's uscore:
|
||||
auto character = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto* character = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto uscore = character->GetUScore();
|
||||
|
||||
auto uscoreToLose = uscore * (EntityManager::Instance()->GetHardcoreLoseUscoreOnDeathPercent() / 100);
|
||||
@@ -986,7 +986,7 @@ void DestroyableComponent::DoHardcoreModeDrops(const LWOOBJID source){
|
||||
|
||||
if (EntityManager::Instance()->GetHardcoreDropinventoryOnDeath()) {
|
||||
//drop all items from inventory:
|
||||
auto inventory = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
auto* inventory = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
if (inventory) {
|
||||
//get the items inventory:
|
||||
auto items = inventory->GetInventory(eInventoryType::ITEMS);
|
||||
@@ -1029,7 +1029,7 @@ void DestroyableComponent::DoHardcoreModeDrops(const LWOOBJID source){
|
||||
//award the player some u-score:
|
||||
auto* player = EntityManager::Instance()->GetEntity(source);
|
||||
if (player && player->IsPlayer()) {
|
||||
auto playerStats = player->GetComponent<CharacterComponent>();
|
||||
auto* playerStats = player->GetComponent<CharacterComponent>();
|
||||
if (playerStats) {
|
||||
//get the maximum health from this enemy:
|
||||
auto maxHealth = GetMaxHealth();
|
||||
|
@@ -189,7 +189,7 @@ void InventoryComponent::AddItem(
|
||||
inventoryType = Inventory::FindInventoryTypeForLot(lot);
|
||||
}
|
||||
|
||||
auto missions = m_OwningEntity->GetComponent<MissionComponent>();
|
||||
auto* missions = m_OwningEntity->GetComponent<MissionComponent>();
|
||||
|
||||
auto* inventory = GetInventory(inventoryType);
|
||||
|
||||
@@ -378,7 +378,7 @@ void InventoryComponent::MoveItemToInventory(Item* item, const eInventoryType in
|
||||
item->SetCount(item->GetCount() - delta, false, false);
|
||||
}
|
||||
|
||||
auto missionComponent = m_OwningEntity->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = m_OwningEntity->GetComponent<MissionComponent>();
|
||||
|
||||
if (missionComponent != nullptr) {
|
||||
if (IsTransferInventory(inventory)) {
|
||||
@@ -833,7 +833,7 @@ void InventoryComponent::EquipItem(Item* item, const bool skipChecks) {
|
||||
for (auto* lauchPad : rocketLauchPads) {
|
||||
if (Vector3::DistanceSquared(lauchPad->GetPosition(), position) > 13 * 13) continue;
|
||||
|
||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
|
||||
if (characterComponent != nullptr) characterComponent->SetLastRocketItemID(item->GetId());
|
||||
|
||||
@@ -950,10 +950,10 @@ void InventoryComponent::UnequipScripts(Item* unequippedItem) {
|
||||
}
|
||||
|
||||
void InventoryComponent::HandlePossession(Item* item) {
|
||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
if (!characterComponent) return;
|
||||
|
||||
auto possessorComponent = m_OwningEntity->GetComponent<PossessorComponent>();
|
||||
auto* possessorComponent = m_OwningEntity->GetComponent<PossessorComponent>();
|
||||
if (!possessorComponent) return;
|
||||
|
||||
// Don't do anything if we are busy dismounting
|
||||
@@ -986,7 +986,7 @@ void InventoryComponent::HandlePossession(Item* item) {
|
||||
auto* mount = EntityManager::Instance()->CreateEntity(info, nullptr, m_OwningEntity);
|
||||
|
||||
// Check to see if the mount is a vehicle, if so, flip it
|
||||
auto havokVehiclePhysicsComponent = mount->GetComponent<HavokVehiclePhysicsComponent>();
|
||||
auto* havokVehiclePhysicsComponent = mount->GetComponent<HavokVehiclePhysicsComponent>();
|
||||
if (havokVehiclePhysicsComponent) {
|
||||
auto angles = startRotation.GetEulerAngles();
|
||||
// Make it right side up
|
||||
@@ -1000,14 +1000,14 @@ void InventoryComponent::HandlePossession(Item* item) {
|
||||
}
|
||||
|
||||
// Setup the destroyable stats
|
||||
auto destroyableComponent = mount->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = mount->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) {
|
||||
destroyableComponent->SetIsSmashable(false);
|
||||
destroyableComponent->SetIsImmune(true);
|
||||
}
|
||||
|
||||
// Mount it
|
||||
auto possessableComponent = mount->GetComponent<PossessableComponent>();
|
||||
auto* possessableComponent = mount->GetComponent<PossessableComponent>();
|
||||
if (possessableComponent) {
|
||||
possessableComponent->SetIsItemSpawned(true);
|
||||
possessableComponent->SetPossessor(m_OwningEntity->GetObjectID());
|
||||
@@ -1076,7 +1076,7 @@ void InventoryComponent::PopEquippedItems() {
|
||||
|
||||
m_Pushed.clear();
|
||||
|
||||
auto destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
|
||||
// Reset stats to full
|
||||
if (destroyableComponent) {
|
||||
@@ -1246,7 +1246,7 @@ void InventoryComponent::SpawnPet(Item* item) {
|
||||
}
|
||||
|
||||
// First check if we can summon the pet. You need 1 imagination to do so.
|
||||
auto destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (Game::config->GetValue("pets_take_imagination") == "1" && destroyableComponent && destroyableComponent->GetImagination() <= 0) {
|
||||
GameMessages::SendUseItemRequirementsResponse(m_OwningEntity->GetObjectID(), m_OwningEntity->GetSystemAddress(), eUseItemResponse::NoImaginationForPet);
|
||||
@@ -1261,7 +1261,7 @@ void InventoryComponent::SpawnPet(Item* item) {
|
||||
|
||||
auto* pet = EntityManager::Instance()->CreateEntity(info);
|
||||
|
||||
auto petComponent = pet->GetComponent<PetComponent>();
|
||||
auto* petComponent = pet->GetComponent<PetComponent>();
|
||||
|
||||
if (petComponent != nullptr) {
|
||||
petComponent->Activate(item);
|
||||
@@ -1339,7 +1339,7 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
|
||||
return entry.objectTemplate == static_cast<unsigned int>(item->GetLot());
|
||||
});
|
||||
|
||||
auto missions = m_OwningEntity->GetComponent<MissionComponent>();
|
||||
auto* missions = m_OwningEntity->GetComponent<MissionComponent>();
|
||||
|
||||
for (const auto& result : results) {
|
||||
if (result.castOnType == 1) {
|
||||
|
@@ -49,8 +49,8 @@ void LevelProgressionComponent::HandleLevelUp() {
|
||||
const auto& rewards = rewardsTable->GetByLevelID(m_Level);
|
||||
bool rewardingItem = rewards.size() > 0;
|
||||
|
||||
auto inventoryComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
auto* inventoryComponent = m_OwningEntity->GetComponent<InventoryComponent>();
|
||||
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
|
||||
if (!inventoryComponent || !controllablePhysicsComponent) return;
|
||||
// Tell the client we beginning to send level rewards.
|
||||
@@ -84,6 +84,6 @@ void LevelProgressionComponent::HandleLevelUp() {
|
||||
|
||||
void LevelProgressionComponent::SetRetroactiveBaseSpeed(){
|
||||
if (m_Level >= 20) m_SpeedBase = 525.0f;
|
||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
if (controllablePhysicsComponent) controllablePhysicsComponent->SetSpeedMultiplier(m_SpeedBase / 500.0f);
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ void MissionOfferComponent::OnUse(Entity* originator) {
|
||||
|
||||
void MissionOfferComponent::OfferMissions(Entity* entity, const uint32_t specifiedMissionId) {
|
||||
// First, get the entity's MissionComponent. If there is not one, then we cannot offer missions to this entity.
|
||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||
|
||||
if (!missionComponent) {
|
||||
Game::logger->Log("MissionOfferComponent", "Unable to get mission component for Entity %llu", entity->GetObjectID());
|
||||
|
@@ -322,7 +322,7 @@ foundComponent:
|
||||
}
|
||||
|
||||
void MovementAIComponent::SetPosition(const NiPoint3& value) {
|
||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
|
||||
if (controllablePhysicsComponent != nullptr) {
|
||||
controllablePhysicsComponent->SetPosition(value);
|
||||
@@ -330,7 +330,7 @@ void MovementAIComponent::SetPosition(const NiPoint3& value) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
auto* simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
|
||||
if (simplePhysicsComponent != nullptr) {
|
||||
simplePhysicsComponent->SetPosition(value);
|
||||
@@ -342,7 +342,7 @@ void MovementAIComponent::SetRotation(const NiQuaternion& value) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
|
||||
if (controllablePhysicsComponent != nullptr) {
|
||||
controllablePhysicsComponent->SetRotation(value);
|
||||
@@ -350,7 +350,7 @@ void MovementAIComponent::SetRotation(const NiQuaternion& value) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
auto* simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
|
||||
if (simplePhysicsComponent != nullptr) {
|
||||
simplePhysicsComponent->SetRotation(value);
|
||||
@@ -358,7 +358,7 @@ void MovementAIComponent::SetRotation(const NiQuaternion& value) {
|
||||
}
|
||||
|
||||
void MovementAIComponent::SetVelocity(const NiPoint3& value) {
|
||||
auto controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
auto* controllablePhysicsComponent = m_OwningEntity->GetComponent<ControllablePhysicsComponent>();
|
||||
|
||||
if (controllablePhysicsComponent != nullptr) {
|
||||
controllablePhysicsComponent->SetVelocity(value);
|
||||
@@ -366,7 +366,7 @@ void MovementAIComponent::SetVelocity(const NiPoint3& value) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
auto* simplePhysicsComponent = m_OwningEntity->GetComponent<SimplePhysicsComponent>();
|
||||
|
||||
if (simplePhysicsComponent != nullptr) {
|
||||
simplePhysicsComponent->SetVelocity(value);
|
||||
|
@@ -17,7 +17,7 @@ MultiZoneEntranceComponent::MultiZoneEntranceComponent(Entity* parent) : Compone
|
||||
MultiZoneEntranceComponent::~MultiZoneEntranceComponent() {}
|
||||
|
||||
void MultiZoneEntranceComponent::OnUse(Entity* originator) {
|
||||
auto rocket = originator->GetComponent<CharacterComponent>()->RocketEquip(originator);
|
||||
auto* rocket = originator->GetComponent<CharacterComponent>()->RocketEquip(originator);
|
||||
if (!rocket) return;
|
||||
|
||||
// the LUP world menu is just the property menu, the client knows how to handle it
|
||||
@@ -25,7 +25,7 @@ void MultiZoneEntranceComponent::OnUse(Entity* originator) {
|
||||
}
|
||||
|
||||
void MultiZoneEntranceComponent::OnSelectWorld(Entity* originator, uint32_t index) {
|
||||
auto rocketLaunchpadControlComponent = m_OwningEntity->GetComponent<RocketLaunchpadControlComponent>();
|
||||
auto* rocketLaunchpadControlComponent = m_OwningEntity->GetComponent<RocketLaunchpadControlComponent>();
|
||||
if (!rocketLaunchpadControlComponent) return;
|
||||
|
||||
rocketLaunchpadControlComponent->Launch(originator, m_LUPWorlds[index], 0);
|
||||
|
@@ -163,7 +163,7 @@ void PetComponent::OnUse(Entity* originator) {
|
||||
m_Tamer = LWOOBJID_EMPTY;
|
||||
}
|
||||
|
||||
auto inventoryComponent = originator->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = originator->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent == nullptr) {
|
||||
return;
|
||||
@@ -173,7 +173,7 @@ void PetComponent::OnUse(Entity* originator) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto movementAIComponent = m_OwningEntity->GetComponent<MovementAIComponent>();
|
||||
auto* movementAIComponent = m_OwningEntity->GetComponent<MovementAIComponent>();
|
||||
|
||||
if (movementAIComponent != nullptr) {
|
||||
movementAIComponent->Stop();
|
||||
@@ -224,7 +224,7 @@ void PetComponent::OnUse(Entity* originator) {
|
||||
imaginationCost = cached->second.imaginationCost;
|
||||
}
|
||||
|
||||
auto destroyableComponent = originator->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = originator->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent == nullptr) {
|
||||
return;
|
||||
@@ -487,7 +487,7 @@ void PetComponent::TryBuild(uint32_t numBricks, bool clientFailed) {
|
||||
|
||||
if (cached == buildCache.end()) return;
|
||||
|
||||
auto destroyableComponent = tamer->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = tamer->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent == nullptr) return;
|
||||
|
||||
@@ -548,7 +548,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
|
||||
|
||||
GameMessages::SendPetResponse(m_Tamer, m_OwningEntity->GetObjectID(), 0, 10, 0, tamer->GetSystemAddress());
|
||||
|
||||
auto inventoryComponent = tamer->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = tamer->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent == nullptr) {
|
||||
return;
|
||||
@@ -606,7 +606,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
|
||||
tamer->GetCharacter()->SetPlayerFlag(petFlags.at(m_OwningEntity->GetLOT()), true);
|
||||
}
|
||||
|
||||
auto missionComponent = tamer->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = tamer->GetComponent<MissionComponent>();
|
||||
|
||||
if (missionComponent != nullptr) {
|
||||
missionComponent->Progress(eMissionTaskType::PET_TAMING, m_OwningEntity->GetLOT());
|
||||
@@ -614,7 +614,7 @@ void PetComponent::NotifyTamingBuildSuccess(NiPoint3 position) {
|
||||
|
||||
SetStatus(1);
|
||||
|
||||
auto characterComponent = tamer->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = tamer->GetComponent<CharacterComponent>();
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->UpdatePlayerStatistic(PetsTamed);
|
||||
}
|
||||
@@ -648,7 +648,7 @@ void PetComponent::RequestSetPetName(std::u16string name) {
|
||||
|
||||
Game::logger->Log("PetComponent", "Got set pet name (%s)", GeneralUtils::UTF16ToWTF8(name).c_str());
|
||||
|
||||
auto inventoryComponent = tamer->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = tamer->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent == nullptr) {
|
||||
return;
|
||||
@@ -913,7 +913,7 @@ void PetComponent::AddDrainImaginationTimer(Item* item, bool fromTaming) {
|
||||
auto playerEntity = playerInventoryComponent->GetOwningEntity();
|
||||
if (!playerEntity) return;
|
||||
|
||||
auto playerDestroyableComponent = playerEntity->GetComponent<DestroyableComponent>();
|
||||
auto* playerDestroyableComponent = playerEntity->GetComponent<DestroyableComponent>();
|
||||
if (!playerDestroyableComponent) return;
|
||||
|
||||
// Drain by 1 when you summon pet or when this method is called, but not when we have just tamed this pet.
|
||||
@@ -962,7 +962,7 @@ void PetComponent::Deactivate() {
|
||||
}
|
||||
|
||||
void PetComponent::Release() {
|
||||
auto inventoryComponent = GetOwner()->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = GetOwner()->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent == nullptr) {
|
||||
return;
|
||||
|
@@ -48,7 +48,7 @@ void PossessableComponent::Dismount() {
|
||||
}
|
||||
|
||||
void PossessableComponent::OnUse(Entity* originator) {
|
||||
auto possessor = originator->GetComponent<PossessorComponent>();
|
||||
auto* possessor = originator->GetComponent<PossessorComponent>();
|
||||
if (possessor) {
|
||||
possessor->Mount(m_OwningEntity);
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@ PossessorComponent::~PossessorComponent() {
|
||||
if (m_Possessable != LWOOBJID_EMPTY) {
|
||||
auto* mount = EntityManager::Instance()->GetEntity(m_Possessable);
|
||||
if (mount) {
|
||||
auto possessable = mount->GetComponent<PossessableComponent>();
|
||||
auto* possessable = mount->GetComponent<PossessableComponent>();
|
||||
if (possessable) {
|
||||
if (possessable->GetIsItemSpawned()) {
|
||||
GameMessages::SendMarkInventoryItemAsActive(m_OwningEntity->GetObjectID(), false, eUnequippableActiveType::MOUNT, GetMountItemID(), m_OwningEntity->GetSystemAddress());
|
||||
@@ -43,14 +43,14 @@ void PossessorComponent::Mount(Entity* mount) {
|
||||
if (GetIsDismounting() || !mount) return;
|
||||
|
||||
GameMessages::SendSetMountInventoryID(m_OwningEntity, mount->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);
|
||||
auto possessableComponent = mount->GetComponent<PossessableComponent>();
|
||||
auto* possessableComponent = mount->GetComponent<PossessableComponent>();
|
||||
if (possessableComponent) {
|
||||
possessableComponent->SetPossessor(m_OwningEntity->GetObjectID());
|
||||
SetPossessable(mount->GetObjectID());
|
||||
SetPossessableType(possessableComponent->GetPossessionType());
|
||||
}
|
||||
|
||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
if (characterComponent) characterComponent->SetIsRacing(true);
|
||||
|
||||
// GM's to send
|
||||
@@ -68,7 +68,7 @@ void PossessorComponent::Dismount(Entity* mount, bool forceDismount) {
|
||||
SetIsDismounting(true);
|
||||
|
||||
if (mount) {
|
||||
auto possessableComponent = mount->GetComponent<PossessableComponent>();
|
||||
auto* possessableComponent = mount->GetComponent<PossessableComponent>();
|
||||
if (possessableComponent) {
|
||||
possessableComponent->SetPossessor(LWOOBJID_EMPTY);
|
||||
if (forceDismount) possessableComponent->ForceDepossess();
|
||||
@@ -76,7 +76,7 @@ void PossessorComponent::Dismount(Entity* mount, bool forceDismount) {
|
||||
EntityManager::Instance()->SerializeEntity(m_OwningEntity);
|
||||
EntityManager::Instance()->SerializeEntity(mount);
|
||||
|
||||
auto characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = m_OwningEntity->GetComponent<CharacterComponent>();
|
||||
if (characterComponent) characterComponent->SetIsRacing(false);
|
||||
}
|
||||
// Make sure we don't have wacky controls
|
||||
|
@@ -26,10 +26,10 @@ PropertyEntranceComponent::PropertyEntranceComponent(uint32_t componentID, Entit
|
||||
}
|
||||
|
||||
void PropertyEntranceComponent::OnUse(Entity* entity) {
|
||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||
if (!characterComponent) return;
|
||||
|
||||
auto rocket = entity->GetComponent<CharacterComponent>()->RocketEquip(entity);
|
||||
auto* rocket = entity->GetComponent<CharacterComponent>()->RocketEquip(entity);
|
||||
if (!rocket) return;
|
||||
|
||||
GameMessages::SendPropertyEntranceBegin(m_OwningEntity->GetObjectID(), entity->GetSystemAddress());
|
||||
@@ -63,7 +63,7 @@ void PropertyEntranceComponent::OnEnterProperty(Entity* entity, uint32_t index,
|
||||
cloneId = query[index].CloneId;
|
||||
}
|
||||
|
||||
auto launcher = m_OwningEntity->GetComponent<RocketLaunchpadControlComponent>();
|
||||
auto* launcher = m_OwningEntity->GetComponent<RocketLaunchpadControlComponent>();
|
||||
|
||||
if (launcher == nullptr) {
|
||||
return;
|
||||
|
@@ -263,7 +263,7 @@ void PropertyManagementComponent::OnStartBuilding() {
|
||||
SetPrivacyOption(PropertyPrivacyOption::Private); // Cant visit player which is building
|
||||
|
||||
if (!entrance.empty()) {
|
||||
auto rocketPad = entrance[0]->GetComponent<RocketLaunchpadControlComponent>();
|
||||
auto* rocketPad = entrance[0]->GetComponent<RocketLaunchpadControlComponent>();
|
||||
|
||||
if (rocketPad != nullptr) {
|
||||
zoneId = rocketPad->GetDefaultZone();
|
||||
@@ -275,7 +275,7 @@ void PropertyManagementComponent::OnStartBuilding() {
|
||||
|
||||
player->SendToZone(zoneId);
|
||||
}
|
||||
auto inventoryComponent = ownerEntity->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = ownerEntity->GetComponent<InventoryComponent>();
|
||||
|
||||
// Push equipped items
|
||||
if (inventoryComponent) inventoryComponent->PushEquippedItems();
|
||||
@@ -302,7 +302,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
|
||||
return;
|
||||
}
|
||||
|
||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent == nullptr) {
|
||||
return;
|
||||
@@ -404,7 +404,7 @@ void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const N
|
||||
EntityManager::Instance()->GetZoneControlEntity()->OnZonePropertyModelPlaced(entity);
|
||||
});
|
||||
// Progress place model missions
|
||||
auto missionComponent = entity->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = entity->GetComponent<MissionComponent>();
|
||||
if (missionComponent != nullptr) missionComponent->Progress(eMissionTaskType::PLACE_MODEL, 0);
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ void PropertyManagementComponent::DeleteModel(const LWOOBJID id, const int delet
|
||||
return;
|
||||
}
|
||||
|
||||
auto inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = entity->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent == nullptr) {
|
||||
return;
|
||||
|
@@ -86,7 +86,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
||||
return;
|
||||
}
|
||||
|
||||
auto inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||
|
||||
if (inventoryComponent == nullptr) {
|
||||
return;
|
||||
@@ -140,7 +140,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
||||
// Make the vehicle a child of the racing controller.
|
||||
m_OwningEntity->AddChild(carEntity);
|
||||
|
||||
auto destroyableComponent = carEntity->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = carEntity->GetComponent<DestroyableComponent>();
|
||||
|
||||
// Setup the vehicle stats.
|
||||
if (destroyableComponent != nullptr) {
|
||||
@@ -149,14 +149,14 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
||||
}
|
||||
|
||||
// Setup the vehicle as being possessed by the player.
|
||||
auto possessableComponent = carEntity->GetComponent<PossessableComponent>();
|
||||
auto* possessableComponent = carEntity->GetComponent<PossessableComponent>();
|
||||
|
||||
if (possessableComponent != nullptr) {
|
||||
possessableComponent->SetPossessor(player->GetObjectID());
|
||||
}
|
||||
|
||||
// Load the vehicle's assemblyPartLOTs for display.
|
||||
auto moduleAssemblyComponent = carEntity->GetComponent<ModuleAssemblyComponent>();
|
||||
auto* moduleAssemblyComponent = carEntity->GetComponent<ModuleAssemblyComponent>();
|
||||
|
||||
if (moduleAssemblyComponent) {
|
||||
moduleAssemblyComponent->SetSubKey(item->GetSubKey());
|
||||
@@ -171,7 +171,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
||||
}
|
||||
|
||||
// Setup the player as possessing the vehicle.
|
||||
auto possessorComponent = player->GetComponent<PossessorComponent>();
|
||||
auto* possessorComponent = player->GetComponent<PossessorComponent>();
|
||||
|
||||
if (possessorComponent != nullptr) {
|
||||
possessorComponent->SetPossessable(carEntity->GetObjectID());
|
||||
@@ -179,7 +179,7 @@ void RacingControlComponent::LoadPlayerVehicle(Entity* player,
|
||||
}
|
||||
|
||||
// Set the player's current activity as racing.
|
||||
auto characterComponent = player->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = player->GetComponent<CharacterComponent>();
|
||||
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->SetIsRacing(true);
|
||||
@@ -289,7 +289,7 @@ void RacingControlComponent::OnRequestDie(Entity* player) {
|
||||
GameMessages::SendDie(vehicle, vehicle->GetObjectID(), LWOOBJID_EMPTY, true,
|
||||
eKillType::VIOLENT, u"", 0, 0, 90.0f, false, true, 0);
|
||||
|
||||
auto destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||
uint32_t respawnImagination = 0;
|
||||
// Reset imagination to half its current value, rounded up to the nearest value divisible by 10, as it was done in live.
|
||||
// Do not actually change the value yet. Do that on respawn.
|
||||
@@ -314,13 +314,13 @@ void RacingControlComponent::OnRequestDie(Entity* player) {
|
||||
UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
GameMessages::SendResurrect(vehicle);
|
||||
auto destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||
// Reset imagination to half its current value, rounded up to the nearest value divisible by 10, as it was done in live.
|
||||
if (destroyableComponent) destroyableComponent->SetImagination(respawnImagination);
|
||||
EntityManager::Instance()->SerializeEntity(vehicle);
|
||||
});
|
||||
|
||||
auto characterComponent = player->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = player->GetComponent<CharacterComponent>();
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->UpdatePlayerStatistic(RacingTimesWrecked);
|
||||
}
|
||||
@@ -382,7 +382,7 @@ void RacingControlComponent::HandleMessageBoxResponse(Entity* player, int32_t bu
|
||||
m_OwningEntity->GetObjectID(), 2, 0, LWOOBJID_EMPTY, u"",
|
||||
player->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);
|
||||
|
||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||
|
||||
if (missionComponent == nullptr) return;
|
||||
|
||||
@@ -635,7 +635,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
vehicle->SetPosition(player.respawnPosition);
|
||||
vehicle->SetRotation(player.respawnRotation);
|
||||
|
||||
auto destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = vehicle->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent != nullptr) {
|
||||
destroyableComponent->SetImagination(0);
|
||||
@@ -812,7 +812,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
"Best lap time (%llu)", lapTime);
|
||||
}
|
||||
|
||||
auto missionComponent = playerEntity->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = playerEntity->GetComponent<MissionComponent>();
|
||||
|
||||
if (missionComponent != nullptr) {
|
||||
|
||||
@@ -835,7 +835,7 @@ void RacingControlComponent::Update(float deltaTime) {
|
||||
// Entire race time
|
||||
missionComponent->Progress(eMissionTaskType::RACING, (raceTime) * 1000, (LWOOBJID)eRacingTaskParam::TOTAL_TRACK_TIME);
|
||||
|
||||
auto characterComponent = playerEntity->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = playerEntity->GetComponent<CharacterComponent>();
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->TrackRaceCompleted(m_Finished == 1);
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ RailActivatorComponent::RailActivatorComponent(Entity* parent, int32_t component
|
||||
RailActivatorComponent::~RailActivatorComponent() = default;
|
||||
|
||||
void RailActivatorComponent::OnUse(Entity* originator) {
|
||||
auto rebuildComponent = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||
auto* rebuildComponent = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||
if (rebuildComponent != nullptr && rebuildComponent->GetState() != eRebuildState::COMPLETED)
|
||||
return;
|
||||
|
||||
@@ -116,7 +116,7 @@ void RailActivatorComponent::OnCancelRailMovement(Entity* originator) {
|
||||
true, true, true, true, true, true, true
|
||||
);
|
||||
|
||||
auto rebuildComponent = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||
auto* rebuildComponent = m_OwningEntity->GetComponent<RebuildComponent>();
|
||||
|
||||
if (rebuildComponent != nullptr) {
|
||||
// Set back reset time
|
||||
|
@@ -194,7 +194,7 @@ void RebuildComponent::Update(float deltaTime) {
|
||||
if (m_TimeBeforeDrain <= 0.0f) {
|
||||
m_TimeBeforeDrain = m_CompleteTime / static_cast<float>(m_TakeImagination);
|
||||
|
||||
auto destComp = builder->GetComponent<DestroyableComponent>();
|
||||
auto* destComp = builder->GetComponent<DestroyableComponent>();
|
||||
if (!destComp) break;
|
||||
|
||||
int newImagination = destComp->GetImagination();
|
||||
@@ -400,7 +400,7 @@ void RebuildComponent::StartRebuild(Entity* user) {
|
||||
if (m_State == eRebuildState::OPEN || m_State == eRebuildState::COMPLETED || m_State == eRebuildState::INCOMPLETE) {
|
||||
m_Builder = user->GetObjectID();
|
||||
|
||||
auto character = user->GetComponent<CharacterComponent>();
|
||||
auto* character = user->GetComponent<CharacterComponent>();
|
||||
character->SetCurrentActivity(eGameActivity::QUICKBUILDING);
|
||||
|
||||
EntityManager::Instance()->SerializeEntity(user);
|
||||
@@ -412,7 +412,7 @@ void RebuildComponent::StartRebuild(Entity* user) {
|
||||
m_StateDirty = true;
|
||||
EntityManager::Instance()->SerializeEntity(m_OwningEntity);
|
||||
|
||||
auto movingPlatform = m_OwningEntity->GetComponent<MovingPlatformComponent>();
|
||||
auto* movingPlatform = m_OwningEntity->GetComponent<MovingPlatformComponent>();
|
||||
if (movingPlatform != nullptr) {
|
||||
movingPlatform->OnRebuildInitilized();
|
||||
}
|
||||
@@ -434,7 +434,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto characterComponent = user->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = user->GetComponent<CharacterComponent>();
|
||||
if (characterComponent != nullptr) {
|
||||
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
||||
characterComponent->TrackRebuildComplete();
|
||||
@@ -478,12 +478,12 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
||||
for (const auto memberId : team->members) { // progress missions for all team members
|
||||
auto* member = EntityManager::Instance()->GetEntity(memberId);
|
||||
if (member) {
|
||||
auto missionComponent = member->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = member->GetComponent<MissionComponent>();
|
||||
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
||||
}
|
||||
}
|
||||
} else{
|
||||
auto missionComponent = builder->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = builder->GetComponent<MissionComponent>();
|
||||
if (missionComponent) missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityId);
|
||||
}
|
||||
LootGenerator::Instance().DropActivityLoot(builder, m_OwningEntity, m_ActivityId, 1);
|
||||
@@ -503,7 +503,7 @@ void RebuildComponent::CompleteRebuild(Entity* user) {
|
||||
|
||||
m_OwningEntity->TriggerEvent(eTriggerEventType::REBUILD_COMPLETE, user);
|
||||
|
||||
auto movingPlatform = m_OwningEntity->GetComponent<MovingPlatformComponent>();
|
||||
auto* movingPlatform = m_OwningEntity->GetComponent<MovingPlatformComponent>();
|
||||
if (movingPlatform != nullptr) {
|
||||
movingPlatform->OnCompleteRebuild();
|
||||
}
|
||||
@@ -588,7 +588,7 @@ void RebuildComponent::CancelRebuild(Entity* entity, eQuickBuildFailReason failR
|
||||
return;
|
||||
}
|
||||
|
||||
auto characterComponent = entity->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = entity->GetComponent<CharacterComponent>();
|
||||
if (characterComponent) {
|
||||
characterComponent->SetCurrentActivity(eGameActivity::NONE);
|
||||
EntityManager::Instance()->SerializeEntity(entity);
|
||||
|
@@ -214,7 +214,7 @@ float RenderComponent::GetAnimationTime(Entity* self, const std::string& animati
|
||||
float RenderComponent::DoAnimation(Entity* self, const std::string& animation, bool sendAnimation, float priority, float scale) {
|
||||
float returnlength = 0.0f;
|
||||
if (!self) return returnlength;
|
||||
auto renderComponent = self->GetComponent<RenderComponent>();
|
||||
auto* renderComponent = self->GetComponent<RenderComponent>();
|
||||
if (!renderComponent) return returnlength;
|
||||
|
||||
auto* animationsTable = CDClientManager::Instance().GetTable<CDAnimationsTable>();
|
||||
|
@@ -50,7 +50,7 @@ void RocketLaunchpadControlComponent::Launch(Entity* originator, LWOMAPID mapId,
|
||||
}
|
||||
|
||||
// This also gets triggered by a proximity monitor + item equip, I will set that up when havok is ready
|
||||
auto characterComponent = originator->GetComponent<CharacterComponent>();
|
||||
auto* characterComponent = originator->GetComponent<CharacterComponent>();
|
||||
auto* character = originator->GetCharacter();
|
||||
|
||||
if (!characterComponent || !character) return;
|
||||
@@ -89,18 +89,18 @@ void RocketLaunchpadControlComponent::OnUse(Entity* originator) {
|
||||
// instead we let their OnUse handlers do their things
|
||||
// which components of an Object have their OnUse called when using them
|
||||
// so we don't need to call it here
|
||||
auto propertyEntrance = m_OwningEntity->GetComponent<PropertyEntranceComponent>();
|
||||
auto* propertyEntrance = m_OwningEntity->GetComponent<PropertyEntranceComponent>();
|
||||
if (propertyEntrance) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto multiZoneEntranceComponent = m_OwningEntity->GetComponent<MultiZoneEntranceComponent>();
|
||||
auto* multiZoneEntranceComponent = m_OwningEntity->GetComponent<MultiZoneEntranceComponent>();
|
||||
if (multiZoneEntranceComponent) {
|
||||
return;
|
||||
}
|
||||
|
||||
// No rocket no launch
|
||||
auto rocket = originator->GetComponent<CharacterComponent>()->RocketEquip(originator);
|
||||
auto* rocket = originator->GetComponent<CharacterComponent>()->RocketEquip(originator);
|
||||
if (!rocket) {
|
||||
return;
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ ScriptedActivityComponent::ScriptedActivityComponent(Entity* parent, int activit
|
||||
}
|
||||
}
|
||||
|
||||
auto destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
auto* destroyableComponent = m_OwningEntity->GetComponent<DestroyableComponent>();
|
||||
|
||||
if (destroyableComponent) {
|
||||
// check for LMIs and set the loot LMIs
|
||||
@@ -305,7 +305,7 @@ bool ScriptedActivityComponent::IsValidActivity(Entity* player) {
|
||||
// Makes it so that scripted activities with an unimplemented map cannot be joined
|
||||
/*if (player->GetGMLevel() < eGameMasterLevel::DEVELOPER && (m_ActivityInfo.instanceMapID == 1302 || m_ActivityInfo.instanceMapID == 1301)) {
|
||||
if (m_OwningEntity->GetLOT() == 4860) {
|
||||
auto missionComponent = player->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||
missionComponent->CompleteMission(229);
|
||||
}
|
||||
|
||||
@@ -354,7 +354,7 @@ bool ScriptedActivityComponent::TakeCost(Entity* player) const {
|
||||
if (m_ActivityInfo.optionalCostLOT <= 0 || m_ActivityInfo.optionalCostCount <= 0)
|
||||
return true;
|
||||
|
||||
auto inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||
auto* inventoryComponent = player->GetComponent<InventoryComponent>();
|
||||
if (inventoryComponent == nullptr)
|
||||
return false;
|
||||
|
||||
@@ -555,7 +555,7 @@ void ActivityInstance::StartZone() {
|
||||
}
|
||||
|
||||
void ActivityInstance::RewardParticipant(Entity* participant) {
|
||||
auto missionComponent = participant->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = participant->GetComponent<MissionComponent>();
|
||||
if (missionComponent) {
|
||||
missionComponent->Progress(eMissionTaskType::ACTIVITY, m_ActivityInfo.ActivityID);
|
||||
}
|
||||
|
@@ -193,7 +193,7 @@ void SkillComponent::Reset() {
|
||||
|
||||
void SkillComponent::Interrupt() {
|
||||
// TODO: need to check immunities on the destroyable component, but they aren't implemented
|
||||
auto combat = m_OwningEntity->GetComponent<BaseCombatAIComponent>();
|
||||
auto* combat = m_OwningEntity->GetComponent<BaseCombatAIComponent>();
|
||||
if (combat != nullptr && combat->GetStunImmune()) return;
|
||||
|
||||
for (const auto& behavior : this->m_managedBehaviors) {
|
||||
|
@@ -196,7 +196,7 @@ void TriggerComponent::HandleDestroyObject(Entity* targetEntity, std::string arg
|
||||
}
|
||||
|
||||
void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string args){
|
||||
auto triggerComponent = targetEntity->GetComponent<TriggerComponent>();
|
||||
auto* triggerComponent = targetEntity->GetComponent<TriggerComponent>();
|
||||
if (!triggerComponent) {
|
||||
Game::logger->LogDebug("TriggerComponent::HandleToggleTrigger", "Trigger component not found!");
|
||||
return;
|
||||
@@ -205,7 +205,7 @@ void TriggerComponent::HandleToggleTrigger(Entity* targetEntity, std::string arg
|
||||
}
|
||||
|
||||
void TriggerComponent::HandleResetRebuild(Entity* targetEntity, std::string args){
|
||||
auto rebuildComponent = targetEntity->GetComponent<RebuildComponent>();
|
||||
auto* rebuildComponent = targetEntity->GetComponent<RebuildComponent>();
|
||||
if (!rebuildComponent) {
|
||||
Game::logger->LogDebug("TriggerComponent::HandleResetRebuild", "Rebuild component not found!");
|
||||
return;
|
||||
@@ -237,7 +237,7 @@ void TriggerComponent::HandleRotateObject(Entity* targetEntity, std::vector<std:
|
||||
void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::string> argArray){
|
||||
if (argArray.size() < 3) return;
|
||||
|
||||
auto phantomPhysicsComponent = m_OwningEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
auto* phantomPhysicsComponent = m_OwningEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
Game::logger->LogDebug("TriggerComponent::HandlePushObject", "Phantom Physics component not found!");
|
||||
return;
|
||||
@@ -254,7 +254,7 @@ void TriggerComponent::HandlePushObject(Entity* targetEntity, std::vector<std::s
|
||||
|
||||
|
||||
void TriggerComponent::HandleRepelObject(Entity* targetEntity, std::string args){
|
||||
auto phantomPhysicsComponent = m_OwningEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
auto* phantomPhysicsComponent = m_OwningEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
Game::logger->LogDebug("TriggerComponent::HandleRepelObject", "Phantom Physics component not found!");
|
||||
return;
|
||||
@@ -334,7 +334,7 @@ void TriggerComponent::HandleUpdateMission(Entity* targetEntity, std::vector<std
|
||||
// If others need to be implemented for modding
|
||||
// then we need a good way to convert this from a string to that enum
|
||||
if (argArray.at(0) != "exploretask") return;
|
||||
auto missionComponent = targetEntity->GetComponent<MissionComponent>();
|
||||
auto* missionComponent = targetEntity->GetComponent<MissionComponent>();
|
||||
if (!missionComponent){
|
||||
Game::logger->LogDebug("TriggerComponent::HandleUpdateMission", "Mission component not found!");
|
||||
return;
|
||||
@@ -353,7 +353,7 @@ void TriggerComponent::HandlePlayEffect(Entity* targetEntity, std::vector<std::s
|
||||
}
|
||||
|
||||
void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
|
||||
auto skillComponent = targetEntity->GetComponent<SkillComponent>();
|
||||
auto* skillComponent = targetEntity->GetComponent<SkillComponent>();
|
||||
if (!skillComponent) {
|
||||
Game::logger->LogDebug("TriggerComponent::HandleCastSkill", "Skill component not found!");
|
||||
return;
|
||||
@@ -364,7 +364,7 @@ void TriggerComponent::HandleCastSkill(Entity* targetEntity, std::string args){
|
||||
}
|
||||
|
||||
void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::vector<std::string> argArray) {
|
||||
auto phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
auto* phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
Game::logger->LogDebug("TriggerComponent::HandleSetPhysicsVolumeEffect", "Phantom Physics component not found!");
|
||||
return;
|
||||
@@ -399,7 +399,7 @@ void TriggerComponent::HandleSetPhysicsVolumeEffect(Entity* targetEntity, std::v
|
||||
}
|
||||
|
||||
void TriggerComponent::HandleSetPhysicsVolumeStatus(Entity* targetEntity, std::string args) {
|
||||
auto phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
auto* phantomPhysicsComponent = targetEntity->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!phantomPhysicsComponent) {
|
||||
Game::logger->LogDebug("TriggerComponent::HandleSetPhysicsVolumeEffect", "Phantom Physics component not found!");
|
||||
return;
|
||||
|
Reference in New Issue
Block a user