mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 02:15:34 +00:00
Maybe load FO4 ammunition records
This commit is contained in:
parent
dcb791083e
commit
e9f9da98cf
2 changed files with 16 additions and 0 deletions
|
@ -75,6 +75,12 @@ void ESM4::Ammunition::load(ESM4::Reader& reader)
|
|||
if (subHdr.dataSize == 20)
|
||||
reader.get(mData.mWeight);
|
||||
}
|
||||
// FO4
|
||||
else if (subHdr.dataSize == 8)
|
||||
{
|
||||
reader.get(mData.mValue);
|
||||
reader.get(mData.mWeight);
|
||||
}
|
||||
else
|
||||
{
|
||||
reader.skipSubRecordData();
|
||||
|
@ -94,6 +100,13 @@ void ESM4::Ammunition::load(ESM4::Reader& reader)
|
|||
reader.skipSubRecordData();
|
||||
}
|
||||
break;
|
||||
case ESM4::SUB_DNAM:
|
||||
reader.getFormId(mData.mProjectile);
|
||||
reader.get(mData.mFlags);
|
||||
mData.mFlags &= 0xFF;
|
||||
reader.get(mData.mDamage);
|
||||
reader.get(mData.mHealth);
|
||||
break;
|
||||
case ESM4::SUB_ICON:
|
||||
reader.getZString(mIcon);
|
||||
break;
|
||||
|
@ -150,6 +163,8 @@ void ESM4::Ammunition::load(ESM4::Reader& reader)
|
|||
case ESM4::SUB_DSTD:
|
||||
case ESM4::SUB_DSTF: // Destructible end
|
||||
case ESM4::SUB_PTRN: // FO4
|
||||
case ESM4::SUB_NAM1: // FO4 casing model data
|
||||
case ESM4::SUB_NAM2: //
|
||||
reader.skipSubRecordData();
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -53,6 +53,7 @@ namespace ESM4
|
|||
ESM::FormId mProjectile;
|
||||
ESM::FormId mConsumedAmmo;
|
||||
float mConsumedPercentage{ 0.f };
|
||||
std::uint32_t mHealth{ 0u };
|
||||
};
|
||||
|
||||
ESM::FormId mId; // from the header
|
||||
|
|
Loading…
Reference in a new issue