Add component order array

fix loop in inven comp
This commit is contained in:
Aaron Kimbre 2023-06-29 12:44:06 -05:00
parent 81404d9671
commit 6fb1786cf1
3 changed files with 85 additions and 1 deletions

View File

@ -79,7 +79,7 @@ InventoryComponent::InventoryComponent(Entity* parent, tinyxml2::XMLDocument* do
subItems.erase(std::remove_if(subItems.begin(), subItems.end(), ::isspace), subItems.end()); 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, ','); const auto subItemsSplit = GeneralUtils::SplitString(subItems, ',');
for (const auto& proxyLotAsString : subItemsSplit) { for (const auto& proxyLotAsString : subItemsSplit) {

View File

@ -117,6 +117,89 @@ const std::vector<ComponentWhitelist> Entity::m_ComponentWhitelists = {
}, },
}; };
const std::array<eReplicaComponentType, 80> 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) { Entity::Entity(const LWOOBJID& objectID, EntityInfo info, Entity* parentEntity) {
m_ObjectID = objectID; m_ObjectID = objectID;
m_TemplateID = info.lot; m_TemplateID = info.lot;

View File

@ -379,6 +379,7 @@ protected:
std::vector<LWOOBJID> m_TargetsInPhantom; std::vector<LWOOBJID> m_TargetsInPhantom;
static const std::vector<ComponentWhitelist> m_ComponentWhitelists; static const std::vector<ComponentWhitelist> m_ComponentWhitelists;
static const std::array<eReplicaComponentType> m_ComponentOrder;
}; };
#include "Entity.tcc" #include "Entity.tcc"