mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-05-23 07:12:24 +00:00
rename possessor to possession
This commit is contained in:
parent
d29287f9d9
commit
68f90b7136
@ -114,7 +114,7 @@ enum class eReplicaComponentType : uint32_t {
|
|||||||
CRAFTING,
|
CRAFTING,
|
||||||
POSSESSABLE,
|
POSSESSABLE,
|
||||||
LEVEL_PROGRESSION,
|
LEVEL_PROGRESSION,
|
||||||
POSSESSOR,
|
POSSESSION,
|
||||||
MOUNT_CONTROL,
|
MOUNT_CONTROL,
|
||||||
UNKNOWN_112,
|
UNKNOWN_112,
|
||||||
PROPERTY_PLAQUE,
|
PROPERTY_PLAQUE,
|
||||||
|
@ -28,7 +28,7 @@ set(DGAME_DCOMPONENTS_SOURCES "AchievementVendorComponent.cpp"
|
|||||||
"PhantomPhysicsComponent.cpp"
|
"PhantomPhysicsComponent.cpp"
|
||||||
"PlayerForcedMovementComponent.cpp"
|
"PlayerForcedMovementComponent.cpp"
|
||||||
"PossessableComponent.cpp"
|
"PossessableComponent.cpp"
|
||||||
"PossessorComponent.cpp"
|
"PossessionComponent.cpp"
|
||||||
"PropertyComponent.cpp"
|
"PropertyComponent.cpp"
|
||||||
"PropertyEntranceComponent.cpp"
|
"PropertyEntranceComponent.cpp"
|
||||||
"PropertyManagementComponent.cpp"
|
"PropertyManagementComponent.cpp"
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
#include "CharacterComponent.h"
|
#include "CharacterComponent.h"
|
||||||
#include "PossessableComponent.h"
|
#include "PossessableComponent.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "InventoryComponent.h"
|
#include "InventoryComponent.h"
|
||||||
#include "dZoneManager.h"
|
#include "dZoneManager.h"
|
||||||
#include "WorldConfig.h"
|
#include "WorldConfig.h"
|
||||||
@ -646,7 +646,7 @@ void DestroyableComponent::Damage(uint32_t damage, const LWOOBJID source, uint32
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dismount on the possessor hit
|
// Dismount on the possessor hit
|
||||||
auto* possessor = m_ParentEntity->GetComponent<PossessorComponent>();
|
auto* possessor = m_ParentEntity->GetComponent<PossessionComponent>();
|
||||||
if (possessor) {
|
if (possessor) {
|
||||||
auto possessableId = possessor->GetPossessable();
|
auto possessableId = possessor->GetPossessable();
|
||||||
if (possessableId != LWOOBJID_EMPTY) {
|
if (possessableId != LWOOBJID_EMPTY) {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "ItemSet.h"
|
#include "ItemSet.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "PetComponent.h"
|
#include "PetComponent.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "PossessableComponent.h"
|
#include "PossessableComponent.h"
|
||||||
#include "ModuleAssemblyComponent.h"
|
#include "ModuleAssemblyComponent.h"
|
||||||
#include "HavokVehiclePhysicsComponent.h"
|
#include "HavokVehiclePhysicsComponent.h"
|
||||||
@ -961,25 +961,25 @@ void InventoryComponent::HandlePossession(Item* item) {
|
|||||||
auto* characterComponent = m_ParentEntity->GetComponent<CharacterComponent>();
|
auto* characterComponent = m_ParentEntity->GetComponent<CharacterComponent>();
|
||||||
if (!characterComponent) return;
|
if (!characterComponent) return;
|
||||||
|
|
||||||
auto* possessorComponent = m_ParentEntity->GetComponent<PossessorComponent>();
|
auto* possessionComponent = m_ParentEntity->GetComponent<PossessionComponent>();
|
||||||
if (!possessorComponent) return;
|
if (!possessionComponent) return;
|
||||||
|
|
||||||
// Don't do anything if we are busy dismounting
|
// 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
|
// Check to see if we are already mounting something
|
||||||
auto* currentlyPossessedEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* currentlyPossessedEntity = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
|
||||||
auto currentlyPossessedItem = possessorComponent->GetMountItemID();
|
auto currentlyPossessedItem = possessionComponent->GetMountItemID();
|
||||||
|
|
||||||
if (currentlyPossessedItem) {
|
if (currentlyPossessedItem) {
|
||||||
if (currentlyPossessedEntity) possessorComponent->Dismount(currentlyPossessedEntity);
|
if (currentlyPossessedEntity) possessionComponent->Dismount(currentlyPossessedEntity);
|
||||||
return;
|
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);
|
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
|
// 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);
|
GameMessages::SendSetMountInventoryID(m_ParentEntity, item->GetId(), UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
|
|
||||||
// Create entity to mount
|
// Create entity to mount
|
||||||
@ -1019,8 +1019,8 @@ void InventoryComponent::HandlePossession(Item* item) {
|
|||||||
possessableComponent->SetIsItemSpawned(true);
|
possessableComponent->SetIsItemSpawned(true);
|
||||||
possessableComponent->SetPossessor(m_ParentEntity->GetObjectID());
|
possessableComponent->SetPossessor(m_ParentEntity->GetObjectID());
|
||||||
// Possess it
|
// Possess it
|
||||||
possessorComponent->SetPossessable(mount->GetObjectID());
|
possessionComponent->SetPossessable(mount->GetObjectID());
|
||||||
possessorComponent->SetPossessableType(possessableComponent->GetPossessionType());
|
possessionComponent->SetPossessableType(possessableComponent->GetPossessionType());
|
||||||
}
|
}
|
||||||
|
|
||||||
GameMessages::SendSetJetPackMode(m_ParentEntity, false);
|
GameMessages::SendSetJetPackMode(m_ParentEntity, false);
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "Component.h"
|
#include "Component.h"
|
||||||
#include "ItemSetPassiveAbility.h"
|
#include "ItemSetPassiveAbility.h"
|
||||||
#include "eItemSetPassiveAbilityID.h"
|
#include "eItemSetPassiveAbilityID.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "eInventoryType.h"
|
#include "eInventoryType.h"
|
||||||
#include "eReplicaComponentType.h"
|
#include "eReplicaComponentType.h"
|
||||||
#include "eLootSourceType.h"
|
#include "eLootSourceType.h"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "PossessableComponent.h"
|
#include "PossessableComponent.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "Inventory.h"
|
#include "Inventory.h"
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
@ -48,7 +48,7 @@ void PossessableComponent::Dismount() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PossessableComponent::OnUse(Entity* originator) {
|
void PossessableComponent::OnUse(Entity* originator) {
|
||||||
auto* possessor = originator->GetComponent<PossessorComponent>();
|
auto* possessor = originator->GetComponent<PossessionComponent>();
|
||||||
if (possessor) {
|
if (possessor) {
|
||||||
possessor->Mount(m_ParentEntity);
|
possessor->Mount(m_ParentEntity);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "Component.h"
|
#include "Component.h"
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "eAninmationFlags.h"
|
#include "eAninmationFlags.h"
|
||||||
#include "eReplicaComponentType.h"
|
#include "eReplicaComponentType.h"
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "PossessableComponent.h"
|
#include "PossessableComponent.h"
|
||||||
#include "CharacterComponent.h"
|
#include "CharacterComponent.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
@ -7,11 +7,11 @@
|
|||||||
#include "eControlScheme.h"
|
#include "eControlScheme.h"
|
||||||
#include "eStateChangeType.h"
|
#include "eStateChangeType.h"
|
||||||
|
|
||||||
PossessorComponent::PossessorComponent(Entity* parent) : Component(parent) {
|
PossessionComponent::PossessionComponent(Entity* parent) : Component(parent) {
|
||||||
m_Possessable = LWOOBJID_EMPTY;
|
m_Possessable = LWOOBJID_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
PossessorComponent::~PossessorComponent() {
|
PossessionComponent::~PossessionComponent() {
|
||||||
if (m_Possessable != LWOOBJID_EMPTY) {
|
if (m_Possessable != LWOOBJID_EMPTY) {
|
||||||
auto* mount = EntityManager::Instance()->GetEntity(m_Possessable);
|
auto* mount = EntityManager::Instance()->GetEntity(m_Possessable);
|
||||||
if (mount) {
|
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);
|
outBitStream->Write(m_DirtyPossesor || bIsInitialUpdate);
|
||||||
if (m_DirtyPossesor || bIsInitialUpdate) {
|
if (m_DirtyPossesor || bIsInitialUpdate) {
|
||||||
m_DirtyPossesor = false;
|
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
|
// Don't do anything if we are busy dismounting
|
||||||
if (GetIsDismounting() || !mount) return;
|
if (GetIsDismounting() || !mount) return;
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ void PossessorComponent::Mount(Entity* mount) {
|
|||||||
EntityManager::Instance()->SerializeEntity(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
|
// Don't do anything if we are busy dismounting
|
||||||
if (GetIsDismounting() || !mount) return;
|
if (GetIsDismounting() || !mount) return;
|
||||||
SetIsDismounting(true);
|
SetIsDismounting(true);
|
@ -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.
|
* 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:
|
public:
|
||||||
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::POSSESSOR;
|
inline static const eReplicaComponentType ComponentType = eReplicaComponentType::POSSESSION;
|
||||||
|
|
||||||
PossessorComponent(Entity* parent);
|
PossessionComponent(Entity* parent);
|
||||||
~PossessorComponent() override;
|
~PossessionComponent() override;
|
||||||
|
|
||||||
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);
|
void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags);
|
||||||
|
|
||||||
@ -97,13 +97,13 @@ private:
|
|||||||
ePossessionType m_PossessableType = ePossessionType::NO_POSSESSION;
|
ePossessionType m_PossessableType = ePossessionType::NO_POSSESSION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief If the possessor is dirty
|
* @brief If the possession is dirty
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool m_DirtyPossesor = false;
|
bool m_DirtyPossesor = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief If the possessor is busy dismounting
|
* @brief If the possession is busy dismounting
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool m_IsDismounting = false;
|
bool m_IsDismounting = false;
|
@ -14,7 +14,7 @@
|
|||||||
#include "ModuleAssemblyComponent.h"
|
#include "ModuleAssemblyComponent.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "PossessableComponent.h"
|
#include "PossessableComponent.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "eRacingTaskParam.h"
|
#include "eRacingTaskParam.h"
|
||||||
#include "Spawner.h"
|
#include "Spawner.h"
|
||||||
#include "dServer.h"
|
#include "dServer.h"
|
||||||
@ -169,11 +169,11 @@ void VehicleRacingControlComponent::LoadPlayerVehicle(Entity* player,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup the player as possessing the vehicle.
|
// Setup the player as possessing the vehicle.
|
||||||
auto* possessorComponent = player->GetComponent<PossessorComponent>();
|
auto* possessionComponent = player->GetComponent<PossessionComponent>();
|
||||||
|
|
||||||
if (possessorComponent != nullptr) {
|
if (possessionComponent != nullptr) {
|
||||||
possessorComponent->SetPossessable(carEntity->GetObjectID());
|
possessionComponent->SetPossessable(carEntity->GetObjectID());
|
||||||
possessorComponent->SetPossessableType(ePossessionType::ATTACHED_VISIBLE); // for racing it's always Attached_Visible
|
possessionComponent->SetPossessableType(ePossessionType::ATTACHED_VISIBLE); // for racing it's always Attached_Visible
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the player's current activity as racing.
|
// Set the player's current activity as racing.
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
#include "PetComponent.h"
|
#include "PetComponent.h"
|
||||||
#include "HavokVehiclePhysicsComponent.h"
|
#include "HavokVehiclePhysicsComponent.h"
|
||||||
#include "PossessableComponent.h"
|
#include "PossessableComponent.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "ModuleAssemblyComponent.h"
|
#include "ModuleAssemblyComponent.h"
|
||||||
#include "RacingControlComponent.h"
|
#include "RacingControlComponent.h"
|
||||||
#include "SoundTriggerComponent.h"
|
#include "SoundTriggerComponent.h"
|
||||||
@ -266,7 +266,7 @@ void Entity::Initialize() {
|
|||||||
case eReplicaComponentType::CHARACTER:
|
case eReplicaComponentType::CHARACTER:
|
||||||
AddComponent<CharacterComponent>(m_Character);
|
AddComponent<CharacterComponent>(m_Character);
|
||||||
AddComponent<MissionComponent>();
|
AddComponent<MissionComponent>();
|
||||||
AddComponent<PossessorComponent>();
|
AddComponent<PossessionComponent>();
|
||||||
AddComponent<LevelProgressionComponent>();
|
AddComponent<LevelProgressionComponent>();
|
||||||
AddComponent<PlayerForcedMovementComponent>();
|
AddComponent<PlayerForcedMovementComponent>();
|
||||||
break;
|
break;
|
||||||
@ -1038,11 +1038,11 @@ void Entity::Smash(const LWOOBJID source, const eKillType killType, const std::u
|
|||||||
Kill(EntityManager::Instance()->GetEntity(source));
|
Kill(EntityManager::Instance()->GetEntity(source));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto* possessorComponent = GetComponent<PossessorComponent>();
|
auto* possessionComponent = GetComponent<PossessionComponent>();
|
||||||
if (possessorComponent) {
|
if (possessionComponent) {
|
||||||
if (possessorComponent->GetPossessable() != LWOOBJID_EMPTY) {
|
if (possessionComponent->GetPossessable() != LWOOBJID_EMPTY) {
|
||||||
auto* mount = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* mount = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
|
||||||
if (mount) possessorComponent->Dismount(mount, true);
|
if (mount) possessionComponent->Dismount(mount, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
#include "ModuleAssemblyComponent.h"
|
#include "ModuleAssemblyComponent.h"
|
||||||
#include "RenderComponent.h"
|
#include "RenderComponent.h"
|
||||||
#include "PossessableComponent.h"
|
#include "PossessableComponent.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "VehicleRacingControlComponent.h"
|
#include "VehicleRacingControlComponent.h"
|
||||||
#include "RailActivatorComponent.h"
|
#include "RailActivatorComponent.h"
|
||||||
#include "LevelProgressionComponent.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 we aren't possessing somethings, the don't do anything
|
||||||
if (objectId != LWOOBJID_EMPTY) {
|
if (objectId != LWOOBJID_EMPTY) {
|
||||||
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
|
||||||
auto* mount = EntityManager::Instance()->GetEntity(objectId);
|
auto* mount = EntityManager::Instance()->GetEntity(objectId);
|
||||||
// make sure we have the things we need and they aren't null
|
// make sure we have the things we need and they aren't null
|
||||||
if (possessorComponent && mount) {
|
if (possessionComponent && mount) {
|
||||||
if (!possessorComponent->GetIsDismounting()) return;
|
if (!possessionComponent->GetIsDismounting()) return;
|
||||||
possessorComponent->SetIsDismounting(false);
|
possessionComponent->SetIsDismounting(false);
|
||||||
possessorComponent->SetPossessable(LWOOBJID_EMPTY);
|
possessionComponent->SetPossessable(LWOOBJID_EMPTY);
|
||||||
possessorComponent->SetPossessableType(ePossessionType::NO_POSSESSION);
|
possessionComponent->SetPossessableType(ePossessionType::NO_POSSESSION);
|
||||||
|
|
||||||
// character related things
|
// character related things
|
||||||
auto* character = entity->GetComponent<CharacterComponent>();
|
auto* character = entity->GetComponent<CharacterComponent>();
|
||||||
if (character) {
|
if (character) {
|
||||||
// If we had an active item turn it off
|
// 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());
|
if (possessionComponent->GetMountItemID() != LWOOBJID_EMPTY) GameMessages::SendMarkInventoryItemAsActive(entity->GetObjectID(), false, eUnequippableActiveType::MOUNT, possessionComponent->GetMountItemID(), entity->GetSystemAddress());
|
||||||
possessorComponent->SetMountItemID(LWOOBJID_EMPTY);
|
possessionComponent->SetMountItemID(LWOOBJID_EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set that the controllabel phsyics comp is teleporting
|
// Set that the controllabel phsyics comp is teleporting
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
#include "ProximityMonitorComponent.h"
|
#include "ProximityMonitorComponent.h"
|
||||||
#include "dpShapeSphere.h"
|
#include "dpShapeSphere.h"
|
||||||
#include "PossessableComponent.h"
|
#include "PossessableComponent.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "HavokVehiclePhysicsComponent.h"
|
#include "HavokVehiclePhysicsComponent.h"
|
||||||
#include "BuffComponent.h"
|
#include "BuffComponent.h"
|
||||||
#include "SkillComponent.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) {
|
if ((chatCommand == "playanimation" || chatCommand == "playanim") && args.size() == 1 && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
std::u16string anim = GeneralUtils::ASCIIToUTF16(args[0], args[0].size());
|
std::u16string anim = GeneralUtils::ASCIIToUTF16(args[0], args[0].size());
|
||||||
RenderComponent::PlayAnimation(entity, anim);
|
RenderComponent::PlayAnimation(entity, anim);
|
||||||
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
|
||||||
if (possessorComponent) {
|
if (possessionComponent) {
|
||||||
auto* possessedComponent = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* possessedComponent = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
|
||||||
if (possessedComponent) RenderComponent::PlayAnimation(possessedComponent, anim);
|
if (possessedComponent) RenderComponent::PlayAnimation(possessedComponent, anim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -474,7 +474,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
controllablePhysicsComponent->SetSpeedMultiplier(boost);
|
controllablePhysicsComponent->SetSpeedMultiplier(boost);
|
||||||
|
|
||||||
// speedboost possesables
|
// speedboost possesables
|
||||||
auto* possessor = entity->GetComponent<PossessorComponent>();
|
auto* possessor = entity->GetComponent<PossessionComponent>();
|
||||||
if (possessor) {
|
if (possessor) {
|
||||||
auto possessedID = possessor->GetPossessable();
|
auto possessedID = possessor->GetPossessable();
|
||||||
if (possessedID != LWOOBJID_EMPTY) {
|
if (possessedID != LWOOBJID_EMPTY) {
|
||||||
@ -935,9 +935,9 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
|
||||||
if (possessorComponent) {
|
if (possessionComponent) {
|
||||||
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
|
||||||
|
|
||||||
if (possassableEntity != nullptr) {
|
if (possassableEntity != nullptr) {
|
||||||
auto* havokVehiclePhysicsComponent = possassableEntity->GetComponent<HavokVehiclePhysicsComponent>();
|
auto* havokVehiclePhysicsComponent = possassableEntity->GetComponent<HavokVehiclePhysicsComponent>();
|
||||||
@ -962,12 +962,12 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatCommand == "dismount" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if (chatCommand == "dismount" && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
|
||||||
if (possessorComponent) {
|
if (possessionComponent) {
|
||||||
auto possessableId = possessorComponent->GetPossessable();
|
auto possessableId = possessionComponent->GetPossessable();
|
||||||
if (possessableId != LWOOBJID_EMPTY) {
|
if (possessableId != LWOOBJID_EMPTY) {
|
||||||
auto* possessableEntity = EntityManager::Instance()->GetEntity(possessableId);
|
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) {
|
if ((chatCommand == "boost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
|
||||||
|
|
||||||
if (possessorComponent == nullptr) {
|
if (possessionComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* vehicle = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
|
||||||
|
|
||||||
if (vehicle == nullptr) {
|
if (vehicle == nullptr) {
|
||||||
return;
|
return;
|
||||||
@ -1647,10 +1647,10 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((chatCommand == "unboost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
if ((chatCommand == "unboost") && entity->GetGMLevel() >= eGameMasterLevel::DEVELOPER) {
|
||||||
auto* possessorComponent = entity->GetComponent<PossessorComponent>();
|
auto* possessionComponent = entity->GetComponent<PossessionComponent>();
|
||||||
|
|
||||||
if (possessorComponent == nullptr) return;
|
if (possessionComponent == nullptr) return;
|
||||||
auto* vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* vehicle = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
|
||||||
|
|
||||||
if (vehicle == nullptr) return;
|
if (vehicle == nullptr) return;
|
||||||
GameMessages::SendVehicleRemovePassiveBoostAction(vehicle->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);
|
GameMessages::SendVehicleRemovePassiveBoostAction(vehicle->GetObjectID(), UNASSIGNED_SYSTEM_ADDRESS);
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "dZoneManager.h"
|
#include "dZoneManager.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "Zone.h"
|
#include "Zone.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "PossessableComponent.h"
|
#include "PossessableComponent.h"
|
||||||
#include "HavokVehiclePhysicsComponent.h"
|
#include "HavokVehiclePhysicsComponent.h"
|
||||||
#include "dConfig.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;
|
NiPoint3 position;
|
||||||
inStream.Read(position.x);
|
inStream.Read(position.x);
|
||||||
@ -165,8 +165,8 @@ void ClientPackets::HandleClientPositionUpdate(const SystemAddress& sysAddr, Pac
|
|||||||
|
|
||||||
bool updateChar = true;
|
bool updateChar = true;
|
||||||
|
|
||||||
if (possessorComponent != nullptr) {
|
if (possessionComponent != nullptr) {
|
||||||
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* possassableEntity = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
|
||||||
|
|
||||||
if (possassableEntity != nullptr) {
|
if (possassableEntity != nullptr) {
|
||||||
auto* possessableComponent = possassableEntity->GetComponent<PossessableComponent>();
|
auto* possessableComponent = possassableEntity->GetComponent<PossessableComponent>();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "RaceMaelstromGeiser.h"
|
#include "RaceMaelstromGeiser.h"
|
||||||
#include "GameMessages.h"
|
#include "GameMessages.h"
|
||||||
#include "PossessableComponent.h"
|
#include "PossessableComponent.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "VehicleRacingControlComponent.h"
|
#include "VehicleRacingControlComponent.h"
|
||||||
#include "dZoneManager.h"
|
#include "dZoneManager.h"
|
||||||
@ -37,13 +37,13 @@ void RaceMaelstromGeiser::OnProximityUpdate(Entity* self, Entity* entering, std:
|
|||||||
|
|
||||||
vehicle = entering;
|
vehicle = entering;
|
||||||
} else if (entering->IsPlayer()) {
|
} else if (entering->IsPlayer()) {
|
||||||
auto* possessorComponent = entering->GetComponent<PossessorComponent>();
|
auto* possessionComponent = entering->GetComponent<PossessionComponent>();
|
||||||
|
|
||||||
if (possessorComponent == nullptr) {
|
if (possessionComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
vehicle = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
|
||||||
|
|
||||||
if (vehicle == nullptr) {
|
if (vehicle == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "VehicleRacingControlComponent.h"
|
#include "VehicleRacingControlComponent.h"
|
||||||
#include "dZoneManager.h"
|
#include "dZoneManager.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
|
|
||||||
|
|
||||||
void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||||
@ -22,13 +22,13 @@ void ActVehicleDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
} else if (target->IsPlayer()) {
|
} else if (target->IsPlayer()) {
|
||||||
auto* possessorComponent = target->GetComponent<PossessorComponent>();
|
auto* possessionComponent = target->GetComponent<PossessionComponent>();
|
||||||
|
|
||||||
if (possessorComponent == nullptr) {
|
if (possessionComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
vehicle = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
|
||||||
|
|
||||||
if (vehicle == nullptr) {
|
if (vehicle == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "Character.h"
|
#include "Character.h"
|
||||||
#include "ShootingGalleryComponent.h"
|
#include "ShootingGalleryComponent.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "CharacterComponent.h"
|
#include "CharacterComponent.h"
|
||||||
#include "SimplePhysicsComponent.h"
|
#include "SimplePhysicsComponent.h"
|
||||||
#include "MovementAIComponent.h"
|
#include "MovementAIComponent.h"
|
||||||
@ -105,7 +105,7 @@ void SGCannon::OnActivityStateChangeRequest(Entity* self, LWOOBJID senderID, int
|
|||||||
if (characterComponent != nullptr) {
|
if (characterComponent != nullptr) {
|
||||||
characterComponent->SetIsRacing(true);
|
characterComponent->SetIsRacing(true);
|
||||||
characterComponent->SetCurrentActivity(eGameActivity::SHOOTING_GALLERY);
|
characterComponent->SetCurrentActivity(eGameActivity::SHOOTING_GALLERY);
|
||||||
auto* possessor = player->GetComponent<PossessorComponent>();
|
auto* possessor = player->GetComponent<PossessionComponent>();
|
||||||
if (possessor) {
|
if (possessor) {
|
||||||
possessor->SetPossessable(self->GetObjectID());
|
possessor->SetPossessable(self->GetObjectID());
|
||||||
possessor->SetPossessableType(ePossessionType::NO_POSSESSION);
|
possessor->SetPossessableType(ePossessionType::NO_POSSESSION);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "DestroyableComponent.h"
|
#include "DestroyableComponent.h"
|
||||||
#include "EntityManager.h"
|
#include "EntityManager.h"
|
||||||
#include "PossessorComponent.h"
|
#include "PossessionComponent.h"
|
||||||
#include "RaceImaginePowerup.h"
|
#include "RaceImaginePowerup.h"
|
||||||
#include "eRacingTaskParam.h"
|
#include "eRacingTaskParam.h"
|
||||||
#include "MissionComponent.h"
|
#include "MissionComponent.h"
|
||||||
@ -9,13 +9,13 @@
|
|||||||
void RaceImaginePowerup::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
|
void RaceImaginePowerup::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1,
|
||||||
int32_t param2, int32_t param3) {
|
int32_t param2, int32_t param3) {
|
||||||
if (sender->IsPlayer() && args == "powerup") {
|
if (sender->IsPlayer() && args == "powerup") {
|
||||||
auto* possessorComponent = sender->GetComponent<PossessorComponent>();
|
auto* possessionComponent = sender->GetComponent<PossessionComponent>();
|
||||||
|
|
||||||
if (possessorComponent == nullptr) {
|
if (possessionComponent == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* vehicle = EntityManager::Instance()->GetEntity(possessorComponent->GetPossessable());
|
auto* vehicle = EntityManager::Instance()->GetEntity(possessionComponent->GetPossessable());
|
||||||
|
|
||||||
if (vehicle == nullptr) {
|
if (vehicle == nullptr) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user