feat: automatically load anims of weapons in t6

This commit is contained in:
Jan 2024-02-06 23:56:31 +01:00
parent 0a13281295
commit 2dd4eaf54f
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C
6 changed files with 171 additions and 134 deletions

View File

@ -98,6 +98,9 @@ namespace T6
WFT_ATTACHMENTS, WFT_ATTACHMENTS,
WFT_ATTACHMENT_UNIQUES, WFT_ATTACHMENT_UNIQUES,
// Custom
WFT_ANIM_NAME,
WFT_NUM_FIELD_TYPES WFT_NUM_FIELD_TYPES
}; };

View File

@ -27,93 +27,93 @@ namespace T6
{"handModel", offsetof(WeaponFullDef, weapDef.handXModel), CSPFT_XMODEL }, {"handModel", offsetof(WeaponFullDef, weapDef.handXModel), CSPFT_XMODEL },
{"hideTags", offsetof(WeaponFullDef, hideTags), WFT_HIDETAGS }, {"hideTags", offsetof(WeaponFullDef, hideTags), WFT_HIDETAGS },
{"notetrackSoundMap", offsetof(WeaponFullDef, notetrackSoundMapKeys), WFT_NOTETRACKSOUNDMAP }, {"notetrackSoundMap", offsetof(WeaponFullDef, notetrackSoundMapKeys), WFT_NOTETRACKSOUNDMAP },
{"idleAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_IDLE]), CSPFT_STRING }, {"idleAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_IDLE]), WFT_ANIM_NAME },
{"idleAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_IDLE_LEFT]), CSPFT_STRING }, {"idleAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_IDLE_LEFT]), WFT_ANIM_NAME },
{"emptyIdleAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_EMPTY_IDLE]), CSPFT_STRING }, {"emptyIdleAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_EMPTY_IDLE]), WFT_ANIM_NAME },
{"emptyIdleAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_EMPTY_IDLE_LEFT]), CSPFT_STRING }, {"emptyIdleAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_EMPTY_IDLE_LEFT]), WFT_ANIM_NAME },
{"fireIntroAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FIRE_INTRO]), CSPFT_STRING }, {"fireIntroAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FIRE_INTRO]), WFT_ANIM_NAME },
{"fireAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FIRE]), CSPFT_STRING }, {"fireAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FIRE]), WFT_ANIM_NAME },
{"fireAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FIRE_LEFT]), CSPFT_STRING }, {"fireAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FIRE_LEFT]), WFT_ANIM_NAME },
{"holdFireAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_HOLD_FIRE]), CSPFT_STRING }, {"holdFireAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_HOLD_FIRE]), WFT_ANIM_NAME },
{"lastShotAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_LASTSHOT]), CSPFT_STRING }, {"lastShotAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_LASTSHOT]), WFT_ANIM_NAME },
{"lastShotAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_LASTSHOT_LEFT]), CSPFT_STRING }, {"lastShotAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_LASTSHOT_LEFT]), WFT_ANIM_NAME },
{"flourishAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FINALSHOT]), CSPFT_STRING }, {"flourishAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FINALSHOT]), WFT_ANIM_NAME },
{"flourishAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FINALSHOT_LEFT]), CSPFT_STRING }, {"flourishAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FINALSHOT_LEFT]), WFT_ANIM_NAME },
{"detonateAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DETONATE]), CSPFT_STRING }, {"detonateAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DETONATE]), WFT_ANIM_NAME },
{"rechamberAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RECHAMBER]), CSPFT_STRING }, {"rechamberAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RECHAMBER]), WFT_ANIM_NAME },
{"meleeAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE]), CSPFT_STRING }, {"meleeAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE]), WFT_ANIM_NAME },
{"meleeAnimEmpty", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE_EMPTY]), CSPFT_STRING }, {"meleeAnimEmpty", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE_EMPTY]), WFT_ANIM_NAME },
{"meleeAnim1", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE1]), CSPFT_STRING }, {"meleeAnim1", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE1]), WFT_ANIM_NAME },
{"meleeAnim2", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE2]), CSPFT_STRING }, {"meleeAnim2", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE2]), WFT_ANIM_NAME },
{"meleeAnim3", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE3]), CSPFT_STRING }, {"meleeAnim3", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE3]), WFT_ANIM_NAME },
{"meleeChargeAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE_CHARGE]), CSPFT_STRING }, {"meleeChargeAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE_CHARGE]), WFT_ANIM_NAME },
{"meleeChargeAnimEmpty", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE_CHARGE_EMPTY]), CSPFT_STRING }, {"meleeChargeAnimEmpty", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MELEE_CHARGE_EMPTY]), WFT_ANIM_NAME },
{"reloadAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD]), CSPFT_STRING }, {"reloadAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD]), WFT_ANIM_NAME },
{"reloadAnimRight", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_RIGHT]), CSPFT_STRING }, {"reloadAnimRight", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_RIGHT]), WFT_ANIM_NAME },
{"reloadAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_LEFT]), CSPFT_STRING }, {"reloadAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_LEFT]), WFT_ANIM_NAME },
{"reloadEmptyAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_EMPTY]), CSPFT_STRING }, {"reloadEmptyAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_EMPTY]), WFT_ANIM_NAME },
{"reloadEmptyAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_EMPTY_LEFT]), CSPFT_STRING }, {"reloadEmptyAnimLeft", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_EMPTY_LEFT]), WFT_ANIM_NAME },
{"reloadStartAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_START]), CSPFT_STRING }, {"reloadStartAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_START]), WFT_ANIM_NAME },
{"reloadEndAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_END]), CSPFT_STRING }, {"reloadEndAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_END]), WFT_ANIM_NAME },
{"reloadQuickAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_QUICK]), CSPFT_STRING }, {"reloadQuickAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_QUICK]), WFT_ANIM_NAME },
{"reloadQuickEmptyAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_QUICK_EMPTY]), CSPFT_STRING }, {"reloadQuickEmptyAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RELOAD_QUICK_EMPTY]), WFT_ANIM_NAME },
{"raiseAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RAISE]), CSPFT_STRING }, {"raiseAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_RAISE]), WFT_ANIM_NAME },
{"dropAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DROP]), CSPFT_STRING }, {"dropAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DROP]), WFT_ANIM_NAME },
{"firstRaiseAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FIRST_RAISE]), CSPFT_STRING }, {"firstRaiseAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_FIRST_RAISE]), WFT_ANIM_NAME },
{"altRaiseAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ALT_RAISE]), CSPFT_STRING }, {"altRaiseAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ALT_RAISE]), WFT_ANIM_NAME },
{"altDropAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ALT_DROP]), CSPFT_STRING }, {"altDropAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ALT_DROP]), WFT_ANIM_NAME },
{"quickRaiseAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_QUICK_RAISE]), CSPFT_STRING }, {"quickRaiseAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_QUICK_RAISE]), WFT_ANIM_NAME },
{"quickDropAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_QUICK_DROP]), CSPFT_STRING }, {"quickDropAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_QUICK_DROP]), WFT_ANIM_NAME },
{"emptyRaiseAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_EMPTY_RAISE]), CSPFT_STRING }, {"emptyRaiseAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_EMPTY_RAISE]), WFT_ANIM_NAME },
{"emptyDropAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_EMPTY_DROP]), CSPFT_STRING }, {"emptyDropAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_EMPTY_DROP]), WFT_ANIM_NAME },
{"sprintInAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_IN]), CSPFT_STRING }, {"sprintInAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_IN]), WFT_ANIM_NAME },
{"sprintLoopAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_LOOP]), CSPFT_STRING }, {"sprintLoopAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_LOOP]), WFT_ANIM_NAME },
{"sprintOutAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_OUT]), CSPFT_STRING }, {"sprintOutAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_OUT]), WFT_ANIM_NAME },
{"sprintInEmptyAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_EMPTY_IN]), CSPFT_STRING }, {"sprintInEmptyAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_EMPTY_IN]), WFT_ANIM_NAME },
{"sprintLoopEmptyAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_EMPTY_LOOP]), CSPFT_STRING }, {"sprintLoopEmptyAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_EMPTY_LOOP]), WFT_ANIM_NAME },
{"sprintOutEmptyAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_EMPTY_OUT]), CSPFT_STRING }, {"sprintOutEmptyAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SPRINT_EMPTY_OUT]), WFT_ANIM_NAME },
{"lowReadyInAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_LOWREADY_IN]), CSPFT_STRING }, {"lowReadyInAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_LOWREADY_IN]), WFT_ANIM_NAME },
{"lowReadyLoopAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_LOWREADY_LOOP]), CSPFT_STRING }, {"lowReadyLoopAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_LOWREADY_LOOP]), WFT_ANIM_NAME },
{"lowReadyOutAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_LOWREADY_OUT]), CSPFT_STRING }, {"lowReadyOutAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_LOWREADY_OUT]), WFT_ANIM_NAME },
{"contFireInAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CONT_FIRE_IN]), CSPFT_STRING }, {"contFireInAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CONT_FIRE_IN]), WFT_ANIM_NAME },
{"contFireLoopAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CONT_FIRE_LOOP]), CSPFT_STRING }, {"contFireLoopAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CONT_FIRE_LOOP]), WFT_ANIM_NAME },
{"contFireOutAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CONT_FIRE_OUT]), CSPFT_STRING }, {"contFireOutAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CONT_FIRE_OUT]), WFT_ANIM_NAME },
{"crawlInAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_IN]), CSPFT_STRING }, {"crawlInAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_IN]), WFT_ANIM_NAME },
{"crawlForwardAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_FORWARD]), CSPFT_STRING }, {"crawlForwardAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_FORWARD]), WFT_ANIM_NAME },
{"crawlBackAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_BACK]), CSPFT_STRING }, {"crawlBackAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_BACK]), WFT_ANIM_NAME },
{"crawlRightAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_RIGHT]), CSPFT_STRING }, {"crawlRightAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_RIGHT]), WFT_ANIM_NAME },
{"crawlLeftAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_LEFT]), CSPFT_STRING }, {"crawlLeftAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_LEFT]), WFT_ANIM_NAME },
{"crawlOutAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_OUT]), CSPFT_STRING }, {"crawlOutAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_OUT]), WFT_ANIM_NAME },
{"crawlEmptyInAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_IN]), CSPFT_STRING }, {"crawlEmptyInAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_IN]), WFT_ANIM_NAME },
{"crawlEmptyForwardAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_FORWARD]), CSPFT_STRING }, {"crawlEmptyForwardAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_FORWARD]), WFT_ANIM_NAME },
{"crawlEmptyBackAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_BACK]), CSPFT_STRING }, {"crawlEmptyBackAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_BACK]), WFT_ANIM_NAME },
{"crawlEmptyRightAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_RIGHT]), CSPFT_STRING }, {"crawlEmptyRightAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_RIGHT]), WFT_ANIM_NAME },
{"crawlEmptyLeftAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_LEFT]), CSPFT_STRING }, {"crawlEmptyLeftAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_LEFT]), WFT_ANIM_NAME },
{"crawlEmptyOutAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_OUT]), CSPFT_STRING }, {"crawlEmptyOutAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CRAWL_EMPTY_OUT]), WFT_ANIM_NAME },
{"deployAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DEPLOY]), CSPFT_STRING }, {"deployAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DEPLOY]), WFT_ANIM_NAME },
{"nightVisionWearAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_NIGHTVISION_WEAR]), CSPFT_STRING }, {"nightVisionWearAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_NIGHTVISION_WEAR]), WFT_ANIM_NAME },
{"nightVisionRemoveAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_NIGHTVISION_REMOVE]), CSPFT_STRING }, {"nightVisionRemoveAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_NIGHTVISION_REMOVE]), WFT_ANIM_NAME },
{"adsFireAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_FIRE]), CSPFT_STRING }, {"adsFireAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_FIRE]), WFT_ANIM_NAME },
{"adsLastShotAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_LASTSHOT]), CSPFT_STRING }, {"adsLastShotAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_LASTSHOT]), WFT_ANIM_NAME },
{"adsRechamberAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_RECHAMBER]), CSPFT_STRING }, {"adsRechamberAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_RECHAMBER]), WFT_ANIM_NAME },
{"adsUpAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_UP]), CSPFT_STRING }, {"adsUpAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_UP]), WFT_ANIM_NAME },
{"adsDownAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_DOWN]), CSPFT_STRING }, {"adsDownAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_DOWN]), WFT_ANIM_NAME },
{"adsUpOtherScopeAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_UP_OTHER_SCOPE]), CSPFT_STRING }, {"adsUpOtherScopeAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_UP_OTHER_SCOPE]), WFT_ANIM_NAME },
{"adsFireIntroAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_FIRE_INTRO]), CSPFT_STRING }, {"adsFireIntroAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_ADS_FIRE_INTRO]), WFT_ANIM_NAME },
{"breakdownAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_BREAKDOWN]), CSPFT_STRING }, {"breakdownAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_BREAKDOWN]), WFT_ANIM_NAME },
{"dtp_in", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_IN]), CSPFT_STRING }, {"dtp_in", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_IN]), WFT_ANIM_NAME },
{"dtp_loop", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_LOOP]), CSPFT_STRING }, {"dtp_loop", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_LOOP]), WFT_ANIM_NAME },
{"dtp_out", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_OUT]), CSPFT_STRING }, {"dtp_out", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_OUT]), WFT_ANIM_NAME },
{"dtp_empty_in", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_EMPTY_IN]), CSPFT_STRING }, {"dtp_empty_in", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_EMPTY_IN]), WFT_ANIM_NAME },
{"dtp_empty_loop", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_EMPTY_LOOP]), CSPFT_STRING }, {"dtp_empty_loop", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_EMPTY_LOOP]), WFT_ANIM_NAME },
{"dtp_empty_out", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_EMPTY_OUT]), CSPFT_STRING }, {"dtp_empty_out", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_DTP_EMPTY_OUT]), WFT_ANIM_NAME },
{"slide_in", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SLIDE_IN]), CSPFT_STRING }, {"slide_in", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_SLIDE_IN]), WFT_ANIM_NAME },
{"mantleAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MANTLE]), CSPFT_STRING }, {"mantleAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_MANTLE]), WFT_ANIM_NAME },
{"sprintCameraAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CAMERA_SPRINT_LOOP]), CSPFT_STRING }, {"sprintCameraAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CAMERA_SPRINT_LOOP]), WFT_ANIM_NAME },
{"dtpInCameraAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CAMERA_DTP_IN]), CSPFT_STRING }, {"dtpInCameraAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CAMERA_DTP_IN]), WFT_ANIM_NAME },
{"dtpLoopCameraAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CAMERA_DTP_LOOP]), CSPFT_STRING }, {"dtpLoopCameraAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CAMERA_DTP_LOOP]), WFT_ANIM_NAME },
{"dtpOutCameraAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CAMERA_DTP_OUT]), CSPFT_STRING }, {"dtpOutCameraAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CAMERA_DTP_OUT]), WFT_ANIM_NAME },
{"mantleCameraAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CAMERA_MANTLE]), CSPFT_STRING }, {"mantleCameraAnim", offsetof(WeaponFullDef, szXAnims[WEAP_ANIM_CAMERA_MANTLE]), WFT_ANIM_NAME },
{"script", offsetof(WeaponFullDef, weapDef.szScript), CSPFT_STRING }, {"script", offsetof(WeaponFullDef, weapDef.szScript), CSPFT_STRING },
{"weaponType", offsetof(WeaponFullDef, weapDef.weapType), WFT_WEAPONTYPE }, {"weaponType", offsetof(WeaponFullDef, weapDef.weapType), WFT_WEAPONTYPE },
{"weaponClass", offsetof(WeaponFullDef, weapDef.weapClass), WFT_WEAPONCLASS }, {"weaponClass", offsetof(WeaponFullDef, weapDef.weapClass), WFT_WEAPONCLASS },

View File

@ -227,7 +227,7 @@ namespace T6
{ {
std::cout << "Cannot have more than " std::cout << "Cannot have more than "
<< (std::extent_v<decltype(WeaponFullDef::attachmentUniques)> - std::extent_v<decltype(WeaponFullDef::attachments)>) << (std::extent_v<decltype(WeaponFullDef::attachmentUniques)> - std::extent_v<decltype(WeaponFullDef::attachments)>)
<< " combined attachment attachment unique entries!" << std::endl; << " combined attachment attachment unique entries!\n";
return false; return false;
} }
@ -239,15 +239,14 @@ namespace T6
if (static_cast<unsigned>(attachmentUniqueAsset->attachmentType) >= ATTACHMENT_TYPE_COUNT) if (static_cast<unsigned>(attachmentUniqueAsset->attachmentType) >= ATTACHMENT_TYPE_COUNT)
{ {
std::cout << "Invalid attachment type " << attachmentUniqueAsset->attachmentType << " for attachment unique asset \"" std::cout << "Invalid attachment type " << attachmentUniqueAsset->attachmentType << " for attachment unique asset \""
<< attachmentUniqueName << "\"" << std::endl; << attachmentUniqueName << "\"\n";
return false; return false;
} }
if (attachmentUniques[attachmentUniqueAsset->attachmentType] != nullptr) if (attachmentUniques[attachmentUniqueAsset->attachmentType] != nullptr)
{ {
std::cout << "Already loaded attachment unique with same type " << attachmentUniqueAsset->attachmentType << ": \"" std::cout << "Already loaded attachment unique with same type " << attachmentUniqueAsset->attachmentType << ": \""
<< attachmentUniques[attachmentUniqueAsset->attachmentType]->szInternalName << "\", \"" << attachmentUniqueName << "\"" << attachmentUniques[attachmentUniqueAsset->attachmentType]->szInternalName << "\", \"" << attachmentUniqueName << "\"\n";
<< std::endl;
return false; return false;
} }
@ -259,6 +258,18 @@ namespace T6
return true; return true;
} }
bool ConvertAnimName(const cspField_t& field, const std::string& value)
{
if (ConvertString(value, field.iOffset))
{
if (!value.empty())
m_indirect_asset_references.emplace(m_loading_manager->LoadIndirectAssetReference(ASSET_TYPE_XANIMPARTS, value));
return true;
}
return false;
}
protected: protected:
bool ConvertExtensionField(const cspField_t& field, const std::string& value) override bool ConvertExtensionField(const cspField_t& field, const std::string& value) override
{ {
@ -352,7 +363,9 @@ namespace T6
case WFT_ATTACHMENT_UNIQUES: case WFT_ATTACHMENT_UNIQUES:
return ConvertAttachmentUniques(field, value); return ConvertAttachmentUniques(field, value);
case WFT_NUM_FIELD_TYPES: case WFT_ANIM_NAME:
return ConvertAnimName(field, value);
default: default:
assert(false); assert(false);
return false; return false;
@ -553,7 +566,12 @@ bool AssetLoaderWeapon::LoadFromInfoString(
CalculateWeaponFields(weaponFullDef); CalculateWeaponFields(weaponFullDef);
CalculateAttachmentFields(weaponFullDef); CalculateAttachmentFields(weaponFullDef);
manager->AddAsset(ASSET_TYPE_WEAPON, assetName, &weaponFullDef->weapVariantDef, converter.GetDependencies(), converter.GetUsedScriptStrings()); manager->AddAsset(ASSET_TYPE_WEAPON,
assetName,
&weaponFullDef->weapVariantDef,
converter.GetDependencies(),
converter.GetUsedScriptStrings(),
converter.GetIndirectAssetReferences());
return true; return true;
} }

View File

@ -41,7 +41,7 @@ bool InfoStringToStructConverterBase::ParseAsArray(const std::string& value, std
return true; return true;
} }
bool InfoStringToStructConverterBase::ParseAsPairs(const std::string& value, std::vector<std::pair<std::string, std::string>>& valueArray) const bool InfoStringToStructConverterBase::ParseAsPairs(const std::string& value, std::vector<std::pair<std::string, std::string>>& valueArray)
{ {
std::string key; std::string key;
auto isKey = true; auto isKey = true;
@ -227,6 +227,7 @@ bool InfoStringToStructConverterBase::ConvertEnumInt(const std::string& value, c
std::vector<scr_string_t> InfoStringToStructConverterBase::GetUsedScriptStrings() const std::vector<scr_string_t> InfoStringToStructConverterBase::GetUsedScriptStrings() const
{ {
std::vector<scr_string_t> scrStringList; std::vector<scr_string_t> scrStringList;
scrStringList.reserve(m_used_script_string_list.size());
for (auto scrStr : m_used_script_string_list) for (auto scrStr : m_used_script_string_list)
{ {
scrStringList.push_back(scrStr); scrStringList.push_back(scrStr);
@ -238,6 +239,7 @@ std::vector<scr_string_t> InfoStringToStructConverterBase::GetUsedScriptStrings(
std::vector<XAssetInfoGeneric*> InfoStringToStructConverterBase::GetDependencies() const std::vector<XAssetInfoGeneric*> InfoStringToStructConverterBase::GetDependencies() const
{ {
std::vector<XAssetInfoGeneric*> dependencyList; std::vector<XAssetInfoGeneric*> dependencyList;
dependencyList.reserve(m_dependencies.size());
for (auto* dependency : m_dependencies) for (auto* dependency : m_dependencies)
{ {
dependencyList.push_back(dependency); dependencyList.push_back(dependency);
@ -245,3 +247,15 @@ std::vector<XAssetInfoGeneric*> InfoStringToStructConverterBase::GetDependencies
return dependencyList; return dependencyList;
} }
std::vector<IndirectAssetReference> InfoStringToStructConverterBase::GetIndirectAssetReferences() const
{
std::vector<IndirectAssetReference> indirectAssetReferences;
indirectAssetReferences.reserve(m_indirect_asset_references.size());
for (auto& assetReference : m_indirect_asset_references)
{
indirectAssetReferences.emplace_back(assetReference);
}
return indirectAssetReferences;
}

View File

@ -17,11 +17,12 @@ protected:
ZoneScriptStrings& m_zone_script_strings; ZoneScriptStrings& m_zone_script_strings;
std::unordered_set<scr_string_t> m_used_script_string_list; std::unordered_set<scr_string_t> m_used_script_string_list;
std::unordered_set<XAssetInfoGeneric*> m_dependencies; std::unordered_set<XAssetInfoGeneric*> m_dependencies;
std::unordered_set<IndirectAssetReference> m_indirect_asset_references;
MemoryManager* m_memory; MemoryManager* m_memory;
void* m_structure; void* m_structure;
static bool ParseAsArray(const std::string& value, std::vector<std::string>& valueArray); static bool ParseAsArray(const std::string& value, std::vector<std::string>& valueArray);
bool ParseAsPairs(const std::string& value, std::vector<std::pair<std::string, std::string>>& valueArray) const; static bool ParseAsPairs(const std::string& value, std::vector<std::pair<std::string, std::string>>& valueArray);
bool ConvertString(const std::string& value, size_t offset); bool ConvertString(const std::string& value, size_t offset);
bool ConvertStringBuffer(const std::string& value, size_t offset, size_t bufferSize); bool ConvertStringBuffer(const std::string& value, size_t offset, size_t bufferSize);
@ -45,4 +46,5 @@ public:
virtual bool Convert() = 0; virtual bool Convert() = 0;
_NODISCARD std::vector<scr_string_t> GetUsedScriptStrings() const; _NODISCARD std::vector<scr_string_t> GetUsedScriptStrings() const;
_NODISCARD std::vector<XAssetInfoGeneric*> GetDependencies() const; _NODISCARD std::vector<XAssetInfoGeneric*> GetDependencies() const;
_NODISCARD std::vector<IndirectAssetReference> GetIndirectAssetReferences() const;
}; };

View File

@ -22,50 +22,50 @@ namespace T6
switch (static_cast<weapFieldType_t>(field.iFieldType)) switch (static_cast<weapFieldType_t>(field.iFieldType))
{ {
case WFT_WEAPONTYPE: case WFT_WEAPONTYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapTypeNames, std::extent<decltype(szWeapTypeNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapTypeNames, std::extent_v<decltype(szWeapTypeNames)>);
break; break;
case WFT_WEAPONCLASS: case WFT_WEAPONCLASS:
FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapClassNames, std::extent<decltype(szWeapClassNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapClassNames, std::extent_v<decltype(szWeapClassNames)>);
break; break;
case WFT_OVERLAYRETICLE: case WFT_OVERLAYRETICLE:
FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapOverlayReticleNames, std::extent<decltype(szWeapOverlayReticleNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapOverlayReticleNames, std::extent_v<decltype(szWeapOverlayReticleNames)>);
break; break;
case WFT_PENETRATE_TYPE: case WFT_PENETRATE_TYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, penetrateTypeNames, std::extent<decltype(penetrateTypeNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, penetrateTypeNames, std::extent_v<decltype(penetrateTypeNames)>);
break; break;
case WFT_IMPACT_TYPE: case WFT_IMPACT_TYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, impactTypeNames, std::extent<decltype(impactTypeNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, impactTypeNames, std::extent_v<decltype(impactTypeNames)>);
break; break;
case WFT_STANCE: case WFT_STANCE:
FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapStanceNames, std::extent<decltype(szWeapStanceNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapStanceNames, std::extent_v<decltype(szWeapStanceNames)>);
break; break;
case WFT_PROJ_EXPLOSION: case WFT_PROJ_EXPLOSION:
FillFromEnumInt(std::string(field.szName), field.iOffset, szProjectileExplosionNames, std::extent<decltype(szProjectileExplosionNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, szProjectileExplosionNames, std::extent_v<decltype(szProjectileExplosionNames)>);
break; break;
case WFT_OFFHAND_CLASS: case WFT_OFFHAND_CLASS:
FillFromEnumInt(std::string(field.szName), field.iOffset, offhandClassNames, std::extent<decltype(offhandClassNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, offhandClassNames, std::extent_v<decltype(offhandClassNames)>);
break; break;
case WFT_OFFHAND_SLOT: case WFT_OFFHAND_SLOT:
FillFromEnumInt(std::string(field.szName), field.iOffset, offhandSlotNames, std::extent<decltype(offhandSlotNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, offhandSlotNames, std::extent_v<decltype(offhandSlotNames)>);
break; break;
case WFT_ANIMTYPE: case WFT_ANIMTYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, playerAnimTypeNames, std::extent<decltype(playerAnimTypeNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, playerAnimTypeNames, std::extent_v<decltype(playerAnimTypeNames)>);
break; break;
case WFT_ACTIVE_RETICLE_TYPE: case WFT_ACTIVE_RETICLE_TYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, activeReticleNames, std::extent<decltype(activeReticleNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, activeReticleNames, std::extent_v<decltype(activeReticleNames)>);
break; break;
case WFT_GUIDED_MISSILE_TYPE: case WFT_GUIDED_MISSILE_TYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, guidedMissileNames, std::extent<decltype(guidedMissileNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, guidedMissileNames, std::extent_v<decltype(guidedMissileNames)>);
break; break;
case WFT_BOUNCE_SOUND: case WFT_BOUNCE_SOUND:
@ -92,31 +92,31 @@ namespace T6
} }
case WFT_STICKINESS: case WFT_STICKINESS:
FillFromEnumInt(std::string(field.szName), field.iOffset, stickinessNames, std::extent<decltype(stickinessNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, stickinessNames, std::extent_v<decltype(stickinessNames)>);
break; break;
case WFT_ROTATETYPE: case WFT_ROTATETYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, rotateTypeNames, std::extent<decltype(rotateTypeNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, rotateTypeNames, std::extent_v<decltype(rotateTypeNames)>);
break; break;
case WFT_OVERLAYINTERFACE: case WFT_OVERLAYINTERFACE:
FillFromEnumInt(std::string(field.szName), field.iOffset, overlayInterfaceNames, std::extent<decltype(overlayInterfaceNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, overlayInterfaceNames, std::extent_v<decltype(overlayInterfaceNames)>);
break; break;
case WFT_INVENTORYTYPE: case WFT_INVENTORYTYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapInventoryTypeNames, std::extent<decltype(szWeapInventoryTypeNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapInventoryTypeNames, std::extent_v<decltype(szWeapInventoryTypeNames)>);
break; break;
case WFT_FIRETYPE: case WFT_FIRETYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapFireTypeNames, std::extent<decltype(szWeapFireTypeNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapFireTypeNames, std::extent_v<decltype(szWeapFireTypeNames)>);
break; break;
case WFT_CLIPTYPE: case WFT_CLIPTYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapClipTypeNames, std::extent<decltype(szWeapClipTypeNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, szWeapClipTypeNames, std::extent_v<decltype(szWeapClipTypeNames)>);
break; break;
case WFT_AMMOCOUNTER_CLIPTYPE: case WFT_AMMOCOUNTER_CLIPTYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, ammoCounterClipNames, std::extent<decltype(ammoCounterClipNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, ammoCounterClipNames, std::extent_v<decltype(ammoCounterClipNames)>);
break; break;
case WFT_ICONRATIO_HUD: case WFT_ICONRATIO_HUD:
@ -124,11 +124,11 @@ namespace T6
case WFT_ICONRATIO_KILL: case WFT_ICONRATIO_KILL:
case WFT_ICONRATIO_DPAD: case WFT_ICONRATIO_DPAD:
case WFT_ICONRATIO_INDICATOR: case WFT_ICONRATIO_INDICATOR:
FillFromEnumInt(std::string(field.szName), field.iOffset, weapIconRatioNames, std::extent<decltype(weapIconRatioNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, weapIconRatioNames, std::extent_v<decltype(weapIconRatioNames)>);
break; break;
case WFT_BARRELTYPE: case WFT_BARRELTYPE:
FillFromEnumInt(std::string(field.szName), field.iOffset, barrelTypeNames, std::extent<decltype(barrelTypeNames)>::value); FillFromEnumInt(std::string(field.szName), field.iOffset, barrelTypeNames, std::extent_v<decltype(barrelTypeNames)>);
break; break;
case WFT_HIDETAGS: case WFT_HIDETAGS:
@ -137,7 +137,7 @@ namespace T6
std::stringstream ss; std::stringstream ss;
bool first = true; bool first = true;
for (auto i = 0u; i < std::extent<decltype(WeaponFullDef::hideTags)>::value; i++) for (auto i = 0u; i < std::extent_v<decltype(WeaponFullDef::hideTags)>; i++)
{ {
const auto& str = m_get_scr_string(hideTags[i]); const auto& str = m_get_scr_string(hideTags[i]);
if (!str.empty()) if (!str.empty())
@ -162,11 +162,11 @@ namespace T6
case WFT_NOTETRACKSOUNDMAP: case WFT_NOTETRACKSOUNDMAP:
{ {
const auto* keys = reinterpret_cast<scr_string_t*>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset); const auto* keys = reinterpret_cast<scr_string_t*>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset);
const auto* values = &keys[std::extent<decltype(WeaponFullDef::notetrackSoundMapKeys)>::value]; const auto* values = &keys[std::extent_v<decltype(WeaponFullDef::notetrackSoundMapKeys)>];
std::stringstream ss; std::stringstream ss;
bool first = true; bool first = true;
for (auto i = 0u; i < std::extent<decltype(WeaponFullDef::notetrackSoundMapKeys)>::value; i++) for (auto i = 0u; i < std::extent_v<decltype(WeaponFullDef::notetrackSoundMapKeys)>; i++)
{ {
const auto& key = m_get_scr_string(keys[i]); const auto& key = m_get_scr_string(keys[i]);
const auto& value = m_get_scr_string(values[i]); const auto& value = m_get_scr_string(values[i]);
@ -205,7 +205,7 @@ namespace T6
std::stringstream ss; std::stringstream ss;
auto first = true; auto first = true;
for (auto i = 0u; i < std::extent<decltype(WeaponFullDef::attachments)>::value; i++) for (auto i = 0u; i < std::extent_v<decltype(WeaponFullDef::attachments)>; i++)
{ {
if (attachments[i]) if (attachments[i])
{ {
@ -227,7 +227,7 @@ namespace T6
std::stringstream ss; std::stringstream ss;
auto first = true; auto first = true;
for (auto i = 0u; i < std::extent<decltype(WeaponFullDef::attachmentUniques)>::value; i++) for (auto i = 0u; i < std::extent_v<decltype(WeaponFullDef::attachmentUniques)>; i++)
{ {
if (attachmentUniques[i]) if (attachmentUniques[i])
{ {
@ -274,21 +274,21 @@ void AssetDumperWeapon::CopyToFullDef(const WeaponVariantDef* weapon, WeaponFull
if (weapon->attachments) if (weapon->attachments)
{ {
assert(sizeof(WeaponFullDef::attachments) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachments)>::value); assert(sizeof(WeaponFullDef::attachments) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachments)>::value);
memcpy(fullDef->attachments, weapon->attachments, sizeof(void*) * std::extent<decltype(WeaponFullDef::attachments)>::value); memcpy(fullDef->attachments, weapon->attachments, sizeof(void*) * std::extent_v<decltype(WeaponFullDef::attachments)>);
fullDef->weapVariantDef.attachments = fullDef->attachments; fullDef->weapVariantDef.attachments = fullDef->attachments;
} }
if (weapon->attachmentUniques) if (weapon->attachmentUniques)
{ {
assert(sizeof(WeaponFullDef::attachmentUniques) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachmentUniques)>::value); assert(sizeof(WeaponFullDef::attachmentUniques) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachmentUniques)>::value);
memcpy(fullDef->attachmentUniques, weapon->attachmentUniques, sizeof(void*) * std::extent<decltype(WeaponFullDef::attachmentUniques)>::value); memcpy(fullDef->attachmentUniques, weapon->attachmentUniques, sizeof(void*) * std::extent_v<decltype(WeaponFullDef::attachmentUniques)>);
fullDef->weapVariantDef.attachmentUniques = fullDef->attachmentUniques; fullDef->weapVariantDef.attachmentUniques = fullDef->attachmentUniques;
} }
if (fullDef->weapDef.gunXModel) if (fullDef->weapDef.gunXModel)
{ {
assert(sizeof(WeaponFullDef::gunXModel) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::gunXModel)>::value); assert(sizeof(WeaponFullDef::gunXModel) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::gunXModel)>::value);
memcpy(fullDef->gunXModel, fullDef->weapDef.gunXModel, sizeof(void*) * std::extent<decltype(WeaponFullDef::gunXModel)>::value); memcpy(fullDef->gunXModel, fullDef->weapDef.gunXModel, sizeof(void*) * std::extent_v<decltype(WeaponFullDef::gunXModel)>);
fullDef->weapDef.gunXModel = fullDef->gunXModel; fullDef->weapDef.gunXModel = fullDef->gunXModel;
} }
@ -302,7 +302,7 @@ void AssetDumperWeapon::CopyToFullDef(const WeaponVariantDef* weapon, WeaponFull
if (weapon->hideTags) if (weapon->hideTags)
{ {
assert(sizeof(WeaponFullDef::hideTags) >= sizeof(scr_string_t) * std::extent<decltype(WeaponFullDef::hideTags)>::value); assert(sizeof(WeaponFullDef::hideTags) >= sizeof(scr_string_t) * std::extent<decltype(WeaponFullDef::hideTags)>::value);
memcpy(fullDef->hideTags, weapon->hideTags, sizeof(scr_string_t) * std::extent<decltype(WeaponFullDef::hideTags)>::value); memcpy(fullDef->hideTags, weapon->hideTags, sizeof(scr_string_t) * std::extent_v<decltype(WeaponFullDef::hideTags)>);
fullDef->weapVariantDef.hideTags = fullDef->hideTags; fullDef->weapVariantDef.hideTags = fullDef->hideTags;
} }
@ -311,7 +311,7 @@ void AssetDumperWeapon::CopyToFullDef(const WeaponVariantDef* weapon, WeaponFull
assert(sizeof(WeaponFullDef::notetrackSoundMapKeys) >= sizeof(scr_string_t) * std::extent<decltype(WeaponFullDef::notetrackSoundMapKeys)>::value); assert(sizeof(WeaponFullDef::notetrackSoundMapKeys) >= sizeof(scr_string_t) * std::extent<decltype(WeaponFullDef::notetrackSoundMapKeys)>::value);
memcpy(fullDef->notetrackSoundMapKeys, memcpy(fullDef->notetrackSoundMapKeys,
fullDef->weapDef.notetrackSoundMapKeys, fullDef->weapDef.notetrackSoundMapKeys,
sizeof(scr_string_t) * std::extent<decltype(WeaponFullDef::notetrackSoundMapKeys)>::value); sizeof(scr_string_t) * std::extent_v<decltype(WeaponFullDef::notetrackSoundMapKeys)>);
fullDef->weapDef.notetrackSoundMapKeys = fullDef->notetrackSoundMapKeys; fullDef->weapDef.notetrackSoundMapKeys = fullDef->notetrackSoundMapKeys;
} }
@ -320,42 +320,42 @@ void AssetDumperWeapon::CopyToFullDef(const WeaponVariantDef* weapon, WeaponFull
assert(sizeof(WeaponFullDef::notetrackSoundMapValues) >= sizeof(scr_string_t) * std::extent<decltype(WeaponFullDef::notetrackSoundMapValues)>::value); assert(sizeof(WeaponFullDef::notetrackSoundMapValues) >= sizeof(scr_string_t) * std::extent<decltype(WeaponFullDef::notetrackSoundMapValues)>::value);
memcpy(fullDef->notetrackSoundMapValues, memcpy(fullDef->notetrackSoundMapValues,
fullDef->weapDef.notetrackSoundMapValues, fullDef->weapDef.notetrackSoundMapValues,
sizeof(scr_string_t) * std::extent<decltype(WeaponFullDef::notetrackSoundMapValues)>::value); sizeof(scr_string_t) * std::extent_v<decltype(WeaponFullDef::notetrackSoundMapValues)>);
fullDef->weapDef.notetrackSoundMapValues = fullDef->notetrackSoundMapValues; fullDef->weapDef.notetrackSoundMapValues = fullDef->notetrackSoundMapValues;
} }
if (fullDef->weapDef.worldModel) if (fullDef->weapDef.worldModel)
{ {
assert(sizeof(WeaponFullDef::worldModel) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::worldModel)>::value); assert(sizeof(WeaponFullDef::worldModel) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::worldModel)>::value);
memcpy(fullDef->worldModel, fullDef->weapDef.worldModel, sizeof(void*) * std::extent<decltype(WeaponFullDef::worldModel)>::value); memcpy(fullDef->worldModel, fullDef->weapDef.worldModel, sizeof(void*) * std::extent_v<decltype(WeaponFullDef::worldModel)>);
fullDef->weapDef.worldModel = fullDef->worldModel; fullDef->weapDef.worldModel = fullDef->worldModel;
} }
if (weapon->attachViewModel) if (weapon->attachViewModel)
{ {
assert(sizeof(WeaponFullDef::attachViewModel) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachViewModel)>::value); assert(sizeof(WeaponFullDef::attachViewModel) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachViewModel)>::value);
memcpy(fullDef->attachViewModel, weapon->attachViewModel, sizeof(void*) * std::extent<decltype(WeaponFullDef::attachViewModel)>::value); memcpy(fullDef->attachViewModel, weapon->attachViewModel, sizeof(void*) * std::extent_v<decltype(WeaponFullDef::attachViewModel)>);
fullDef->weapVariantDef.attachViewModel = fullDef->attachViewModel; fullDef->weapVariantDef.attachViewModel = fullDef->attachViewModel;
} }
if (weapon->attachWorldModel) if (weapon->attachWorldModel)
{ {
assert(sizeof(WeaponFullDef::attachWorldModel) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachWorldModel)>::value); assert(sizeof(WeaponFullDef::attachWorldModel) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachWorldModel)>::value);
memcpy(fullDef->attachWorldModel, weapon->attachWorldModel, sizeof(void*) * std::extent<decltype(WeaponFullDef::attachWorldModel)>::value); memcpy(fullDef->attachWorldModel, weapon->attachWorldModel, sizeof(void*) * std::extent_v<decltype(WeaponFullDef::attachWorldModel)>);
fullDef->weapVariantDef.attachWorldModel = fullDef->attachWorldModel; fullDef->weapVariantDef.attachWorldModel = fullDef->attachWorldModel;
} }
if (weapon->attachViewModelTag) if (weapon->attachViewModelTag)
{ {
assert(sizeof(WeaponFullDef::attachViewModelTag) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachViewModelTag)>::value); assert(sizeof(WeaponFullDef::attachViewModelTag) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachViewModelTag)>::value);
memcpy(fullDef->attachViewModelTag, weapon->attachViewModelTag, sizeof(void*) * std::extent<decltype(WeaponFullDef::attachViewModelTag)>::value); memcpy(fullDef->attachViewModelTag, weapon->attachViewModelTag, sizeof(void*) * std::extent_v<decltype(WeaponFullDef::attachViewModelTag)>);
fullDef->weapVariantDef.attachViewModelTag = fullDef->attachViewModelTag; fullDef->weapVariantDef.attachViewModelTag = fullDef->attachViewModelTag;
} }
if (weapon->attachWorldModelTag) if (weapon->attachWorldModelTag)
{ {
assert(sizeof(WeaponFullDef::attachWorldModelTag) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachWorldModelTag)>::value); assert(sizeof(WeaponFullDef::attachWorldModelTag) >= sizeof(void*) * std::extent<decltype(WeaponFullDef::attachWorldModelTag)>::value);
memcpy(fullDef->attachWorldModelTag, weapon->attachWorldModelTag, sizeof(void*) * std::extent<decltype(WeaponFullDef::attachWorldModelTag)>::value); memcpy(fullDef->attachWorldModelTag, weapon->attachWorldModelTag, sizeof(void*) * std::extent_v<decltype(WeaponFullDef::attachWorldModelTag)>);
fullDef->weapVariantDef.attachWorldModelTag = fullDef->attachWorldModelTag; fullDef->weapVariantDef.attachWorldModelTag = fullDef->attachWorldModelTag;
} }
@ -382,7 +382,7 @@ void AssetDumperWeapon::CopyToFullDef(const WeaponVariantDef* weapon, WeaponFull
if (fullDef->weapDef.weaponCamo && fullDef->weapDef.weaponCamo->name) if (fullDef->weapDef.weaponCamo && fullDef->weapDef.weaponCamo->name)
{ {
strncpy(fullDef->weaponCamo, fullDef->weapDef.weaponCamo->name, std::extent<decltype(WeaponFullDef::weaponCamo)>::value); strncpy(fullDef->weaponCamo, fullDef->weapDef.weaponCamo->name, std::extent_v<decltype(WeaponFullDef::weaponCamo)>);
} }
} }
@ -394,7 +394,7 @@ InfoString AssetDumperWeapon::CreateInfoString(XAssetInfo<WeaponVariantDef>* ass
InfoStringFromWeaponConverter converter(fullDef.get(), InfoStringFromWeaponConverter converter(fullDef.get(),
weapon_fields, weapon_fields,
std::extent<decltype(weapon_fields)>::value, std::extent_v<decltype(weapon_fields)>,
[asset](const scr_string_t scrStr) -> std::string [asset](const scr_string_t scrStr) -> std::string
{ {
assert(scrStr < asset->m_zone->m_script_strings.Count()); assert(scrStr < asset->m_zone->m_script_strings.Count());