diff --git a/dCommon/dEnums/eReplicaComponentType.h b/dCommon/dEnums/eReplicaComponentType.h index 39f91eff..fb88bd14 100644 --- a/dCommon/dEnums/eReplicaComponentType.h +++ b/dCommon/dEnums/eReplicaComponentType.h @@ -11,14 +11,14 @@ enum class eReplicaComponentType : uint32_t { CHARACTER, SCRIPT, BOUNCER, - BUFF, // buff is really 98, this is DESTROYABLE + DESTROYABLE, GHOST, SKILL, - SPAWNER, + SPAWN, ITEM, - REBUILD, - REBUILD_START, - REBUILD_ACTIVATOR, + MODULAR_BUILD, + BUILD_CONTROLLER, + BUILD_ACTIVATOR, ICON_ONLY, VENDOR, INVENTORY, @@ -33,8 +33,8 @@ enum class eReplicaComponentType : uint32_t { PET, PLATFORM_BOUNDARY, MODULE, - ARCADE, - VEHICLE_PHYSICS, // Havok demo based + JETPACKPAD, + HAVOK_VEHICLE_PHYSICS, MOVEMENT_AI, EXHIBIT, OVERHEAD_ICON, @@ -46,23 +46,23 @@ enum class eReplicaComponentType : uint32_t { SCRIPTED_ACTIVITY, PHANTOM_PHYSICS, SPRINGPAD, - MODEL, + MODEL_BEHAVIOR, PROPERTY_ENTRANCE, FX, PROPERTY_MANAGEMENT, - VEHICLE_PHYSICS_NEW, // internal physics based on havok + VEHICLE_PHYSICS, PHYSICS_SYSTEM, QUICK_BUILD, SWITCH, - ZONE_CONTROL, // Minigame - CHANGLING, + MINIGAME_CONTROL, + CHANGLING_BUILD, CHOICE_BUILD, PACKAGE, SOUND_REPEATER, SOUND_AMBIENT_2D, SOUND_AMBIENT_3D, PRECONDITION, - PLAYER_FLAG, + FLAG, CUSTOM_BUILD_ASSEMBLY, BASE_COMBAT_AI, MODULE_ASSEMBLY, @@ -71,8 +71,8 @@ enum class eReplicaComponentType : uint32_t { GENERIC_ACTIVATOR, PROPERTY_VENDOR, HF_LIGHT_DIRECTION_GADGET, - ROCKET_LAUNCH, - ROCKET_LANDING, + ROCKET_LAUNCHPAD_CONTROL, + ROCKET_ANIMATION_CONTROL, TRIGGER, DROPPED_LOOT, RACING_CONTROL, @@ -84,7 +84,7 @@ enum class eReplicaComponentType : uint32_t { SOUND_TRIGGER, PROXIMITY_MONITOR, RACING_SOUND_TRIGGER, - CHAT, + CHAT_BUBBLE, FRIENDS_LIST, GUILD, LOCAL_SYSTEM, @@ -101,12 +101,12 @@ enum class eReplicaComponentType : uint32_t { TRADE, USER_CONTROL, IGNORE_LIST, - ROCKET_LAUNCH_LUP, - BUFF_REAL, // the real buff component, should just be name BUFF + MULTI_ZONE_ENTRANCE, + BUFF, INTERACTION_MANAGER, DONATION_VENDOR, COMBAT_MEDIATOR, - COMMENDATION_VENDOR, + ACHIEVEMENT_VENDOR, GATE_RUSH_CONTROL, RAIL_ACTIVATOR, ROLLER, @@ -121,8 +121,7 @@ enum class eReplicaComponentType : uint32_t { BUILD_BORDER, UNKNOWN_115, CULLING_PLANE, - NUMBER_OF_COMPONENTS, - DESTROYABLE = 1000 // Actually 7 + NUMBER_OF_COMPONENTS }; #endif //!__EREPLICACOMPONENTTYPE__H__ diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index 4d4a5af9..bcb2a5b7 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -30,7 +30,7 @@ #include "Component.h" #include "ControllablePhysicsComponent.h" #include "RenderComponent.h" -#include "RocketLaunchLupComponent.h" +#include "MultiZoneEntranceComponent.h" #include "CharacterComponent.h" #include "DestroyableComponent.h" #include "BuffComponent.h" @@ -58,10 +58,10 @@ #include "PropertyVendorComponent.h" #include "ProximityMonitorComponent.h" #include "PropertyEntranceComponent.h" -#include "ModelComponent.h" +#include "ModelBehaviorComponent.h" #include "ZCompression.h" #include "PetComponent.h" -#include "VehiclePhysicsComponent.h" +#include "HavokVehiclePhysicsComponent.h" #include "PossessableComponent.h" #include "PossessorComponent.h" #include "ModuleAssemblyComponent.h" @@ -148,21 +148,21 @@ void Entity::Initialize() { break; case eReplicaComponentType::BOUNCER: break; - case eReplicaComponentType::BUFF: + case eReplicaComponentType::DESTROYABLE: break; case eReplicaComponentType::GHOST: break; case eReplicaComponentType::SKILL: break; - case eReplicaComponentType::SPAWNER: + case eReplicaComponentType::SPAWN: break; case eReplicaComponentType::ITEM: break; - case eReplicaComponentType::REBUILD: + case eReplicaComponentType::MODULAR_BUILD: break; - case eReplicaComponentType::REBUILD_START: + case eReplicaComponentType::BUILD_CONTROLLER: break; - case eReplicaComponentType::REBUILD_ACTIVATOR: + case eReplicaComponentType::BUILD_ACTIVATOR: break; case eReplicaComponentType::ICON_ONLY: break; @@ -192,9 +192,9 @@ void Entity::Initialize() { break; case eReplicaComponentType::MODULE: break; - case eReplicaComponentType::ARCADE: + case eReplicaComponentType::JETPACKPAD: break; - case eReplicaComponentType::VEHICLE_PHYSICS: + case eReplicaComponentType::HAVOK_VEHICLE_PHYSICS: break; case eReplicaComponentType::MOVEMENT_AI: break; @@ -218,7 +218,7 @@ void Entity::Initialize() { break; case eReplicaComponentType::SPRINGPAD: break; - case eReplicaComponentType::MODEL: + case eReplicaComponentType::MODEL_BEHAVIOR: break; case eReplicaComponentType::PROPERTY_ENTRANCE: break; @@ -226,7 +226,7 @@ void Entity::Initialize() { break; case eReplicaComponentType::PROPERTY_MANAGEMENT: break; - case eReplicaComponentType::VEHICLE_PHYSICS_NEW: + case eReplicaComponentType::VEHICLE_PHYSICS: break; case eReplicaComponentType::PHYSICS_SYSTEM: break; @@ -234,9 +234,9 @@ void Entity::Initialize() { break; case eReplicaComponentType::SWITCH: break; - case eReplicaComponentType::ZONE_CONTROL: + case eReplicaComponentType::MINIGAME_CONTROL: break; - case eReplicaComponentType::CHANGLING: + case eReplicaComponentType::CHANGLING_BUILD: break; case eReplicaComponentType::CHOICE_BUILD: break; @@ -250,7 +250,7 @@ void Entity::Initialize() { break; case eReplicaComponentType::PRECONDITION: break; - case eReplicaComponentType::PLAYER_FLAG: + case eReplicaComponentType::FLAG: break; case eReplicaComponentType::CUSTOM_BUILD_ASSEMBLY: break; @@ -268,9 +268,9 @@ void Entity::Initialize() { break; case eReplicaComponentType::HF_LIGHT_DIRECTION_GADGET: break; - case eReplicaComponentType::ROCKET_LAUNCH: + case eReplicaComponentType::ROCKET_LAUNCHPAD_CONTROL: break; - case eReplicaComponentType::ROCKET_LANDING: + case eReplicaComponentType::ROCKET_ANIMATION_CONTROL: break; case eReplicaComponentType::TRIGGER: break; @@ -294,7 +294,7 @@ void Entity::Initialize() { break; case eReplicaComponentType::RACING_SOUND_TRIGGER: break; - case eReplicaComponentType::CHAT: + case eReplicaComponentType::CHAT_BUBBLE: break; case eReplicaComponentType::FRIENDS_LIST: break; @@ -328,9 +328,9 @@ void Entity::Initialize() { break; case eReplicaComponentType::IGNORE_LIST: break; - case eReplicaComponentType::ROCKET_LAUNCH_LUP: + case eReplicaComponentType::MULTI_ZONE_ENTRANCE: break; - case eReplicaComponentType::BUFF_REAL: + case eReplicaComponentType::BUFF: break; case eReplicaComponentType::INTERACTION_MANAGER: break; @@ -338,7 +338,7 @@ void Entity::Initialize() { break; case eReplicaComponentType::COMBAT_MEDIATOR: break; - case eReplicaComponentType::COMMENDATION_VENDOR: + case eReplicaComponentType::ACHIEVEMENT_VENDOR: break; case eReplicaComponentType::GATE_RUSH_CONTROL: break; @@ -370,8 +370,6 @@ void Entity::Initialize() { break; case eReplicaComponentType::NUMBER_OF_COMPONENTS: break; - case eReplicaComponentType::DESTROYABLE: - break; case eReplicaComponentType::INVALID: default: Game::logger->Log("Entity", "blah %i %i", componentId, m_TemplateID); @@ -483,7 +481,7 @@ void Entity::WriteBaseReplicaData(RakNet::BitStream* outBitStream, eReplicaPacke const auto& syncLDF = GetVar>(u"syncLDF"); // Only sync for models. - if (m_Settings.size() > 0 && (GetComponent() && !GetComponent())) { + if (m_Settings.size() > 0 && (GetComponent() && !GetComponent())) { outBitStream->Write1(); //ldf data RakNet::BitStream settingStream; @@ -1216,7 +1214,7 @@ const NiPoint3& Entity::GetPosition() const { return simple->GetPosition(); } - auto vehicle = GetComponent(); + auto vehicle = GetComponent(); if (vehicle != nullptr) { return vehicle->GetPosition(); @@ -1244,7 +1242,7 @@ const NiQuaternion& Entity::GetRotation() const { return simple->GetRotation(); } - auto vehicle = GetComponent(); + auto vehicle = GetComponent(); if (vehicle != nullptr) { return vehicle->GetRotation(); @@ -1272,7 +1270,7 @@ void Entity::SetPosition(NiPoint3 position) { simple->SetPosition(position); } - auto vehicle = GetComponent(); + auto vehicle = GetComponent(); if (vehicle != nullptr) { vehicle->SetPosition(position); @@ -1300,7 +1298,7 @@ void Entity::SetRotation(NiQuaternion rotation) { simple->SetRotation(rotation); } - auto vehicle = GetComponent(); + auto vehicle = GetComponent(); if (vehicle != nullptr) { vehicle->SetRotation(rotation); diff --git a/dGame/dComponents/CMakeLists.txt b/dGame/dComponents/CMakeLists.txt index b396829a..ad184373 100644 --- a/dGame/dComponents/CMakeLists.txt +++ b/dGame/dComponents/CMakeLists.txt @@ -11,7 +11,7 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp" "LUPExhibitComponent.cpp" "MissionComponent.cpp" "MissionOfferComponent.cpp" - "ModelComponent.cpp" + "ModelBehaviorComponent.cpp" "ModuleAssemblyComponent.cpp" "MovementAIComponent.cpp" "MovingPlatformComponent.cpp" @@ -30,7 +30,7 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp" "RebuildComponent.cpp" "RenderComponent.cpp" "RigidbodyPhantomPhysicsComponent.cpp" - "RocketLaunchLupComponent.cpp" + "MultiZoneEntranceComponent.cpp" "RocketLaunchpadControlComponent.cpp" "ScriptedActivityComponent.cpp" "ShootingGalleryComponent.cpp" @@ -39,5 +39,5 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp" "SoundTriggerComponent.cpp" "SwitchComponent.cpp" "TriggerComponent.cpp" - "VehiclePhysicsComponent.cpp" + "HavokVehiclePhysicsComponent.cpp" "VendorComponent.cpp" PARENT_SCOPE) diff --git a/dGame/dComponents/CharacterComponent.cpp b/dGame/dComponents/CharacterComponent.cpp index 7d757c62..94006e83 100644 --- a/dGame/dComponents/CharacterComponent.cpp +++ b/dGame/dComponents/CharacterComponent.cpp @@ -10,7 +10,6 @@ #include "InventoryComponent.h" #include "ControllablePhysicsComponent.h" #include "EntityManager.h" -#include "VehiclePhysicsComponent.h" #include "GameMessages.h" #include "Item.h" #include "Amf3.h" diff --git a/dGame/dComponents/ComponentHeirachy.md b/dGame/dComponents/ComponentHeirachy.md new file mode 100644 index 00000000..af384946 --- /dev/null +++ b/dGame/dComponents/ComponentHeirachy.md @@ -0,0 +1,148 @@ +Legend +``` +├── Explicit inheritance +├~~ Loaded with Parent +├-> SubComponent +├-? idk lol, but related +``` + + +```tree + +LWOActivityComponent +├── LWOShootingGalleryComponent +├── LWOScriptedActivityComponent + └── LWOBaseRacingControlComponent + ├── LWORacingControlComponent + └── LWOGateRushControlComponent +├── LWOQuickBuildComponent +├── LWOMiniGameControlComponent +LWOBaseCombatAIComponent +├~~ LWOPathfindingControlComponent +├~~ LWOProximityMonitorComponent +LWOBasePhysComponent +├── LWORigidBodyPhantomComponent +├── LWOPhantomPhysComponent +├── LWOVehiclePhysicsComponent +├── LWOSimplePhysComponent +├── LWOPhysicsSystemComponent +├── LWOHavokVehiclePhysicsComponent +├── LWOControllablePhysComponent +LWOBaseRenderComponent +├── LWOSkinnedRenderComponent +LWOBaseVendorComponent +├── LWOVendorComponent + ├~~ LWOProximityMonitorComponent +├── LWODonationVendorComponent + ├~~ LWOProximityMonitorComponent +├── LWOAchievementVendorComponent + ├~~ LWOProximityMonitorComponent +LWOBBBComponent_Common +├── LWOBBBComponent_Client +LWOBlueprintComponent +LWOBouncerComponent +LWOBuildControllerComponentCommon +├── LWOBuildControllerComponent +LWOChangelingBuildComponent +LWOCharacterComponent +├── LWOMinifigComponent +├~~ LWOPossessionControlComponent +├~~ LWOMountControlComponent +├~~ LWOPetCreatorComponent +├~~ LWOLevelProgressionComponent +├~~ LWOPlayerForcedMovementComponent + ├~? LWOPathfindingControlComponent +LWOChestComponent +LWOChoiceBuildComponent +LWOCollectibleComponent +LWOCustomBuildAssemblyComponent +LWODestroyableComponent +├~~ LWOBuffComponent +├~~ LWOStatusEffectComponent +LWODropEffectComponent +LWODroppedLootComponent +LWOExhibitComponent +LWOFXComponent +LWOGenericActivatorComponent +LWOGhostComponent +LWOHFLightDirectionGadgetComponent +LWOInventoryComponent_Common +├── LWOInventoryComponent_Client + └── LWOInventoryComponent_EquippedItem +LWOItemComponent +LWOLUPExhibitComponent +LWOMissionOfferComponent +LWOModelBehaviorComponent +├~~ LWOSimplePhysComponent +├~~ LWOControllablePhysComponent +├~~ LWOPathfindingControlComponent +├~~ LWOMutableModelBehaviorComponent +LWOModelBuilderComponent +LWOModularBuildComponentCommon +├── LWOModularBuildComponent +LWOModuleAssemblyComponent +├── LWOModuleAssemblyComponentCommon +LWOModuleComponentCommon +├── LWOModuleComponent +LWOMovementAIComponent +LWOMultiZoneEntranceComponent +LWOOverheadIconComponent +LWOPetComponent +├~~ LWOPathfindingControlComponent +├~? LWOItemComponent +├~? LWOModelBehaviorComponent + ├~~ ... +LWOPlatformBoundaryComponent +LWOPlatformComponent +├-> LWOMoverPlatformSubComponent +├-> LWOSimpleMoverPlatformSubComponent +├-> LWORotaterPlatformSubComponent +LWOProjectilePhysComponent +LWOPropertyComponent +LWOPropertyEntranceComponent +LWOPropertyManagementComponent +LWOPropertyVendorComponent +LWOProximityMonitorComponent +LWOSoundTriggerComponent +├── LWORacingSoundTriggerComponent +LWORacingStatsComponentCommon +├── LWORacingStatsComponent +LWORocketAnimationControlComponentCommon +├── LWORocketAnimationControlComponent +LWORocketLaunchpadControlComponentCommon +├── LWORocketLaunchpadControlComponent +LWOScriptComponent +├~~ LWOPathfindingControlComponent +├~~ LWOProximityMonitorComponent +LWOShowcaseModelHandlerComponent +LWOSkillComponent +LWOSoundAmbient2DComponent +LWOSoundAmbient3DComponent +LWOSoundRepeaterComponent +LWOSpawnComponent +LWOSpringpadComponent +LWOSwitchComponent +LWOTriggerComponent +LocalPlayer (not a component) +├~~ LWOInteractionManagerComponent +├~~ LWOUserControlComponent +├~~ LWOFriendsListComponent +├~~ LWOIgnoreListComponent +├~~ LWOTextEffectComponent +├~~ LWOChatBubbleComponent +├~~ LWOGuildComponent +├~~ LWOPlayerPetTamingComponent +├~~ LWOLocalSystemsComponent +├~~ LWOSlashCommandComponent +├~~ LWOMissionComponent +├~~ LWOPropertyEditorComponent +├~~ LWOComponent115 +├~~ LWOTeamsComponent +├~~ LWOChatComponent +├~~ LWOPetControlComponent +├~~ LWOTradeComponent +├~~ LWOPreconditionComponent +├~~ LWOFlagComponent +├~~ LWOFactionTriggerComponent + +``` diff --git a/dGame/dComponents/VehiclePhysicsComponent.cpp b/dGame/dComponents/HavokVehiclePhysicsComponent.cpp similarity index 63% rename from dGame/dComponents/VehiclePhysicsComponent.cpp rename to dGame/dComponents/HavokVehiclePhysicsComponent.cpp index c5818825..9fe44d7a 100644 --- a/dGame/dComponents/VehiclePhysicsComponent.cpp +++ b/dGame/dComponents/HavokVehiclePhysicsComponent.cpp @@ -1,7 +1,7 @@ -#include "VehiclePhysicsComponent.h" +#include "HavokVehiclePhysicsComponent.h" #include "EntityManager.h" -VehiclePhysicsComponent::VehiclePhysicsComponent(Entity* parent) : Component(parent) { +HavokVehiclePhysicsComponent::HavokVehiclePhysicsComponent(Entity* parent) : Component(parent) { m_Position = NiPoint3::ZERO; m_Rotation = NiQuaternion::IDENTITY; m_Velocity = NiPoint3::ZERO; @@ -14,52 +14,52 @@ VehiclePhysicsComponent::VehiclePhysicsComponent(Entity* parent) : Component(par m_EndBehavior = GeneralUtils::GenerateRandomNumber(0, 7); } -VehiclePhysicsComponent::~VehiclePhysicsComponent() { +HavokVehiclePhysicsComponent::~HavokVehiclePhysicsComponent() { } -void VehiclePhysicsComponent::SetPosition(const NiPoint3& pos) { +void HavokVehiclePhysicsComponent::SetPosition(const NiPoint3& pos) { m_Position = pos; } -void VehiclePhysicsComponent::SetRotation(const NiQuaternion& rot) { +void HavokVehiclePhysicsComponent::SetRotation(const NiQuaternion& rot) { m_DirtyPosition = true; m_Rotation = rot; } -void VehiclePhysicsComponent::SetVelocity(const NiPoint3& vel) { +void HavokVehiclePhysicsComponent::SetVelocity(const NiPoint3& vel) { m_DirtyPosition = true; m_Velocity = vel; } -void VehiclePhysicsComponent::SetAngularVelocity(const NiPoint3& vel) { +void HavokVehiclePhysicsComponent::SetAngularVelocity(const NiPoint3& vel) { m_DirtyPosition = true; m_AngularVelocity = vel; } -void VehiclePhysicsComponent::SetIsOnGround(bool val) { +void HavokVehiclePhysicsComponent::SetIsOnGround(bool val) { m_DirtyPosition = true; m_IsOnGround = val; } -void VehiclePhysicsComponent::SetIsOnRail(bool val) { +void HavokVehiclePhysicsComponent::SetIsOnRail(bool val) { m_DirtyPosition = true; m_IsOnRail = val; } -void VehiclePhysicsComponent::SetDirtyPosition(bool val) { +void HavokVehiclePhysicsComponent::SetDirtyPosition(bool val) { m_DirtyPosition = val; } -void VehiclePhysicsComponent::SetDirtyVelocity(bool val) { +void HavokVehiclePhysicsComponent::SetDirtyVelocity(bool val) { m_DirtyVelocity = val; } -void VehiclePhysicsComponent::SetDirtyAngularVelocity(bool val) { +void HavokVehiclePhysicsComponent::SetDirtyAngularVelocity(bool val) { m_DirtyAngularVelocity = val; } -void VehiclePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) { +void HavokVehiclePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) { outBitStream->Write(bIsInitialUpdate || m_DirtyPosition); if (bIsInitialUpdate || m_DirtyPosition) { @@ -101,7 +101,7 @@ void VehiclePhysicsComponent::Serialize(RakNet::BitStream* outBitStream, bool bI outBitStream->Write0(); } -void VehiclePhysicsComponent::Update(float deltaTime) { +void HavokVehiclePhysicsComponent::Update(float deltaTime) { if (m_SoftUpdate > 5) { EntityManager::Instance()->SerializeEntity(m_OwningEntity); diff --git a/dGame/dComponents/VehiclePhysicsComponent.h b/dGame/dComponents/HavokVehiclePhysicsComponent.h similarity index 92% rename from dGame/dComponents/VehiclePhysicsComponent.h rename to dGame/dComponents/HavokVehiclePhysicsComponent.h index 64609edf..4684689f 100644 --- a/dGame/dComponents/VehiclePhysicsComponent.h +++ b/dGame/dComponents/HavokVehiclePhysicsComponent.h @@ -8,12 +8,12 @@ /** * Physics component for vehicles. */ -class VehiclePhysicsComponent : public Component { +class HavokVehiclePhysicsComponent : public Component { public: - static const eReplicaComponentType ComponentType = eReplicaComponentType::VEHICLE_PHYSICS; + static const eReplicaComponentType ComponentType = eReplicaComponentType::HAVOK_VEHICLE_PHYSICS; - VehiclePhysicsComponent(Entity* parentEntity); - ~VehiclePhysicsComponent() override; + HavokVehiclePhysicsComponent(Entity* parentEntity); + ~HavokVehiclePhysicsComponent() override; void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags); diff --git a/dGame/dComponents/InventoryComponent.cpp b/dGame/dComponents/InventoryComponent.cpp index 1cbef0e0..24fb50e6 100644 --- a/dGame/dComponents/InventoryComponent.cpp +++ b/dGame/dComponents/InventoryComponent.cpp @@ -19,7 +19,7 @@ #include "PossessorComponent.h" #include "PossessableComponent.h" #include "ModuleAssemblyComponent.h" -#include "VehiclePhysicsComponent.h" +#include "HavokVehiclePhysicsComponent.h" #include "CharacterComponent.h" #include "dZoneManager.h" #include "PropertyManagementComponent.h" @@ -826,7 +826,7 @@ void InventoryComponent::EquipItem(Item* item, const bool skipChecks) { if (character != nullptr && !skipChecks) { // Hacky proximity rocket if (item->GetLot() == 6416) { - const auto rocketLauchPads = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::ROCKET_LAUNCH); + const auto rocketLauchPads = EntityManager::Instance()->GetEntitiesByComponent(eReplicaComponentType::ROCKET_LAUNCHPAD_CONTROL); const auto position = m_OwningEntity->GetPosition(); @@ -986,8 +986,8 @@ 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 vehicleComponent = mount->GetComponent(); - if (vehicleComponent) { + auto havokVehiclePhysicsComponent = mount->GetComponent(); + if (havokVehiclePhysicsComponent) { auto angles = startRotation.GetEulerAngles(); // Make it right side up angles.x -= PI; @@ -1024,7 +1024,7 @@ void InventoryComponent::HandlePossession(Item* item) { EntityManager::Instance()->SerializeEntity(m_OwningEntity); // have to unlock the input so it vehicle can be driven - if (vehicleComponent) GameMessages::SendVehicleUnlockInput(mount->GetObjectID(), false, m_OwningEntity->GetSystemAddress()); + if (havokVehiclePhysicsComponent) GameMessages::SendVehicleUnlockInput(mount->GetObjectID(), false, m_OwningEntity->GetSystemAddress()); GameMessages::SendMarkInventoryItemAsActive(m_OwningEntity->GetObjectID(), true, eUnequippableActiveType::MOUNT, item->GetId(), m_OwningEntity->GetSystemAddress()); } diff --git a/dGame/dComponents/ModelComponent.cpp b/dGame/dComponents/ModelBehaviorComponent.cpp similarity index 82% rename from dGame/dComponents/ModelComponent.cpp rename to dGame/dComponents/ModelBehaviorComponent.cpp index 91924b5c..73a73052 100644 --- a/dGame/dComponents/ModelComponent.cpp +++ b/dGame/dComponents/ModelBehaviorComponent.cpp @@ -1,14 +1,14 @@ -#include "ModelComponent.h" +#include "ModelBehaviorComponent.h" #include "Entity.h" -ModelComponent::ModelComponent(Entity* parent) : Component(parent) { +ModelBehaviorComponent::ModelBehaviorComponent(Entity* parent) : Component(parent) { m_OriginalPosition = m_OwningEntity->GetDefaultPosition(); m_OriginalRotation = m_OwningEntity->GetDefaultRotation(); m_userModelID = m_OwningEntity->GetVarAs(u"userModelID"); } -void ModelComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) { +void ModelBehaviorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) { // ItemComponent Serialization. Pets do not get this serialization. if (!m_OwningEntity->HasComponent(eReplicaComponentType::PET)) { outBitStream->Write1(); diff --git a/dGame/dComponents/ModelComponent.h b/dGame/dComponents/ModelBehaviorComponent.h similarity index 92% rename from dGame/dComponents/ModelComponent.h rename to dGame/dComponents/ModelBehaviorComponent.h index b5224869..233c86bb 100644 --- a/dGame/dComponents/ModelComponent.h +++ b/dGame/dComponents/ModelBehaviorComponent.h @@ -11,11 +11,11 @@ class Entity; /** * Component that represents entities that are a model, e.g. collectible models and BBB models. */ -class ModelComponent : public Component { +class ModelBehaviorComponent : public Component { public: - static const eReplicaComponentType ComponentType = eReplicaComponentType::MODEL; + static const eReplicaComponentType ComponentType = eReplicaComponentType::MODEL_BEHAVIOR; - ModelComponent(Entity* parent); + ModelBehaviorComponent(Entity* parent); void Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags); diff --git a/dGame/dComponents/RocketLaunchLupComponent.cpp b/dGame/dComponents/MultiZoneEntranceComponent.cpp similarity index 73% rename from dGame/dComponents/RocketLaunchLupComponent.cpp rename to dGame/dComponents/MultiZoneEntranceComponent.cpp index 442ee09c..012d5b3b 100644 --- a/dGame/dComponents/RocketLaunchLupComponent.cpp +++ b/dGame/dComponents/MultiZoneEntranceComponent.cpp @@ -1,9 +1,9 @@ -#include "RocketLaunchLupComponent.h" +#include "MultiZoneEntranceComponent.h" #include "RocketLaunchpadControlComponent.h" #include "InventoryComponent.h" #include "CharacterComponent.h" -RocketLaunchLupComponent::RocketLaunchLupComponent(Entity* parent) : Component(parent) { +MultiZoneEntranceComponent::MultiZoneEntranceComponent(Entity* parent) : Component(parent) { m_OwningEntity = parent; std::string zoneString = GeneralUtils::UTF16ToWTF8(m_OwningEntity->GetVar(u"MultiZoneIDs")); std::stringstream ss(zoneString); @@ -14,9 +14,9 @@ RocketLaunchLupComponent::RocketLaunchLupComponent(Entity* parent) : Component(p } } -RocketLaunchLupComponent::~RocketLaunchLupComponent() {} +MultiZoneEntranceComponent::~MultiZoneEntranceComponent() {} -void RocketLaunchLupComponent::OnUse(Entity* originator) { +void MultiZoneEntranceComponent::OnUse(Entity* originator) { auto rocket = originator->GetComponent()->RocketEquip(originator); if (!rocket) return; @@ -24,7 +24,7 @@ void RocketLaunchLupComponent::OnUse(Entity* originator) { GameMessages::SendPropertyEntranceBegin(m_OwningEntity->GetObjectID(), m_OwningEntity->GetSystemAddress()); } -void RocketLaunchLupComponent::OnSelectWorld(Entity* originator, uint32_t index) { +void MultiZoneEntranceComponent::OnSelectWorld(Entity* originator, uint32_t index) { auto rocketLaunchpadControlComponent = m_OwningEntity->GetComponent(); if (!rocketLaunchpadControlComponent) return; diff --git a/dGame/dComponents/RocketLaunchLupComponent.h b/dGame/dComponents/MultiZoneEntranceComponent.h similarity index 85% rename from dGame/dComponents/RocketLaunchLupComponent.h rename to dGame/dComponents/MultiZoneEntranceComponent.h index 226fa1b2..b230c1fe 100644 --- a/dGame/dComponents/RocketLaunchLupComponent.h +++ b/dGame/dComponents/MultiZoneEntranceComponent.h @@ -9,16 +9,16 @@ * Component that handles the LUP/WBL rocket launchpad that can be interacted with to travel to WBL worlds. * */ -class RocketLaunchLupComponent : public Component { +class MultiZoneEntranceComponent : public Component { public: - static const eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCH_LUP; + static const eReplicaComponentType ComponentType = eReplicaComponentType::MULTI_ZONE_ENTRANCE; /** * Constructor for this component, builds the m_LUPWorlds vector * @param parent parent that contains this component */ - RocketLaunchLupComponent(Entity* parent); - ~RocketLaunchLupComponent() override; + MultiZoneEntranceComponent(Entity* parent); + ~MultiZoneEntranceComponent() override; /** * Handles an OnUse event from some entity, preparing it for launch to some other world diff --git a/dGame/dComponents/RacingControlComponent.cpp b/dGame/dComponents/RacingControlComponent.cpp index 6350107f..1e945505 100644 --- a/dGame/dComponents/RacingControlComponent.cpp +++ b/dGame/dComponents/RacingControlComponent.cpp @@ -17,7 +17,6 @@ #include "PossessorComponent.h" #include "eRacingTaskParam.h" #include "Spawner.h" -#include "VehiclePhysicsComponent.h" #include "dServer.h" #include "dZoneManager.h" #include "dConfig.h" diff --git a/dGame/dComponents/RocketLaunchpadControlComponent.cpp b/dGame/dComponents/RocketLaunchpadControlComponent.cpp index 5376faa7..718a8f11 100644 --- a/dGame/dComponents/RocketLaunchpadControlComponent.cpp +++ b/dGame/dComponents/RocketLaunchpadControlComponent.cpp @@ -13,7 +13,7 @@ #include "ChatPackets.h" #include "MissionComponent.h" #include "PropertyEntranceComponent.h" -#include "RocketLaunchLupComponent.h" +#include "MultiZoneEntranceComponent.h" #include "dServer.h" #include "PacketUtils.h" #include "eObjectWorldState.h" @@ -94,8 +94,8 @@ void RocketLaunchpadControlComponent::OnUse(Entity* originator) { return; } - auto rocketLaunchLUP = m_OwningEntity->GetComponent(); - if (rocketLaunchLUP) { + auto multiZoneEntranceComponent = m_OwningEntity->GetComponent(); + if (multiZoneEntranceComponent) { return; } diff --git a/dGame/dComponents/RocketLaunchpadControlComponent.h b/dGame/dComponents/RocketLaunchpadControlComponent.h index 84cff22d..0804ba8d 100644 --- a/dGame/dComponents/RocketLaunchpadControlComponent.h +++ b/dGame/dComponents/RocketLaunchpadControlComponent.h @@ -18,7 +18,7 @@ class PreconditionExpression; */ class RocketLaunchpadControlComponent : public Component { public: - static const eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCH; + static const eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCHPAD_CONTROL; RocketLaunchpadControlComponent(Entity* parent, int rocketId); ~RocketLaunchpadControlComponent() override; diff --git a/dGame/dGameMessages/GameMessages.cpp b/dGame/dGameMessages/GameMessages.cpp index 0d3b192d..ce12011c 100644 --- a/dGame/dGameMessages/GameMessages.cpp +++ b/dGame/dGameMessages/GameMessages.cpp @@ -24,7 +24,7 @@ #include "dConfig.h" #include "TeamManager.h" #include "ChatPackets.h" -#include "RocketLaunchLupComponent.h" +#include "MultiZoneEntranceComponent.h" #include "eUnequippableActiveType.h" #include "eMovementPlatformState.h" #include "LeaderboardManager.h" @@ -69,7 +69,6 @@ #include "MovingPlatformComponent.h" #include "PetComponent.h" #include "ModuleAssemblyComponent.h" -#include "VehiclePhysicsComponent.h" #include "RenderComponent.h" #include "PossessableComponent.h" #include "PossessorComponent.h" @@ -2809,9 +2808,9 @@ void GameMessages::HandleEnterProperty(RakNet::BitStream* inStream, Entity* enti return; } - auto rocketLaunchLupComponent = entity->GetComponent(); - if (rocketLaunchLupComponent != nullptr) { - rocketLaunchLupComponent->OnSelectWorld(player, index); + auto multiZoneEntranceComponent = entity->GetComponent(); + if (multiZoneEntranceComponent != nullptr) { + multiZoneEntranceComponent->OnSelectWorld(player, index); } } diff --git a/dGame/dPropertyBehaviors/ControlBehaviors.cpp b/dGame/dPropertyBehaviors/ControlBehaviors.cpp index 5e7b5c00..974dd9a2 100644 --- a/dGame/dPropertyBehaviors/ControlBehaviors.cpp +++ b/dGame/dPropertyBehaviors/ControlBehaviors.cpp @@ -4,7 +4,7 @@ #include "Entity.h" #include "Game.h" #include "GameMessages.h" -#include "ModelComponent.h" +#include "ModelBehaviorComponent.h" #include "../../dWorldServer/ObjectIDManager.h" #include "dLogger.h" #include "BehaviorStates.h" @@ -30,7 +30,7 @@ #include "UpdateActionMessage.h" #include "UpdateStripUiMessage.h" -void ControlBehaviors::RequestUpdatedID(int32_t behaviorID, std::shared_ptr modelComponent, Entity* modelOwner, const SystemAddress& sysAddr) { +void ControlBehaviors::RequestUpdatedID(int32_t behaviorID, std::shared_ptr modelComponent, Entity* modelOwner, const SystemAddress& sysAddr) { // auto behavior = modelComponent->FindBehavior(behaviorID); // if (behavior->GetBehaviorID() == -1 || behavior->GetShouldSetNewID()) { // ObjectIDManager::Instance()->RequestPersistentID( @@ -57,7 +57,7 @@ void ControlBehaviors::RequestUpdatedID(int32_t behaviorID, std::shared_ptrGetComponent(); + auto modelComponent = modelEntity->GetComponent(); if (!modelComponent) return; @@ -79,7 +79,7 @@ void ControlBehaviors::SendBehaviorListToClient(Entity* modelEntity, const Syste GameMessages::SendUIMessageServerToSingleClient(modelOwner, sysAddr, "UpdateBehaviorList", behaviorsToSerialize); } -void ControlBehaviors::ModelTypeChanged(AMFArrayValue* arguments, std::shared_ptr ModelComponent) { +void ControlBehaviors::ModelTypeChanged(AMFArrayValue* arguments, std::shared_ptr ModelBehaviorComponent) { auto* modelTypeAmf = arguments->Get("ModelType"); if (!modelTypeAmf) return; @@ -137,7 +137,7 @@ void ControlBehaviors::Rename(Entity* modelEntity, const SystemAddress& sysAddr, } // TODO This is also supposed to serialize the state of the behaviors in progress but those aren't implemented yet -void ControlBehaviors::SendBehaviorBlocksToClient(std::shared_ptr modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments) { +void ControlBehaviors::SendBehaviorBlocksToClient(std::shared_ptr modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments) { // uint32_t behaviorID = ControlBehaviors::GetBehaviorIDFromArgument(arguments); // auto modelBehavior = modelComponent->FindBehavior(behaviorID); @@ -266,7 +266,7 @@ void ControlBehaviors::UpdateAction(AMFArrayValue* arguments) { } } -void ControlBehaviors::MoveToInventory(std::shared_ptr modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments) { +void ControlBehaviors::MoveToInventory(std::shared_ptr modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments) { // This closes the UI menu should it be open while the player is removing behaviors AMFArrayValue args; @@ -281,7 +281,7 @@ void ControlBehaviors::MoveToInventory(std::shared_ptr modelComp void ControlBehaviors::ProcessCommand(Entity* modelEntity, const SystemAddress& sysAddr, AMFArrayValue* arguments, std::string command, Entity* modelOwner) { if (!isInitialized || !modelEntity || !modelOwner || !arguments) return; - auto modelComponent = modelEntity->GetComponent(); + auto modelComponent = modelEntity->GetComponent(); if (!modelComponent) return; @@ -342,7 +342,7 @@ ControlBehaviors::ControlBehaviors() { std::string buffer{}; bool commentBlockStart = false; while (std::getline(blocksBuffer, read)) { - // tinyxml2 should handle comment blocks but the client has one that fails the processing. + // tinyxml2 should handle comment blocks but the client has one that fails the processing. // This preprocessing just removes all comments from the read file out of an abundance of caution. if (read.find("