Rename from GetOwningEntity to GetParentEntity

This commit is contained in:
David Markowitz 2023-06-09 01:28:01 -07:00
parent e2dfa1809d
commit f555ba8c25
14 changed files with 53 additions and 53 deletions

View File

@ -162,7 +162,7 @@ void BasicAttackBehavior::DoBehaviorCalculation(BehaviorContext* context, RakNet
} }
auto* destroyableComponent = targetEntity->GetComponent<DestroyableComponent>(); auto* destroyableComponent = targetEntity->GetComponent<DestroyableComponent>();
if (!destroyableComponent || !destroyableComponent->GetOwningEntity()) { if (!destroyableComponent || !destroyableComponent->GetParentEntity()) {
Game::logger->Log("BasicAttackBehavior", "No destroyable component on %llu", branch.target); Game::logger->Log("BasicAttackBehavior", "No destroyable component on %llu", branch.target);
return; return;
} }

View File

@ -149,7 +149,7 @@ void BuffComponent::ApplyBuffEffect(int32_t id) {
if (parameter.name == "max_health") { if (parameter.name == "max_health") {
const auto maxHealth = parameter.value; const auto maxHealth = parameter.value;
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>(); auto* destroyable = this->GetParentEntity()->GetComponent<DestroyableComponent>();
if (destroyable == nullptr) return; if (destroyable == nullptr) return;
@ -157,7 +157,7 @@ void BuffComponent::ApplyBuffEffect(int32_t id) {
} else if (parameter.name == "max_armor") { } else if (parameter.name == "max_armor") {
const auto maxArmor = parameter.value; const auto maxArmor = parameter.value;
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>(); auto* destroyable = this->GetParentEntity()->GetComponent<DestroyableComponent>();
if (destroyable == nullptr) return; if (destroyable == nullptr) return;
@ -165,13 +165,13 @@ void BuffComponent::ApplyBuffEffect(int32_t id) {
} else if (parameter.name == "max_imagination") { } else if (parameter.name == "max_imagination") {
const auto maxImagination = parameter.value; const auto maxImagination = parameter.value;
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>(); auto* destroyable = this->GetParentEntity()->GetComponent<DestroyableComponent>();
if (destroyable == nullptr) return; if (destroyable == nullptr) return;
destroyable->SetMaxImagination(destroyable->GetMaxImagination() + maxImagination); destroyable->SetMaxImagination(destroyable->GetMaxImagination() + maxImagination);
} else if (parameter.name == "speed") { } else if (parameter.name == "speed") {
auto* controllablePhysicsComponent = this->GetOwningEntity()->GetComponent<ControllablePhysicsComponent>(); auto* controllablePhysicsComponent = this->GetParentEntity()->GetComponent<ControllablePhysicsComponent>();
if (!controllablePhysicsComponent) return; if (!controllablePhysicsComponent) return;
const auto speed = parameter.value; const auto speed = parameter.value;
controllablePhysicsComponent->AddSpeedboost(speed); controllablePhysicsComponent->AddSpeedboost(speed);
@ -185,7 +185,7 @@ void BuffComponent::RemoveBuffEffect(int32_t id) {
if (parameter.name == "max_health") { if (parameter.name == "max_health") {
const auto maxHealth = parameter.value; const auto maxHealth = parameter.value;
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>(); auto* destroyable = this->GetParentEntity()->GetComponent<DestroyableComponent>();
if (destroyable == nullptr) return; if (destroyable == nullptr) return;
@ -193,7 +193,7 @@ void BuffComponent::RemoveBuffEffect(int32_t id) {
} else if (parameter.name == "max_armor") { } else if (parameter.name == "max_armor") {
const auto maxArmor = parameter.value; const auto maxArmor = parameter.value;
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>(); auto* destroyable = this->GetParentEntity()->GetComponent<DestroyableComponent>();
if (destroyable == nullptr) return; if (destroyable == nullptr) return;
@ -201,13 +201,13 @@ void BuffComponent::RemoveBuffEffect(int32_t id) {
} else if (parameter.name == "max_imagination") { } else if (parameter.name == "max_imagination") {
const auto maxImagination = parameter.value; const auto maxImagination = parameter.value;
auto* destroyable = this->GetOwningEntity()->GetComponent<DestroyableComponent>(); auto* destroyable = this->GetParentEntity()->GetComponent<DestroyableComponent>();
if (destroyable == nullptr) return; if (destroyable == nullptr) return;
destroyable->SetMaxImagination(destroyable->GetMaxImagination() - maxImagination); destroyable->SetMaxImagination(destroyable->GetMaxImagination() - maxImagination);
} else if (parameter.name == "speed") { } else if (parameter.name == "speed") {
auto* controllablePhysicsComponent = this->GetOwningEntity()->GetComponent<ControllablePhysicsComponent>(); auto* controllablePhysicsComponent = this->GetParentEntity()->GetComponent<ControllablePhysicsComponent>();
if (!controllablePhysicsComponent) return; if (!controllablePhysicsComponent) return;
const auto speed = parameter.value; const auto speed = parameter.value;
controllablePhysicsComponent->RemoveSpeedboost(speed); controllablePhysicsComponent->RemoveSpeedboost(speed);
@ -233,7 +233,7 @@ void BuffComponent::ReApplyBuffs() {
} }
} }
Entity* BuffComponent::GetOwningEntity() const { Entity* BuffComponent::GetParentEntity() const {
return m_OwningEntity; return m_OwningEntity;
} }

View File

@ -48,7 +48,7 @@ public:
~BuffComponent(); ~BuffComponent();
Entity* GetOwningEntity() const; Entity* GetParentEntity() const;
void LoadFromXml(tinyxml2::XMLDocument* doc) override; void LoadFromXml(tinyxml2::XMLDocument* doc) override;

View File

@ -20,7 +20,7 @@ public:
* Gets the owner of this component * Gets the owner of this component
* @return the owner of this component * @return the owner of this component
*/ */
Entity* GetOwningEntity() const { return m_OwningEntity; }; Entity* GetParentEntity() const { return m_OwningEntity; };
/** /**
* Event called when this component is being used, e.g. when some entity interacted with it * Event called when this component is being used, e.g. when some entity interacted with it

View File

@ -872,7 +872,7 @@ void DestroyableComponent::SetStatusImmunity(
} }
void DestroyableComponent::FixStats() { void DestroyableComponent::FixStats() {
auto* entity = GetOwningEntity(); auto* entity = GetParentEntity();
if (entity == nullptr) return; if (entity == nullptr) return;

View File

@ -261,7 +261,7 @@ void InventoryComponent::AddItem(
} }
if (slot == -1) { if (slot == -1) {
auto* player = dynamic_cast<Player*>(GetOwningEntity()); auto* player = dynamic_cast<Player*>(GetParentEntity());
if (player == nullptr) { if (player == nullptr) {
return; return;
@ -687,7 +687,7 @@ void InventoryComponent::UpdateXml(tinyxml2::XMLDocument* document) {
itemElement->SetAttribute("sk", item->GetSubKey()); itemElement->SetAttribute("sk", item->GetSubKey());
// Begin custom xml // Begin custom xml
itemElement->SetAttribute("parent", item->GetOwningEntity()); itemElement->SetAttribute("parent", item->GetParentEntity());
// End custom xml // End custom xml
for (auto* data : item->GetConfig()) { for (auto* data : item->GetConfig()) {
@ -913,7 +913,7 @@ void InventoryComponent::UnEquipItem(Item* item) {
// Trigger property event // Trigger property event
if (PropertyManagementComponent::Instance() != nullptr && item->GetCount() > 0 && Inventory::FindInventoryTypeForLot(item->GetLot()) == MODELS) { if (PropertyManagementComponent::Instance() != nullptr && item->GetCount() > 0 && Inventory::FindInventoryTypeForLot(item->GetLot()) == MODELS) {
PropertyManagementComponent::Instance()->GetOwningEntity()->OnZonePropertyModelRemovedWhileEquipped(m_OwningEntity); PropertyManagementComponent::Instance()->GetParentEntity()->OnZonePropertyModelRemovedWhileEquipped(m_OwningEntity);
dZoneManager::Instance()->GetZoneControlObject()->OnZonePropertyModelRemovedWhileEquipped(m_OwningEntity); dZoneManager::Instance()->GetZoneControlObject()->OnZonePropertyModelRemovedWhileEquipped(m_OwningEntity);
} }
} }
@ -1356,7 +1356,7 @@ std::vector<uint32_t> InventoryComponent::FindBuffs(Item* item, bool castOnEquip
} }
// If item is not a proxy, add its buff to the added buffs. // If item is not a proxy, add its buff to the added buffs.
if (item->GetOwningEntity() == LWOOBJID_EMPTY) buffs.push_back(static_cast<uint32_t>(entry.behaviorID)); if (item->GetParentEntity() == LWOOBJID_EMPTY) buffs.push_back(static_cast<uint32_t>(entry.behaviorID));
} }
} }
@ -1442,7 +1442,7 @@ std::vector<Item*> InventoryComponent::FindProxies(const LWOOBJID parent) {
for (const auto& pair : inventory->GetItems()) { for (const auto& pair : inventory->GetItems()) {
auto* item = pair.second; auto* item = pair.second;
if (item->GetOwningEntity() == parent) { if (item->GetParentEntity() == parent) {
proxies.push_back(item); proxies.push_back(item);
} }
} }
@ -1479,7 +1479,7 @@ bool InventoryComponent::IsParentValid(Item* root) {
for (const auto& candidate : items) { for (const auto& candidate : items) {
auto* item = candidate.second; auto* item = candidate.second;
if (item->GetOwningEntity() == id) { if (item->GetParentEntity() == id) {
return true; return true;
} }
} }
@ -1497,7 +1497,7 @@ void InventoryComponent::CheckProxyIntegrity() {
for (const auto& candidate : items) { for (const auto& candidate : items) {
auto* item = candidate.second; auto* item = candidate.second;
const auto parent = item->GetOwningEntity(); const auto parent = item->GetParentEntity();
if (parent == LWOOBJID_EMPTY) { if (parent == LWOOBJID_EMPTY) {
continue; continue;
@ -1526,7 +1526,7 @@ void InventoryComponent::CheckProxyIntegrity() {
{ {
auto* item = candidate.second; auto* item = candidate.second;
const auto parent = item->GetOwningEntity(); const auto parent = item->GetParentEntity();
if (parent != LWOOBJID_EMPTY) if (parent != LWOOBJID_EMPTY)
{ {
@ -1555,7 +1555,7 @@ void InventoryComponent::CheckProxyIntegrity() {
} }
void InventoryComponent::PurgeProxies(Item* item) { void InventoryComponent::PurgeProxies(Item* item) {
const auto root = item->GetOwningEntity(); const auto root = item->GetParentEntity();
if (root != LWOOBJID_EMPTY) { if (root != LWOOBJID_EMPTY) {
item = FindItemById(root); item = FindItemById(root);

View File

@ -846,7 +846,7 @@ void PetComponent::Activate(Item* item, bool registerPet, bool fromTaming) {
inventoryComponent->DespawnPet(); inventoryComponent->DespawnPet();
m_Owner = inventoryComponent->GetOwningEntity()->GetObjectID(); m_Owner = inventoryComponent->GetParentEntity()->GetObjectID();
auto* owner = GetOwner(); auto* owner = GetOwner();
@ -910,7 +910,7 @@ void PetComponent::AddDrainImaginationTimer(Item* item, bool fromTaming) {
auto playerInventoryComponent = playerInventory->GetComponent(); auto playerInventoryComponent = playerInventory->GetComponent();
if (!playerInventoryComponent) return; if (!playerInventoryComponent) return;
auto playerEntity = playerInventoryComponent->GetOwningEntity(); auto playerEntity = playerInventoryComponent->GetParentEntity();
if (!playerEntity) return; if (!playerEntity) return;
auto* playerDestroyableComponent = playerEntity->GetComponent<DestroyableComponent>(); auto* playerDestroyableComponent = playerEntity->GetComponent<DestroyableComponent>();
@ -929,7 +929,7 @@ void PetComponent::AddDrainImaginationTimer(Item* item, bool fromTaming) {
// If we are out of imagination despawn the pet. // If we are out of imagination despawn the pet.
if (playerDestroyableComponent->GetImagination() == 0) { if (playerDestroyableComponent->GetImagination() == 0) {
this->Deactivate(); this->Deactivate();
auto playerEntity = playerDestroyableComponent->GetOwningEntity(); auto playerEntity = playerDestroyableComponent->GetParentEntity();
if (!playerEntity) return; if (!playerEntity) return;
GameMessages::SendUseItemRequirementsResponse(playerEntity->GetObjectID(), playerEntity->GetSystemAddress(), eUseItemResponse::NoImaginationForPet); GameMessages::SendUseItemRequirementsResponse(playerEntity->GetObjectID(), playerEntity->GetSystemAddress(), eUseItemResponse::NoImaginationForPet);

View File

@ -1985,7 +1985,7 @@ void GameMessages::SendOpenPropertyManagment(const LWOOBJID objectId, const Syst
CBITSTREAM; CBITSTREAM;
CMSGHEADER; CMSGHEADER;
bitStream.Write(PropertyManagementComponent::Instance()->GetOwningEntity()->GetObjectID()); bitStream.Write(PropertyManagementComponent::Instance()->GetParentEntity()->GetObjectID());
bitStream.Write(eGameMessageType::OPEN_PROPERTY_MANAGEMENT); bitStream.Write(eGameMessageType::OPEN_PROPERTY_MANAGEMENT);
if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST; if (sysAddr == UNASSIGNED_SYSTEM_ADDRESS) SEND_PACKET_BROADCAST;

View File

@ -76,7 +76,7 @@ void Inventory::SetSize(const uint32_t value) {
size = value; size = value;
GameMessages::SendSetInventorySize(component->GetOwningEntity(), type, static_cast<int>(size)); GameMessages::SendSetInventorySize(component->GetParentEntity(), type, static_cast<int>(size));
} }
int32_t Inventory::FindEmptySlot() { int32_t Inventory::FindEmptySlot() {

View File

@ -92,7 +92,7 @@ Item::Item(
inventory->AddManagedItem(this); inventory->AddManagedItem(this);
auto entity = inventory->GetComponent()->GetOwningEntity(); auto entity = inventory->GetComponent()->GetParentEntity();
GameMessages::SendAddItemToInventoryClientSync(entity, entity->GetSystemAddress(), this, id, showFlyingLoot, static_cast<int>(this->count), subKey, lootSourceType); GameMessages::SendAddItemToInventoryClientSync(entity, entity->GetSystemAddress(), this, id, showFlyingLoot, static_cast<int>(this->count), subKey, lootSourceType);
if (isModMoveAndEquip) { if (isModMoveAndEquip) {
@ -100,7 +100,7 @@ Item::Item(
Game::logger->Log("Item", "Move and equipped (%i) from (%i)", this->lot, this->inventory->GetType()); Game::logger->Log("Item", "Move and equipped (%i) from (%i)", this->lot, this->inventory->GetType());
EntityManager::Instance()->SerializeEntity(inventory->GetComponent()->GetOwningEntity()); EntityManager::Instance()->SerializeEntity(inventory->GetComponent()->GetParentEntity());
} }
} }
@ -136,7 +136,7 @@ Inventory* Item::GetInventory() const {
return inventory; return inventory;
} }
LWOOBJID Item::GetOwningEntity() const { LWOOBJID Item::GetParentEntity() const {
return parent; return parent;
} }
@ -166,7 +166,7 @@ void Item::SetCount(const uint32_t value, const bool silent, const bool disassem
} }
if (!silent) { if (!silent) {
auto entity = inventory->GetComponent()->GetOwningEntity(); auto entity = inventory->GetComponent()->GetParentEntity();
if (value > count) { if (value > count) {
GameMessages::SendAddItemToInventoryClientSync(entity, entity->GetSystemAddress(), this, id, showFlyingLoot, delta, LWOOBJID_EMPTY, lootSourceType); GameMessages::SendAddItemToInventoryClientSync(entity, entity->GetSystemAddress(), this, id, showFlyingLoot, delta, LWOOBJID_EMPTY, lootSourceType);
@ -262,7 +262,7 @@ bool Item::Consume() {
Game::logger->LogDebug("Item", "Consumed LOT (%i) itemID (%llu). Success=(%d)", lot, id, success); Game::logger->LogDebug("Item", "Consumed LOT (%i) itemID (%llu). Success=(%d)", lot, id, success);
GameMessages::SendUseItemResult(inventory->GetComponent()->GetOwningEntity(), lot, success); GameMessages::SendUseItemResult(inventory->GetComponent()->GetParentEntity(), lot, success);
if (success) { if (success) {
inventory->GetComponent()->RemoveItem(lot, 1); inventory->GetComponent()->RemoveItem(lot, 1);
@ -284,7 +284,7 @@ void Item::UseNonEquip(Item* item) {
return; return;
} }
auto* playerEntity = playerInventoryComponent->GetOwningEntity(); auto* playerEntity = playerInventoryComponent->GetParentEntity();
if (!playerEntity) { if (!playerEntity) {
Game::logger->LogDebug("Item", "no player entity attached to inventory? item id is %llu", this->GetId()); Game::logger->LogDebug("Item", "no player entity attached to inventory? item id is %llu", this->GetId());
return; return;
@ -314,8 +314,8 @@ void Item::UseNonEquip(Item* item) {
auto success = !packages.empty(); auto success = !packages.empty();
if (success) { if (success) {
if (this->GetPreconditionExpression()->Check(playerInventoryComponent->GetOwningEntity())) { if (this->GetPreconditionExpression()->Check(playerInventoryComponent->GetParentEntity())) {
auto* entityParent = playerInventoryComponent->GetOwningEntity(); auto* entityParent = playerInventoryComponent->GetParentEntity();
// Roll the loot for all the packages then see if it all fits. If it fits, give it to the player, otherwise don't. // Roll the loot for all the packages then see if it all fits. If it fits, give it to the player, otherwise don't.
std::unordered_map<LOT, int32_t> rolledLoot{}; std::unordered_map<LOT, int32_t> rolledLoot{};
for (auto& pack : packages) { for (auto& pack : packages) {
@ -331,15 +331,15 @@ void Item::UseNonEquip(Item* item) {
} }
} }
if (playerInventoryComponent->HasSpaceForLoot(rolledLoot)) { if (playerInventoryComponent->HasSpaceForLoot(rolledLoot)) {
LootGenerator::Instance().GiveLoot(playerInventoryComponent->GetOwningEntity(), rolledLoot, eLootSourceType::CONSUMPTION); LootGenerator::Instance().GiveLoot(playerInventoryComponent->GetParentEntity(), rolledLoot, eLootSourceType::CONSUMPTION);
item->SetCount(item->GetCount() - 1); item->SetCount(item->GetCount() - 1);
} else { } else {
success = false; success = false;
} }
} else { } else {
GameMessages::SendUseItemRequirementsResponse( GameMessages::SendUseItemRequirementsResponse(
playerInventoryComponent->GetOwningEntity()->GetObjectID(), playerInventoryComponent->GetParentEntity()->GetObjectID(),
playerInventoryComponent->GetOwningEntity()->GetSystemAddress(), playerInventoryComponent->GetParentEntity()->GetSystemAddress(),
eUseItemResponse::FailedPrecondition eUseItemResponse::FailedPrecondition
); );
success = false; success = false;
@ -347,7 +347,7 @@ void Item::UseNonEquip(Item* item) {
} }
} }
Game::logger->LogDebug("Item", "Player %llu %s used item %i", playerEntity->GetObjectID(), success ? "successfully" : "unsuccessfully", thisLot); Game::logger->LogDebug("Item", "Player %llu %s used item %i", playerEntity->GetObjectID(), success ? "successfully" : "unsuccessfully", thisLot);
GameMessages::SendUseItemResult(playerInventoryComponent->GetOwningEntity(), thisLot, success); GameMessages::SendUseItemResult(playerInventoryComponent->GetParentEntity(), thisLot, success);
} }
} }
@ -360,7 +360,7 @@ void Item::Disassemble(const eInventoryType inventoryType) {
if (GetInventory()) { if (GetInventory()) {
auto inventoryComponent = GetInventory()->GetComponent(); auto inventoryComponent = GetInventory()->GetComponent();
if (inventoryComponent) { if (inventoryComponent) {
auto entity = inventoryComponent->GetOwningEntity(); auto entity = inventoryComponent->GetParentEntity();
if (entity) entity->SetVar<std::string>(u"currentModifiedBuild", modStr); if (entity) entity->SetVar<std::string>(u"currentModifiedBuild", modStr);
} }
} }

View File

@ -150,7 +150,7 @@ public:
* Returns the parent of this item, e.g. for proxy items * Returns the parent of this item, e.g. for proxy items
* @return the parent of this item * @return the parent of this item
*/ */
LWOOBJID GetOwningEntity() const; LWOOBJID GetParentEntity() const;
/** /**
* Sets the subkey for this item, e.g. for pets * Sets the subkey for this item, e.g. for pets

View File

@ -15,7 +15,7 @@ ItemSet::ItemSet(const uint32_t id, InventoryComponent* inventoryComponent) {
this->m_ID = id; this->m_ID = id;
this->m_InventoryComponent = inventoryComponent; this->m_InventoryComponent = inventoryComponent;
this->m_PassiveAbilities = ItemSetPassiveAbility::FindAbilities(id, m_InventoryComponent->GetOwningEntity(), this); this->m_PassiveAbilities = ItemSetPassiveAbility::FindAbilities(id, m_InventoryComponent->GetParentEntity(), this);
auto query = CDClientDatabase::CreatePreppedStmt( auto query = CDClientDatabase::CreatePreppedStmt(
"SELECT skillSetWith2, skillSetWith3, skillSetWith4, skillSetWith5, skillSetWith6, itemIDs FROM ItemSets WHERE setID = ?;"); "SELECT skillSetWith2, skillSetWith3, skillSetWith4, skillSetWith5, skillSetWith6, itemIDs FROM ItemSets WHERE setID = ?;");
@ -125,8 +125,8 @@ void ItemSet::OnEquip(const LOT lot) {
return; return;
} }
auto* skillComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<SkillComponent>(); auto* skillComponent = m_InventoryComponent->GetParentEntity()->GetComponent<SkillComponent>();
auto* missionComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<MissionComponent>(); auto* missionComponent = m_InventoryComponent->GetParentEntity()->GetComponent<MissionComponent>();
for (const auto skill : skillSet) { for (const auto skill : skillSet) {
auto* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>(); auto* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>();
@ -135,7 +135,7 @@ void ItemSet::OnEquip(const LOT lot) {
missionComponent->Progress(eMissionTaskType::USE_SKILL, skill); missionComponent->Progress(eMissionTaskType::USE_SKILL, skill);
skillComponent->HandleUnmanaged(behaviorId, m_InventoryComponent->GetOwningEntity()->GetObjectID()); skillComponent->HandleUnmanaged(behaviorId, m_InventoryComponent->GetParentEntity()->GetObjectID());
} }
} }
@ -158,14 +158,14 @@ void ItemSet::OnUnEquip(const LOT lot) {
return; return;
} }
const auto* skillComponent = m_InventoryComponent->GetOwningEntity()->GetComponent<SkillComponent>(); const auto* skillComponent = m_InventoryComponent->GetParentEntity()->GetComponent<SkillComponent>();
for (const auto skill : skillSet) { for (const auto skill : skillSet) {
auto* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>(); auto* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>();
const auto behaviorId = skillTable->GetSkillByID(skill).behaviorID; const auto behaviorId = skillTable->GetSkillByID(skill).behaviorID;
skillComponent->HandleUnCast(behaviorId, m_InventoryComponent->GetOwningEntity()->GetObjectID()); skillComponent->HandleUnCast(behaviorId, m_InventoryComponent->GetParentEntity()->GetObjectID());
} }
} }

View File

@ -204,7 +204,7 @@ bool Mission::IsValidMission(const uint32_t missionId, CDMissions& info) {
} }
Entity* Mission::GetAssociate() const { Entity* Mission::GetAssociate() const {
return m_MissionComponent->GetOwningEntity(); return m_MissionComponent->GetParentEntity();
} }
User* Mission::GetUser() const { User* Mission::GetUser() const {

View File

@ -47,11 +47,11 @@ void ControlBehaviors::RequestUpdatedID(int32_t behaviorID, ModelBehaviorCompone
// args.InsertValue("behaviorID", behaviorIDString); // args.InsertValue("behaviorID", behaviorIDString);
// AMFStringValue* objectIDAsString = new AMFStringValue(); // AMFStringValue* objectIDAsString = new AMFStringValue();
// objectIDAsString->SetValue(std::to_string(modelComponent->GetOwningEntity()->GetObjectID())); // objectIDAsString->SetValue(std::to_string(modelComponent->GetParentEntity()->GetObjectID()));
// args.InsertValue("objectID", objectIDAsString); // args.InsertValue("objectID", objectIDAsString);
// GameMessages::SendUIMessageServerToSingleClient(modelOwner, sysAddr, "UpdateBehaviorID", &args); // GameMessages::SendUIMessageServerToSingleClient(modelOwner, sysAddr, "UpdateBehaviorID", &args);
// ControlBehaviors::SendBehaviorListToClient(modelComponent->GetOwningEntity(), sysAddr, modelOwner); // ControlBehaviors::SendBehaviorListToClient(modelComponent->GetParentEntity(), sysAddr, modelOwner);
// }); // });
// } // }
} }
@ -74,7 +74,7 @@ void ControlBehaviors::SendBehaviorListToClient(Entity* modelEntity, const Syste
*/ */
behaviorsToSerialize.Insert("behaviors"); behaviorsToSerialize.Insert("behaviors");
behaviorsToSerialize.Insert("objectID", std::to_string(modelComponent->GetOwningEntity()->GetObjectID())); behaviorsToSerialize.Insert("objectID", std::to_string(modelComponent->GetParentEntity()->GetObjectID()));
GameMessages::SendUIMessageServerToSingleClient(modelOwner, sysAddr, "UpdateBehaviorList", behaviorsToSerialize); GameMessages::SendUIMessageServerToSingleClient(modelOwner, sysAddr, "UpdateBehaviorList", behaviorsToSerialize);
} }
@ -197,7 +197,7 @@ void ControlBehaviors::SendBehaviorBlocksToClient(ModelBehaviorComponent* modelC
// uiArray->InsertValue("x", xPosition); // uiArray->InsertValue("x", xPosition);
// thisStrip->InsertValue("ui", uiArray); // thisStrip->InsertValue("ui", uiArray);
// targetObjectID = modelComponent->GetOwningEntity()->GetObjectID(); // targetObjectID = modelComponent->GetParentEntity()->GetObjectID();
// behaviorID = modelBehavior->GetBehaviorID(); // behaviorID = modelBehavior->GetBehaviorID();
// AMFArrayValue* stripSerialize = new AMFArrayValue(); // AMFArrayValue* stripSerialize = new AMFArrayValue();
@ -276,7 +276,7 @@ void ControlBehaviors::MoveToInventory(ModelBehaviorComponent* modelComponent, c
MoveToInventoryMessage moveToInventoryMessage(arguments); MoveToInventoryMessage moveToInventoryMessage(arguments);
SendBehaviorListToClient(modelComponent->GetOwningEntity(), sysAddr, modelOwner); SendBehaviorListToClient(modelComponent->GetParentEntity(), sysAddr, modelOwner);
} }
void ControlBehaviors::ProcessCommand(Entity* modelEntity, const SystemAddress& sysAddr, AMFArrayValue* arguments, std::string command, Entity* modelOwner) { void ControlBehaviors::ProcessCommand(Entity* modelEntity, const SystemAddress& sysAddr, AMFArrayValue* arguments, std::string command, Entity* modelOwner) {