chore: add missing iw5 weapon fields

This commit is contained in:
Jan 2024-04-07 23:40:34 +02:00
parent f63e7c7f35
commit f8c9e62624
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C
4 changed files with 783 additions and 733 deletions

View File

@ -81,6 +81,7 @@ namespace IW5
CSPFT_PHYS_COLLMAP, CSPFT_PHYS_COLLMAP,
CSPFT_SOUND, CSPFT_SOUND,
CSPFT_TRACER, CSPFT_TRACER,
CSPFT_SCRIPT_STRING,
CSPFT_NUM_BASE_FIELD_TYPES, CSPFT_NUM_BASE_FIELD_TYPES,
}; };
@ -98,7 +99,7 @@ namespace IW5
WFT_ANIMTYPE, WFT_ANIMTYPE,
WFT_ACTIVE_RETICLE_TYPE, WFT_ACTIVE_RETICLE_TYPE,
WFT_GUIDED_MISSILE_TYPE, WFT_GUIDED_MISSILE_TYPE,
WFT_BOUNCE_SOUND, WFT_PER_SURFACE_TYPE_SOUND,
WFT_STICKINESS, WFT_STICKINESS,
WFT_OVERLAYINTERFACE, WFT_OVERLAYINTERFACE,
WFT_INVENTORYTYPE, WFT_INVENTORYTYPE,

File diff suppressed because it is too large Load Diff

View File

@ -76,13 +76,13 @@ namespace IW5
FillFromEnumInt(std::string(field.szName), field.iOffset, guidedMissileNames, std::extent_v<decltype(guidedMissileNames)>); FillFromEnumInt(std::string(field.szName), field.iOffset, guidedMissileNames, std::extent_v<decltype(guidedMissileNames)>);
break; break;
case WFT_BOUNCE_SOUND: case WFT_PER_SURFACE_TYPE_SOUND:
{ {
const auto* bounceSound = *reinterpret_cast<SndAliasCustom**>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset); const auto* perSurfaceTypeSound = *reinterpret_cast<SndAliasCustom**>(reinterpret_cast<uintptr_t>(m_structure) + field.iOffset);
if (bounceSound && bounceSound->name) if (perSurfaceTypeSound && perSurfaceTypeSound->name)
{ {
const std::string firstBounceSound(bounceSound->name->soundName); const std::string firstBounceSound(perSurfaceTypeSound->name->soundName);
const auto endOfBouncePrefix = firstBounceSound.rfind("_default"); const auto endOfBouncePrefix = firstBounceSound.rfind("_default");
assert(endOfBouncePrefix != std::string::npos); assert(endOfBouncePrefix != std::string::npos);

View File

@ -117,6 +117,10 @@ void InfoStringFromStructConverter::FillFromBaseField(const cspField_t& field)
break; break;
} }
case CSPFT_SCRIPT_STRING:
FillFromScriptString(std::string(field.szName), field.iOffset);
break;
case CSPFT_NUM_BASE_FIELD_TYPES: case CSPFT_NUM_BASE_FIELD_TYPES:
default: default:
assert(false); assert(false);