mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
[General] Use flags instead of autoCalc for enchantment dynamic records
This brings the handling of dynamic records in multiplayer up-to-date with ad333e88fe
This commit is contained in:
parent
25a632c650
commit
509f03ca52
3 changed files with 8 additions and 8 deletions
|
@ -239,8 +239,6 @@ int RecordsDynamicFunctions::GetRecordAutoCalc(unsigned int index) noexcept
|
||||||
|
|
||||||
if (readRecordsType == mwmp::RECORD_TYPE::POTION)
|
if (readRecordsType == mwmp::RECORD_TYPE::POTION)
|
||||||
return WorldstateFunctions::readWorldstate->potionRecords.at(index).data.mData.mAutoCalc;
|
return WorldstateFunctions::readWorldstate->potionRecords.at(index).data.mData.mAutoCalc;
|
||||||
else if (readRecordsType == mwmp::RECORD_TYPE::ENCHANTMENT)
|
|
||||||
return WorldstateFunctions::readWorldstate->enchantmentRecords.at(index).data.mData.mAutocalc;
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -273,6 +271,8 @@ int RecordsDynamicFunctions::GetRecordFlags(unsigned int index) noexcept
|
||||||
|
|
||||||
if (readRecordsType == mwmp::RECORD_TYPE::SPELL)
|
if (readRecordsType == mwmp::RECORD_TYPE::SPELL)
|
||||||
return WorldstateFunctions::readWorldstate->spellRecords.at(index).data.mData.mFlags;
|
return WorldstateFunctions::readWorldstate->spellRecords.at(index).data.mData.mFlags;
|
||||||
|
else if (readRecordsType == mwmp::RECORD_TYPE::ENCHANTMENT)
|
||||||
|
return WorldstateFunctions::readWorldstate->enchantmentRecords.at(index).data.mData.mFlags;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -737,8 +737,6 @@ void RecordsDynamicFunctions::SetRecordAutoCalc(int autoCalc) noexcept
|
||||||
|
|
||||||
if (writeRecordsType == mwmp::RECORD_TYPE::POTION)
|
if (writeRecordsType == mwmp::RECORD_TYPE::POTION)
|
||||||
tempPotion.data.mData.mAutoCalc = autoCalc;
|
tempPotion.data.mData.mAutoCalc = autoCalc;
|
||||||
else if (writeRecordsType == mwmp::RECORD_TYPE::ENCHANTMENT)
|
|
||||||
tempEnchantment.data.mData.mAutocalc = autoCalc;
|
|
||||||
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
|
else if (writeRecordsType == mwmp::RECORD_TYPE::NPC)
|
||||||
{
|
{
|
||||||
if (autoCalc)
|
if (autoCalc)
|
||||||
|
@ -799,6 +797,8 @@ void RecordsDynamicFunctions::SetRecordFlags(int flags) noexcept
|
||||||
|
|
||||||
if (writeRecordsType == mwmp::RECORD_TYPE::SPELL)
|
if (writeRecordsType == mwmp::RECORD_TYPE::SPELL)
|
||||||
tempSpell.data.mData.mFlags = flags;
|
tempSpell.data.mData.mFlags = flags;
|
||||||
|
else if (writeRecordsType == mwmp::RECORD_TYPE::ENCHANTMENT)
|
||||||
|
tempEnchantment.data.mData.mFlags = flags;
|
||||||
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
|
else if (writeRecordsType == mwmp::RECORD_TYPE::WEAPON)
|
||||||
tempWeapon.data.mData.mFlags = flags;
|
tempWeapon.data.mData.mFlags = flags;
|
||||||
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART)
|
else if (writeRecordsType == mwmp::RECORD_TYPE::BODYPART)
|
||||||
|
|
|
@ -678,8 +678,8 @@ void RecordHelper::overrideRecord(const mwmp::EnchantmentRecord& record)
|
||||||
if (record.baseOverrides.hasCharge)
|
if (record.baseOverrides.hasCharge)
|
||||||
finalData.mData.mCharge = recordData.mData.mCharge;
|
finalData.mData.mCharge = recordData.mData.mCharge;
|
||||||
|
|
||||||
if (record.baseOverrides.hasAutoCalc)
|
if (record.baseOverrides.hasFlags)
|
||||||
finalData.mData.mAutocalc = recordData.mData.mAutocalc;
|
finalData.mData.mFlags = recordData.mData.mFlags;
|
||||||
|
|
||||||
if (record.baseOverrides.hasEffects)
|
if (record.baseOverrides.hasEffects)
|
||||||
finalData.mEffects.mList = recordData.mEffects.mList;
|
finalData.mEffects.mList = recordData.mEffects.mList;
|
||||||
|
|
|
@ -208,7 +208,7 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *newBitstream, bool send)
|
||||||
RW(recordData.mData.mType, send);
|
RW(recordData.mData.mType, send);
|
||||||
RW(recordData.mData.mCost, send);
|
RW(recordData.mData.mCost, send);
|
||||||
RW(recordData.mData.mCharge, send);
|
RW(recordData.mData.mCharge, send);
|
||||||
RW(recordData.mData.mAutocalc, send);
|
RW(recordData.mData.mFlags, send);
|
||||||
ProcessEffects(recordData.mEffects, send);
|
ProcessEffects(recordData.mEffects, send);
|
||||||
|
|
||||||
if (!record.baseId.empty())
|
if (!record.baseId.empty())
|
||||||
|
@ -217,7 +217,7 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *newBitstream, bool send)
|
||||||
RW(overrides.hasSubtype, send);
|
RW(overrides.hasSubtype, send);
|
||||||
RW(overrides.hasCost, send);
|
RW(overrides.hasCost, send);
|
||||||
RW(overrides.hasCharge, send);
|
RW(overrides.hasCharge, send);
|
||||||
RW(overrides.hasAutoCalc, send);
|
RW(overrides.hasFlags, send);
|
||||||
RW(overrides.hasEffects, send);
|
RW(overrides.hasEffects, send);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue