fix: attachment loader not properly loading attributes

This commit is contained in:
Jan 2024-04-21 18:44:51 +02:00
parent 191965a970
commit fedd955e68
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C

View File

@ -60,7 +60,7 @@ namespace
CreateXModelArrayFromJson(jAttachment.propertyName, attachment.propertyName, #propertyName, count, attachment);
#define CONVERT_ATTRIBUTE(attributeClass, attributeName) \
if (jAttachment.ammoGeneral) \
if (jAttachment.attributeName) \
{ \
using AttributeType = std::remove_pointer_t<decltype(attachment.attributeName)>; \
attachment.attributeName = static_cast<AttributeType*>(m_memory.Alloc(sizeof(AttributeType))); \
@ -520,8 +520,13 @@ namespace
{
if (jRumbles.fireRumble)
rumbles.fireRumble = m_memory.Dup(jRumbles.fireRumble.value().c_str());
else
rumbles.fireRumble = nullptr;
if (jRumbles.meleeImpactRumble)
rumbles.meleeImpactRumble = m_memory.Dup(jRumbles.meleeImpactRumble.value().c_str());
else
rumbles.meleeImpactRumble = nullptr;
return true;
}