2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-02 06:57:26 +00:00

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

View File

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