From 6fb1786cf12423bd49e07c3c9e71c72079aa2355 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Thu, 29 Jun 2023 12:44:06 -0500 Subject: [PATCH] Add component order array fix loop in inven comp --- dGame/dComponents/InventoryComponent.cpp | 2 +- dGame/dEntity/Entity.cpp | 83 ++++++++++++++++++++++++ dGame/dEntity/Entity.h | 1 + 3 files changed, 85 insertions(+), 1 deletion(-) diff --git a/dGame/dComponents/InventoryComponent.cpp b/dGame/dComponents/InventoryComponent.cpp index 0e1c2427..2f65c62c 100644 --- a/dGame/dComponents/InventoryComponent.cpp +++ b/dGame/dComponents/InventoryComponent.cpp @@ -79,7 +79,7 @@ InventoryComponent::InventoryComponent(Entity* parent, tinyxml2::XMLDocument* do subItems.erase(std::remove_if(subItems.begin(), subItems.end(), ::isspace), subItems.end()); - if (subItems.empty()) return; + if (subItems.empty()) continue; const auto subItemsSplit = GeneralUtils::SplitString(subItems, ','); for (const auto& proxyLotAsString : subItemsSplit) { diff --git a/dGame/dEntity/Entity.cpp b/dGame/dEntity/Entity.cpp index 274c7385..c6553f72 100644 --- a/dGame/dEntity/Entity.cpp +++ b/dGame/dEntity/Entity.cpp @@ -117,6 +117,89 @@ const std::vector Entity::m_ComponentWhitelists = { }, }; +const std::array Entity::m_ComponentOrder = { + eReplicaComponentType::POSSESSABLE, + eReplicaComponentType::BLUEPRINT, + eReplicaComponentType::MODULE_ASSEMBLY, + eReplicaComponentType::CONTROLLABLE_PHYSICS, + eReplicaComponentType::PROJECTILE_PHYSICS, + eReplicaComponentType::PHYSICS_SYSTEM, + eReplicaComponentType::VEHICLE_PHYSICS, + eReplicaComponentType::HAVOK_VEHICLE_PHYSICS, + eReplicaComponentType::RIGID_BODY_PHANTOM_PHYSICS, + eReplicaComponentType::SIMPLE_PHYSICS, + eReplicaComponentType::PHANTOM_PHYSICS, + eReplicaComponentType::DESTROYABLE, + eReplicaComponentType::MINIFIG, + eReplicaComponentType::CHARACTER, + eReplicaComponentType::PLAYER_FORCED_MOVEMENT, + eReplicaComponentType::POSSESSION, + eReplicaComponentType::MOUNT_CONTROL, + eReplicaComponentType::PET, + eReplicaComponentType::INVENTORY, + eReplicaComponentType::PROXIMITY_MONITOR, + eReplicaComponentType::MOVEMENT_AI, + eReplicaComponentType::SCRIPT, + eReplicaComponentType::SKILL, + eReplicaComponentType::BASE_COMBAT_AI, + eReplicaComponentType::SPAWN, + eReplicaComponentType::ITEM, + eReplicaComponentType::QUICK_BUILD, + eReplicaComponentType::BUILD_BORDER, + eReplicaComponentType::MODULE, + eReplicaComponentType::BUILD_CONTROLLER, + eReplicaComponentType::BUILD_ACTIVATOR, + eReplicaComponentType::QUICK_BUILD, + eReplicaComponentType::MISSION_OFFER, + eReplicaComponentType::VENDOR, + eReplicaComponentType::DONATION_VENDOR, + eReplicaComponentType::ACHIEVEMENT_VENDOR, + eReplicaComponentType::SHOOTING_GALLERY, + eReplicaComponentType::ROLLER, + eReplicaComponentType::SCRIPTED_ACTIVITY, + eReplicaComponentType::COLLECTIBLE, + eReplicaComponentType::MOVING_PLATFORM, + eReplicaComponentType::CHANGLING_BUILD, + eReplicaComponentType::CHOICE_BUILD, + eReplicaComponentType::PACKAGE, + eReplicaComponentType::PLATFORM_BOUNDARY, + eReplicaComponentType::HF_LIGHT_DIRECTION_GADGET, + eReplicaComponentType::CULLING_PLANE, + eReplicaComponentType::EXHIBIT, + eReplicaComponentType::LUP_EXHIBIT, + eReplicaComponentType::PROPERTY, + eReplicaComponentType::PROPERTY_PLAQUE, + eReplicaComponentType::MODEL_BEHAVIOR, + eReplicaComponentType::PROPERTY_ENTRANCE, + eReplicaComponentType::MULTI_ZONE_ENTRANCE, + eReplicaComponentType::PROPERTY_MANAGEMENT, + eReplicaComponentType::RAIL_ACTIVATOR, + eReplicaComponentType::BOUNCER, + eReplicaComponentType::SPRINGPAD, + eReplicaComponentType::SWITCH, + eReplicaComponentType::MINIGAME_CONTROL, + eReplicaComponentType::MODEL_BUILDER, + eReplicaComponentType::SOUND_REPEATER, + eReplicaComponentType::CHEST, + eReplicaComponentType::SHOWCASE_MODEL_HANDLER, + eReplicaComponentType::JETPACKPAD, + eReplicaComponentType::RENDER, + eReplicaComponentType::SOUND_AMBIENT_2D, + eReplicaComponentType::SOUND_AMBIENT_3D, + eReplicaComponentType::SOUND_TRIGGER, + eReplicaComponentType::RACING_SOUND_TRIGGER, + eReplicaComponentType::CUSTOM_BUILD_ASSEMBLY, + eReplicaComponentType::GENERIC_ACTIVATOR, + eReplicaComponentType::PROPERTY_VENDOR, + eReplicaComponentType::ROCKET_LAUNCHPAD_CONTROL, + eReplicaComponentType::ROCKET_ANIMATION_CONTROL, + eReplicaComponentType::FACTION_TRIGGER, + eReplicaComponentType::RACING_CONTROL, + eReplicaComponentType::GATE_RUSH_CONTROL, + eReplicaComponentType::BBB, + eReplicaComponentType::CRAFTING +}; + Entity::Entity(const LWOOBJID& objectID, EntityInfo info, Entity* parentEntity) { m_ObjectID = objectID; m_TemplateID = info.lot; diff --git a/dGame/dEntity/Entity.h b/dGame/dEntity/Entity.h index 504f03bb..97217c69 100644 --- a/dGame/dEntity/Entity.h +++ b/dGame/dEntity/Entity.h @@ -379,6 +379,7 @@ protected: std::vector m_TargetsInPhantom; static const std::vector m_ComponentWhitelists; + static const std::array m_ComponentOrder; }; #include "Entity.tcc"