Remove AI_CNDT from AI package types

AI_CNDT is a label of subrecord containing cell name. It's not AI package type.
make_linux_ci_do_zoomies
elsid 2 years ago
parent 20abe6dcf5
commit 51314db2f1
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -239,14 +239,17 @@ std::string_view weaponTypeLabel(int idx)
return "Invalid";
}
std::string_view aiTypeLabel(int type)
{
if (type == ESM::AI_Wander) return "Wander";
else if (type == ESM::AI_Travel) return "Travel";
else if (type == ESM::AI_Follow) return "Follow";
else if (type == ESM::AI_Escort) return "Escort";
else if (type == ESM::AI_Activate) return "Activate";
else return "Invalid";
std::string_view aiTypeLabel(ESM::AiPackageType type)
{
switch (type)
{
case ESM::AI_Wander: return "Wander";
case ESM::AI_Travel: return "Travel";
case ESM::AI_Follow: return "Follow";
case ESM::AI_Escort: return "Escort";
case ESM::AI_Activate: return "Activate";
}
return "Invalid";
}
std::string_view magicEffectLabel(int idx)

@ -2,6 +2,9 @@
#define OPENMW_ESMTOOL_LABELS_H
#include <string>
#include <string_view>
#include <components/esm3/aipackage.hpp>
std::string_view bodyPartLabel(int idx);
std::string_view meshPartLabel(int idx);
@ -16,7 +19,7 @@ std::string_view weaponTypeLabel(int idx);
// This function's a bit different because the types are record types,
// not consecutive values.
std::string_view aiTypeLabel(int type);
std::string_view aiTypeLabel(ESM::AiPackageType type);
// This one's also a bit different, because it enumerates dialog
// select rule functions, not types. Structurally, it still converts

@ -1756,7 +1756,6 @@ namespace CSMWorld
case ESM::AI_Follow: return 2;
case ESM::AI_Escort: return 3;
case ESM::AI_Activate: return 4;
case ESM::AI_CNDT:
default: return QVariant();
}
case 1: // wander dist

@ -58,21 +58,22 @@ namespace ESM
#pragma pack(pop)
enum
enum AiPackageType : std::uint32_t
{
AI_Wander = 0x575f4941,
AI_Travel = 0x545f4941,
AI_Follow = 0x465f4941,
AI_Escort = 0x455f4941,
AI_Activate = 0x415f4941,
AI_CNDT = 0x54444e43
};
inline constexpr std::uint32_t AI_CNDT = 0x54444e43;
/// \note Used for storaging packages in a single container
/// w/o manual memory allocation accordingly to policy standards
struct AIPackage
{
int mType;
AiPackageType mType;
// Anonymous union
union

Loading…
Cancel
Save