chore: use constants for model array sizes in iw5 attachment writing

This commit is contained in:
Jan 2024-04-14 17:46:34 +02:00
parent 83f57e1961
commit 28949f4ee8
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C
2 changed files with 7 additions and 3 deletions

View File

@ -510,6 +510,10 @@ namespace IW5
{WEAPCLASS_ITEM, "item" }, {WEAPCLASS_ITEM, "item" },
}); });
constexpr auto ATTACHMENT_WORLD_MODEL_COUNT = 16u;
constexpr auto ATTACHMENT_VIEW_MODEL_COUNT = 16u;
constexpr auto ATTACHMENT_RETICLE_VIEW_MODEL_COUNT = 8u;
class JsonWeaponAttachment class JsonWeaponAttachment
{ {
public: public:

View File

@ -68,9 +68,9 @@ namespace
jAttachment.weaponType = attachment.weaponType; jAttachment.weaponType = attachment.weaponType;
jAttachment.weapClass = attachment.weapClass; jAttachment.weapClass = attachment.weapClass;
CONVERT_XMODEL_ARRAY(worldModels, 16u) CONVERT_XMODEL_ARRAY(worldModels, ATTACHMENT_WORLD_MODEL_COUNT)
CONVERT_XMODEL_ARRAY(viewModels, 16u) CONVERT_XMODEL_ARRAY(viewModels, ATTACHMENT_VIEW_MODEL_COUNT)
CONVERT_XMODEL_ARRAY(reticleViewModels, 8u) CONVERT_XMODEL_ARRAY(reticleViewModels, ATTACHMENT_RETICLE_VIEW_MODEL_COUNT)
CONVERT_ATTRIBUTE(JsonAttAmmoGeneral, ammoGeneral) CONVERT_ATTRIBUTE(JsonAttAmmoGeneral, ammoGeneral)
CONVERT_ATTRIBUTE(JsonAttSight, sight) CONVERT_ATTRIBUTE(JsonAttSight, sight)