mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 16:15:43 +00:00
Use countof and enum num entries to get the amount of entries in t6 weaponfulldef
This commit is contained in:
parent
eb97560e0d
commit
b5141bcd1c
@ -1514,102 +1514,93 @@ void AssetDumperWeapon::CopyToFullDef(const WeaponVariantDef* weapon, WeaponFull
|
|||||||
|
|
||||||
if (weapon->attachments)
|
if (weapon->attachments)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->attachments, sizeof WeaponFullDef::attachments, weapon->attachments, sizeof(void*) * 63);
|
memcpy_s(fullDef->attachments, sizeof WeaponFullDef::attachments, weapon->attachments, sizeof(void*) * _countof(WeaponFullDef::attachments));
|
||||||
fullDef->weapVariantDef.attachments = fullDef->attachments;
|
fullDef->weapVariantDef.attachments = fullDef->attachments;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weapon->attachmentUniques)
|
if (weapon->attachmentUniques)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->attachmentUniques, sizeof WeaponFullDef::attachmentUniques, weapon->attachmentUniques,
|
memcpy_s(fullDef->attachmentUniques, sizeof WeaponFullDef::attachmentUniques, weapon->attachmentUniques, sizeof(void*) * _countof(WeaponFullDef::attachmentUniques));
|
||||||
sizeof(void*) * 95);
|
|
||||||
fullDef->weapVariantDef.attachmentUniques = fullDef->attachmentUniques;
|
fullDef->weapVariantDef.attachmentUniques = fullDef->attachmentUniques;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullDef->weapDef.gunXModel)
|
if (fullDef->weapDef.gunXModel)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->gunXModel, sizeof WeaponFullDef::gunXModel, fullDef->weapDef.gunXModel, sizeof(void*) * 16);
|
memcpy_s(fullDef->gunXModel, sizeof WeaponFullDef::gunXModel, fullDef->weapDef.gunXModel, sizeof(void*) * _countof(WeaponFullDef::gunXModel));
|
||||||
fullDef->weapDef.gunXModel = fullDef->gunXModel;
|
fullDef->weapDef.gunXModel = fullDef->gunXModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weapon->szXAnims)
|
if (weapon->szXAnims)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->szXAnims, sizeof WeaponFullDef::szXAnims, weapon->szXAnims, sizeof(void*) * 88);
|
memcpy_s(fullDef->szXAnims, sizeof WeaponFullDef::szXAnims, weapon->szXAnims, sizeof(void*) * NUM_WEAP_ANIMS);
|
||||||
fullDef->weapVariantDef.szXAnims = fullDef->szXAnims;
|
fullDef->weapVariantDef.szXAnims = fullDef->szXAnims;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weapon->hideTags)
|
if (weapon->hideTags)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->hideTags, sizeof WeaponFullDef::hideTags, weapon->hideTags, sizeof(scr_string_t) * 32);
|
memcpy_s(fullDef->hideTags, sizeof WeaponFullDef::hideTags, weapon->hideTags, sizeof(scr_string_t) * _countof(WeaponFullDef::hideTags));
|
||||||
fullDef->weapVariantDef.hideTags = fullDef->hideTags;
|
fullDef->weapVariantDef.hideTags = fullDef->hideTags;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullDef->weapDef.notetrackSoundMapKeys)
|
if (fullDef->weapDef.notetrackSoundMapKeys)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->notetrackSoundMapKeys, sizeof WeaponFullDef::notetrackSoundMapKeys,
|
memcpy_s(fullDef->notetrackSoundMapKeys, sizeof WeaponFullDef::notetrackSoundMapKeys, fullDef->weapDef.notetrackSoundMapKeys,
|
||||||
fullDef->weapDef.notetrackSoundMapKeys, sizeof(scr_string_t) * 20);
|
sizeof(scr_string_t) * _countof(WeaponFullDef::notetrackSoundMapKeys));
|
||||||
fullDef->weapDef.notetrackSoundMapKeys = fullDef->notetrackSoundMapKeys;
|
fullDef->weapDef.notetrackSoundMapKeys = fullDef->notetrackSoundMapKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullDef->weapDef.notetrackSoundMapValues)
|
if (fullDef->weapDef.notetrackSoundMapValues)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->notetrackSoundMapValues, sizeof WeaponFullDef::notetrackSoundMapValues,
|
memcpy_s(fullDef->notetrackSoundMapValues, sizeof WeaponFullDef::notetrackSoundMapValues, fullDef->weapDef.notetrackSoundMapValues,
|
||||||
fullDef->weapDef.notetrackSoundMapValues, sizeof(scr_string_t) * 20);
|
sizeof(scr_string_t) * _countof(WeaponFullDef::notetrackSoundMapValues));
|
||||||
fullDef->weapDef.notetrackSoundMapValues = fullDef->notetrackSoundMapValues;
|
fullDef->weapDef.notetrackSoundMapValues = fullDef->notetrackSoundMapValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullDef->weapDef.worldModel)
|
if (fullDef->weapDef.worldModel)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->worldModel, sizeof WeaponFullDef::worldModel, fullDef->weapDef.worldModel,
|
memcpy_s(fullDef->worldModel, sizeof WeaponFullDef::worldModel, fullDef->weapDef.worldModel, sizeof(void*) * _countof(WeaponFullDef::worldModel));
|
||||||
sizeof(void*) * 16);
|
|
||||||
fullDef->weapDef.worldModel = fullDef->worldModel;
|
fullDef->weapDef.worldModel = fullDef->worldModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weapon->attachViewModel)
|
if (weapon->attachViewModel)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->attachViewModel, sizeof WeaponFullDef::attachViewModel, weapon->attachViewModel,
|
memcpy_s(fullDef->attachViewModel, sizeof WeaponFullDef::attachViewModel, weapon->attachViewModel, sizeof(void*) * _countof(WeaponFullDef::attachViewModel));
|
||||||
sizeof(void*) * 8);
|
|
||||||
fullDef->weapVariantDef.attachViewModel = fullDef->attachViewModel;
|
fullDef->weapVariantDef.attachViewModel = fullDef->attachViewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weapon->attachWorldModel)
|
if (weapon->attachWorldModel)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->attachWorldModel, sizeof WeaponFullDef::attachWorldModel, weapon->attachWorldModel,
|
memcpy_s(fullDef->attachWorldModel, sizeof WeaponFullDef::attachWorldModel, weapon->attachWorldModel, sizeof(void*) * _countof(WeaponFullDef::attachWorldModel));
|
||||||
sizeof(void*) * 8);
|
|
||||||
fullDef->weapVariantDef.attachWorldModel = fullDef->attachWorldModel;
|
fullDef->weapVariantDef.attachWorldModel = fullDef->attachWorldModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weapon->attachViewModelTag)
|
if (weapon->attachViewModelTag)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->attachViewModelTag, sizeof WeaponFullDef::attachViewModelTag, weapon->attachViewModelTag,
|
memcpy_s(fullDef->attachViewModelTag, sizeof WeaponFullDef::attachViewModelTag, weapon->attachViewModelTag, sizeof(void*) * _countof(WeaponFullDef::attachViewModelTag));
|
||||||
sizeof(void*) * 8);
|
|
||||||
fullDef->weapVariantDef.attachViewModelTag = fullDef->attachViewModelTag;
|
fullDef->weapVariantDef.attachViewModelTag = fullDef->attachViewModelTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weapon->attachWorldModelTag)
|
if (weapon->attachWorldModelTag)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->attachWorldModelTag, sizeof WeaponFullDef::attachWorldModelTag, weapon->attachWorldModelTag,
|
memcpy_s(fullDef->attachWorldModelTag, sizeof WeaponFullDef::attachWorldModelTag, weapon->attachWorldModelTag, sizeof(void*) * _countof(WeaponFullDef::attachWorldModelTag));
|
||||||
sizeof(void*) * 8);
|
|
||||||
fullDef->weapVariantDef.attachWorldModelTag = fullDef->attachWorldModelTag;
|
fullDef->weapVariantDef.attachWorldModelTag = fullDef->attachWorldModelTag;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullDef->weapDef.parallelBounce)
|
if (fullDef->weapDef.parallelBounce)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->parallelBounce, sizeof WeaponFullDef::parallelBounce, fullDef->weapDef.parallelBounce,
|
memcpy_s(fullDef->parallelBounce, sizeof WeaponFullDef::parallelBounce, fullDef->weapDef.parallelBounce, sizeof(float) * SURF_TYPE_NUM);
|
||||||
sizeof(float) * 32);
|
|
||||||
fullDef->weapDef.parallelBounce = fullDef->parallelBounce;
|
fullDef->weapDef.parallelBounce = fullDef->parallelBounce;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullDef->weapDef.perpendicularBounce)
|
if (fullDef->weapDef.perpendicularBounce)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->perpendicularBounce, sizeof WeaponFullDef::perpendicularBounce,
|
memcpy_s(fullDef->perpendicularBounce, sizeof WeaponFullDef::perpendicularBounce, fullDef->weapDef.perpendicularBounce, sizeof(float) * SURF_TYPE_NUM);
|
||||||
fullDef->weapDef.perpendicularBounce, sizeof(float) * 32);
|
|
||||||
fullDef->weapDef.perpendicularBounce = fullDef->perpendicularBounce;
|
fullDef->weapDef.perpendicularBounce = fullDef->perpendicularBounce;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fullDef->weapDef.locationDamageMultipliers)
|
if (fullDef->weapDef.locationDamageMultipliers)
|
||||||
{
|
{
|
||||||
memcpy_s(fullDef->locationDamageMultipliers, sizeof WeaponFullDef::locationDamageMultipliers,
|
memcpy_s(fullDef->locationDamageMultipliers, sizeof WeaponFullDef::locationDamageMultipliers, fullDef->weapDef.locationDamageMultipliers, sizeof(float) * HITLOC_NUM);
|
||||||
fullDef->weapDef.locationDamageMultipliers, sizeof(float) * 21);
|
|
||||||
fullDef->weapDef.locationDamageMultipliers = fullDef->locationDamageMultipliers;
|
fullDef->weapDef.locationDamageMultipliers = fullDef->locationDamageMultipliers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4172,7 +4172,8 @@ namespace T6
|
|||||||
HITLOC_L_FOOT = 0x12,
|
HITLOC_L_FOOT = 0x12,
|
||||||
HITLOC_GUN = 0x13,
|
HITLOC_GUN = 0x13,
|
||||||
HITLOC_SHIELD = 0x14,
|
HITLOC_SHIELD = 0x14,
|
||||||
HITLOC_NUM = 0x15,
|
|
||||||
|
HITLOC_NUM,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WeaponDef
|
struct WeaponDef
|
||||||
|
Loading…
x
Reference in New Issue
Block a user