rename possessor to possession

This commit is contained in:
Aaron Kimbre 2023-06-26 12:36:36 -05:00
parent d29287f9d9
commit 68f90b7136
18 changed files with 88 additions and 88 deletions

View File

@ -114,7 +114,7 @@ enum class eReplicaComponentType : uint32_t {
CRAFTING,
POSSESSABLE,
LEVEL_PROGRESSION,
POSSESSOR,
POSSESSION,
MOUNT_CONTROL,
UNKNOWN_112,
PROPERTY_PLAQUE,

View File

@ -28,7 +28,7 @@ set(DGAME_DCOMPONENTS_SOURCES "AchievementVendorComponent.cpp"
"PhantomPhysicsComponent.cpp"
"PlayerForcedMovementComponent.cpp"
"PossessableComponent.cpp"
"PossessorComponent.cpp"
"PossessionComponent.cpp"
"PropertyComponent.cpp"
"PropertyEntranceComponent.cpp"
"PropertyManagementComponent.cpp"

View File

@ -28,7 +28,7 @@
#include "MissionComponent.h"
#include "CharacterComponent.h"
#include "PossessableComponent.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "InventoryComponent.h"
#include "dZoneManager.h"
#include "WorldConfig.h"
@ -646,7 +646,7 @@ void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, uint32
}
// Dismount on the possessor hit
auto* possessor = m_ParentEntity->GetComponent<PossessorComponent>();
auto* possessor = m_ParentEntity->GetComponent<PossessionComponent>();
if (possessor) {
auto possessableId = possessor->GetPossessable();
if (possessableId != LWOOBJID_EMPTY) {

View File

@ -16,7 +16,7 @@
#include "ItemSet.h"
#include "Player.h"
#include "PetComponent.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "PossessableComponent.h"
#include "ModuleAssemblyComponent.h"
#include "HavokVehiclePhysicsComponent.h"
@ -961,25 +961,25 @@ void InventoryComponent::HandlePossession(Item* item) {
auto* characterComponent = m_ParentEntity->GetComponent<CharacterComponent>();
if (!characterComponent) return;
auto* possessorComponent = m_ParentEntity->GetComponent<PossessorComponent>();
if (!possessorComponent) return;
auto* possessionComponent = m_ParentEntity->GetComponent<PossessionComponent>();
if (!possessionComponent) return;
// Don't do anything if we are busy dismounting
if (possessorComponent->GetIsDismounting()) return;
if (possessionComponent->GetIsDismounting()) return;
// Check to see if we are already mounting something
auto* currentlyPossessedEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
auto currentlyPossessedItem = possessorComponent->GetMountItemID();
auto* currentlyPossessedEntity = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
auto currentlyPossessedItem = possessionComponent->GetMountItemID();
if (currentlyPossessedItem) {
if (currentlyPossessedEntity) possessorComponent->Dismount(currentlyPossessedEntity);
if (currentlyPossessedEntity) possessionComponent->Dismount(currentlyPossessedEntity);
return;
}
GameMessages::SendSetStunned(m_ParentEntity->GetObjectID(), eStateChangeType::PUSH, m_ParentEntity->GetSystemAddress(), LWOOBJID_EMPTY, true, false, true, false, false, false, false, true, true, true, true, true, true, true, true, true);
// Set the mount Item ID so that we know what were handling
possessorComponent->SetMountItemID(item->GetId());
possessionComponent->SetMountItemID(item->GetId());
GameMessages::SendSetMountInventoryID(m_ParentEntity, item->GetId(), UNASSIGNED_SYSTEM_ADDRESS);
// Create entity to mount
@ -1019,8 +1019,8 @@ void InventoryComponent::HandlePossession(Item* item) {
possessableComponent->SetIsItemSpawned(true);
possessableComponent->SetPossessor(m_ParentEntity->GetObjectID());
// Possess it
possessorComponent->SetPossessable(mount->GetObjectID());
possessorComponent->SetPossessableType(possessableComponent->GetPossessionType());
possessionComponent->SetPossessable(mount->GetObjectID());
possessionComponent->SetPossessableType(possessableComponent->GetPossessionType());
}
GameMessages::SendSetJetPackMode(m_ParentEntity, false);

View File

@ -18,7 +18,7 @@
#include "Component.h"
#include "ItemSetPassiveAbility.h"
#include "eItemSetPassiveAbilityID.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "eInventoryType.h"
#include "eReplicaComponentType.h"
#include "eLootSourceType.h"

View File

@ -1,5 +1,5 @@
#include "PossessableComponent.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "EntityManager.h"
#include "Inventory.h"
#include "Item.h"
@ -48,7 +48,7 @@ void PossessableComponent::Dismount() {
}
void PossessableComponent::OnUse(Entity* originator) {
auto* possessor = originator->GetComponent<PossessorComponent>();
auto* possessor = originator->GetComponent<PossessionComponent>();
if (possessor) {
possessor->Mount(m_ParentEntity);
}

View File

@ -4,7 +4,7 @@
#include "Entity.h"
#include "Component.h"
#include "Item.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "eAninmationFlags.h"
#include "eReplicaComponentType.h"

View File

@ -1,4 +1,4 @@
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "PossessableComponent.h"
#include "CharacterComponent.h"
#include "EntityManager.h"
@ -7,11 +7,11 @@
#include "eControlScheme.h"
#include "eStateChangeType.h"
PossessorComponent::PossessorComponent(Entity* parent) : Component(parent) {
PossessionComponent::PossessionComponent(Entity* parent) : Component(parent) {
m_Possessable = LWOOBJID_EMPTY;
}
PossessorComponent::~PossessorComponent() {
PossessionComponent::~PossessionComponent() {
if (m_Possessable != LWOOBJID_EMPTY) {
auto* mount = EntityManager::Instance()->GetEntity(m_Possessable);
if (mount) {
@ -26,7 +26,7 @@ PossessorComponent::~PossessorComponent() {
}
}
void PossessorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
void PossessionComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
outBitStream->Write(m_DirtyPossesor || bIsInitialUpdate);
if (m_DirtyPossesor || bIsInitialUpdate) {
m_DirtyPossesor = false;
@ -38,7 +38,7 @@ void PossessorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInit
}
}
void PossessorComponent::Mount(Entity* mount) {
void PossessionComponent::Mount(Entity* mount) {
// Don't do anything if we are busy dismounting
if (GetIsDismounting() || !mount) return;
@ -62,7 +62,7 @@ void PossessorComponent::Mount(Entity* mount) {
EntityManager::Instance()->SerializeEntity(mount);
}
void PossessorComponent::Dismount(Entity* mount, bool forceDismount) {
void PossessionComponent::Dismount(Entity* mount, bool forceDismount) {
// Don't do anything if we are busy dismounting
if (GetIsDismounting() || !mount) return;
SetIsDismounting(true);

View File

@ -16,12 +16,12 @@ enum class ePossessionType : uint8_t {
/**
* Represents an entity that can posess other entities. Generally used by players to drive a car.
*/
class PossessorComponent : public Component {
class PossessionComponent : public Component {
public:
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::POSSESSOR;
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::POSSESSION;
PossessorComponent(Entity* parent);
~PossessorComponent() override;
PossessionComponent(Entity* parent);
~PossessionComponent() override;
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);
@ -97,13 +97,13 @@ private:
ePossessionType m_PossessableType = ePossessionType::NO_POSSESSION;
/**
* @brief If the possessor is dirty
* @brief If the possession is dirty
*
*/
bool m_DirtyPossesor = false;
/**
* @brief If the possessor is busy dismounting
* @brief If the possession is busy dismounting
*
*/
bool m_IsDismounting = false;

View File

@ -14,7 +14,7 @@
#include "ModuleAssemblyComponent.h"
#include "Player.h"
#include "PossessableComponent.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "eRacingTaskParam.h"
#include "Spawner.h"
#include "dServer.h"
@ -169,11 +169,11 @@ void VehicleRacingControlComponent::LoadPlayerVehicle(Entity* player,
}
// Setup the player as possessing the vehicle.
auto* possessorComponent = player->GetComponent<PossessorComponent>();
auto* possessionComponent = player->GetComponent<PossessionComponent>();
if (possessorComponent != nullptr) {
possessorComponent->SetPossessable(carEntity->GetObjectID());
possessorComponent->SetPossessableType(ePossessionType::ATTACHED_VISIBLE); // for racing it's always Attached_Visible
if (possessionComponent != nullptr) {
possessionComponent->SetPossessable(carEntity->GetObjectID());
possessionComponent->SetPossessableType(ePossessionType::ATTACHED_VISIBLE); // for racing it's always Attached_Visible
}
// Set the player's current activity as racing.

View File

@ -56,7 +56,7 @@
#include "PetComponent.h"
#include "HavokVehiclePhysicsComponent.h"
#include "PossessableComponent.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "ModuleAssemblyComponent.h"
#include "RacingControlComponent.h"
#include "SoundTriggerComponent.h"
@ -266,7 +266,7 @@ void Entity::Initialize() {
case eReplicaComponentType::CHARACTER:
AddComponent<CharacterComponent>(m_Character);
AddComponent<MissionComponent>();
AddComponent<PossessorComponent>();
AddComponent<PossessionComponent>();
AddComponent<LevelProgressionComponent>();
AddComponent<PlayerForcedMovementComponent>();
break;
@ -1038,11 +1038,11 @@ void Entity::Smash(const LWOOBJID source, const eKillType killType, const std::u
Kill(EntityManager::Instance()->GetEntity(source));
return;
}
auto* possessorComponent = GetComponent<PossessorComponent>();
if (possessorComponent) {
if (possessorComponent->GetPossessable() != LWOOBJID_EMPTY) {
auto* mount = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
if (mount) possessorComponent->Dismount(mount, true);
auto* possessionComponent = GetComponent<PossessionComponent>();
if (possessionComponent) {
if (possessionComponent->GetPossessable() != LWOOBJID_EMPTY) {
auto* mount = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
if (mount) possessionComponent->Dismount(mount, true);
}
}

View File

@ -72,7 +72,7 @@
#include "ModuleAssemblyComponent.h"
#include "RenderComponent.h"
#include "PossessableComponent.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "VehicleRacingControlComponent.h"
#include "RailActivatorComponent.h"
#include "LevelProgressionComponent.h"
@ -4053,21 +4053,21 @@ void GameMessages::HandleDismountComplete(RakNet::BitStream* inStream, Entity* e
// If we aren't possessing somethings, the don't do anything
if (objectId != LWOOBJID_EMPTY) {
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
auto* mount = EntityManager::Instance()->GetEntity(objectId);
// make sure we have the things we need and they aren't null
if (possessorComponent && mount) {
if (!possessorComponent->GetIsDismounting()) return;
possessorComponent->SetIsDismounting(false);
possessorComponent->SetPossessable(LWOOBJID_EMPTY);
possessorComponent->SetPossessableType(ePossessionType::NO_POSSESSION);
if (possessionComponent && mount) {
if (!possessionComponent->GetIsDismounting()) return;
possessionComponent->SetIsDismounting(false);
possessionComponent->SetPossessable(LWOOBJID_EMPTY);
possessionComponent->SetPossessableType(ePossessionType::NO_POSSESSION);
// character related things
auto* character = entity->GetComponent<CharacterComponent>();
if (character) {
// If we had an active item turn it off
if (possessorComponent->GetMountItemID() != LWOOBJID_EMPTY) GameMessages::SendMarkInventoryItemAsActive(entity->GetObjectID(), false, eUnequippableActiveType::MOUNT, possessorComponent->GetMountItemID(), entity->GetSystemAddress());
possessorComponent->SetMountItemID(LWOOBJID_EMPTY);
if (possessionComponent->GetMountItemID() != LWOOBJID_EMPTY) GameMessages::SendMarkInventoryItemAsActive(entity->GetObjectID(), false, eUnequippableActiveType::MOUNT, possessionComponent->GetMountItemID(), entity->GetSystemAddress());
possessionComponent->SetMountItemID(LWOOBJID_EMPTY);
}
// Set that the controllabel phsyics comp is teleporting

View File

@ -58,7 +58,7 @@
#include "ProximityMonitorComponent.h"
#include "dpShapeSphere.h"
#include "PossessableComponent.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "HavokVehiclePhysicsComponent.h"
#include "BuffComponent.h"
#include "SkillComponent.h"
@ -413,9 +413,9 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
if ((chatCommand == "playanimation" || chatCommand == "playanim") && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
std::u16string anim = GeneralUtils::ASCIIToUTF16(args[0], args[0].size());
RenderComponent::PlayAnimation(entity, anim);
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
if (possessorComponent) {
auto* possessedComponent = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
if (possessionComponent) {
auto* possessedComponent = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
if (possessedComponent) RenderComponent::PlayAnimation(possessedComponent, anim);
}
}
@ -474,7 +474,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
controllablePhysicsComponent->SetSpeedMultiplier(boost);
// speedboost possesables
auto* possessor = entity->GetComponent<PossessorComponent>();
auto* possessor = entity->GetComponent<PossessionComponent>();
if (possessor) {
auto possessedID = possessor->GetPossessable();
if (possessedID != LWOOBJID_EMPTY) {
@ -935,9 +935,9 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
}
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
if (possessorComponent) {
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
if (possessionComponent) {
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
if (possassableEntity != nullptr) {
auto* havokVehiclePhysicsComponent = possassableEntity->GetComponent<HavokVehiclePhysicsComponent>();
@ -962,12 +962,12 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
}
if (chatCommand == "dismount" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
if (possessorComponent) {
auto possessableId = possessorComponent->GetPossessable();
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
if (possessionComponent) {
auto possessableId = possessionComponent->GetPossessable();
if (possessableId != LWOOBJID_EMPTY) {
auto* possessableEntity = EntityManager::Instance()->GetEntity(possessableId);
if (possessableEntity) possessorComponent->Dismount(possessableEntity, true);
if (possessableEntity) possessionComponent->Dismount(possessableEntity, true);
}
}
}
@ -1615,13 +1615,13 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
}
if ((chatCommand == "boost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
if (possessorComponent == nullptr) {
if (possessionComponent == nullptr) {
return;
}
auto* vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
auto* vehicle = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
if (vehicle == nullptr) {
return;
@ -1647,10 +1647,10 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
}
if ((chatCommand == "unboost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
if (possessorComponent == nullptr) return;
auto* vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
if (possessionComponent == nullptr) return;
auto* vehicle = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
if (vehicle == nullptr) return;
GameMessages::SendVehicleRemovePassiveBoostAction(vehicle->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);

View File

@ -25,7 +25,7 @@
#include "dZoneManager.h"
#include "Player.h"
#include "Zone.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "PossessableComponent.h"
#include "HavokVehiclePhysicsComponent.h"
#include "dConfig.h"
@ -100,7 +100,7 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
}
*/
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
NiPoint3 position;
inStream.Read(position.x);
@ -165,8 +165,8 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
bool updateChar = true;
if (possessorComponent != nullptr) {
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
if (possessionComponent != nullptr) {
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
if (possassableEntity != nullptr) {
auto* possessableComponent = possassableEntity->GetComponent<PossessableComponent>();

View File

@ -1,7 +1,7 @@
#include "RaceMaelstromGeiser.h"
#include "GameMessages.h"
#include "PossessableComponent.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "EntityManager.h"
#include "VehicleRacingControlComponent.h"
#include "dZoneManager.h"
@ -37,13 +37,13 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
vehicle = entering;
} else if (entering->IsPlayer()) {
auto* possessorComponent = entering->GetComponent<PossessorComponent>();
auto* possessionComponent = entering->GetComponent<PossessionComponent>();
if (possessorComponent == nullptr) {
if (possessionComponent == nullptr) {
return;
}
vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
vehicle = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
if (vehicle == nullptr) {
return;

View File

@ -4,7 +4,7 @@
#include "VehicleRacingControlComponent.h"
#include "dZoneManager.h"
#include "EntityManager.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
@ -22,13 +22,13 @@ void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
return;
} else if (target->IsPlayer()) {
auto* possessorComponent = target->GetComponent<PossessorComponent>();
auto* possessionComponent = target->GetComponent<PossessionComponent>();
if (possessorComponent == nullptr) {
if (possessionComponent == nullptr) {
return;
}
vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
vehicle = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
if (vehicle == nullptr) {
return;

View File

@ -5,7 +5,7 @@
#include "Player.h"
#include "Character.h"
#include "ShootingGalleryComponent.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "CharacterComponent.h"
#include "SimplePhysicsComponent.h"
#include "MovementAIComponent.h"
@ -105,7 +105,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
if (characterComponent != nullptr) {
characterComponent->SetIsRacing(true);
characterComponent->SetCurrentActivity(eGameActivity::SHOOTING_GALLERY);
auto* possessor = player->GetComponent<PossessorComponent>();
auto* possessor = player->GetComponent<PossessionComponent>();
if (possessor) {
possessor->SetPossessable(self->GetObjectID());
possessor->SetPossessableType(ePossessionType::NO_POSSESSION);
@ -288,7 +288,7 @@ void SGCannon::OnActivityTimerDone(Entity* self, const std::string& name) {
EntityManager::Instance()->ConstructEntity(enemy);
auto* movementAiComponent = enemy->AddComponent<MovementAIComponent>(0U);
movementAiComponent->SetSpeed(toSpawn.initialSpeed);
movementAiComponent->SetCurrentSpeed(toSpawn.initialSpeed);
movementAiComponent->SetHaltDistance(0.0f);

View File

@ -1,6 +1,6 @@
#include "DestroyableComponent.h"
#include "EntityManager.h"
#include "PossessorComponent.h"
#include "PossessionComponent.h"
#include "RaceImaginePowerup.h"
#include "eRacingTaskParam.h"
#include "MissionComponent.h"
@ -9,13 +9,13 @@
void RaceImaginePowerup::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
int32_t param2, int32_t param3) {
if (sender->IsPlayer() && args == "powerup") {
auto* possessorComponent = sender->GetComponent<PossessorComponent>();
auto* possessionComponent = sender->GetComponent<PossessionComponent>();
if (possessorComponent == nullptr) {
if (possessionComponent == nullptr) {
return;
}
auto* vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
auto* vehicle = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
if (vehicle == nullptr) {
return;