mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-07-08 03:21:35 +00:00
[General] Add scale and bloodType to creature records in RecordDynamic
This commit is contained in:
parent
afb9bd7eb5
commit
8f7a267129
5 changed files with 64 additions and 0 deletions
|
@ -1215,6 +1215,36 @@ void RecordsDynamicFunctions::SetRecordFaction(const char* faction) noexcept
|
|||
tempOverrides.hasFaction = true;
|
||||
}
|
||||
|
||||
void RecordsDynamicFunctions::SetRecordScale(double scale) noexcept
|
||||
{
|
||||
unsigned short writeRecordsType = WorldstateFunctions::writeWorldstate.recordsType;
|
||||
|
||||
if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
|
||||
tempCreature.data.mScale = scale;
|
||||
else
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set level for record type %i which lacks that property", writeRecordsType);
|
||||
return;
|
||||
}
|
||||
|
||||
tempOverrides.hasScale = true;
|
||||
}
|
||||
|
||||
void RecordsDynamicFunctions::SetRecordBloodType(int bloodType) noexcept
|
||||
{
|
||||
unsigned short writeRecordsType = WorldstateFunctions::writeWorldstate.recordsType;
|
||||
|
||||
if (writeRecordsType == mwmp::RECORD_TYPE::CREATURE)
|
||||
tempCreature.data.mBloodType = bloodType;
|
||||
else
|
||||
{
|
||||
LOG_MESSAGE_SIMPLE(TimedLog::LOG_ERROR, "Tried to set blood type for record type %i which lacks that property", writeRecordsType);
|
||||
return;
|
||||
}
|
||||
|
||||
tempOverrides.hasBloodType = true;
|
||||
}
|
||||
|
||||
void RecordsDynamicFunctions::SetRecordLevel(int level) noexcept
|
||||
{
|
||||
unsigned short writeRecordsType = WorldstateFunctions::writeWorldstate.recordsType;
|
||||
|
|
|
@ -84,6 +84,9 @@
|
|||
{"SetRecordClass", RecordsDynamicFunctions::SetRecordClass},\
|
||||
{"SetRecordFaction", RecordsDynamicFunctions::SetRecordFaction},\
|
||||
\
|
||||
{"SetRecordScale", RecordsDynamicFunctions::SetRecordScale},\
|
||||
{"SetRecordBloodType", RecordsDynamicFunctions::SetRecordBloodType},\
|
||||
\
|
||||
{"SetRecordLevel", RecordsDynamicFunctions::SetRecordLevel},\
|
||||
{"SetRecordMagicka", RecordsDynamicFunctions::SetRecordMagicka},\
|
||||
{"SetRecordFatigue", RecordsDynamicFunctions::SetRecordFatigue},\
|
||||
|
@ -736,6 +739,24 @@ public:
|
|||
*/
|
||||
static void SetRecordFaction(const char* faction) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Set the scale of the temporary record stored on the server for the
|
||||
* currently specified record type.
|
||||
*
|
||||
* \param scale The scale of the record.
|
||||
* \return void
|
||||
*/
|
||||
static void SetRecordScale(double scale) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Set the blood type of the temporary record stored on the server for the
|
||||
* currently specified record type.
|
||||
*
|
||||
* \param bloodType The blood type of the record.
|
||||
* \return void
|
||||
*/
|
||||
static void SetRecordBloodType(int bloodType) noexcept;
|
||||
|
||||
/**
|
||||
* \brief Set the level of the temporary record stored on the server for the
|
||||
* currently specified record type.
|
||||
|
|
|
@ -486,6 +486,12 @@ void RecordHelper::overrideRecord(const mwmp::CreatureRecord& record)
|
|||
if (record.baseOverrides.hasModel)
|
||||
finalData.mModel = recordData.mModel;
|
||||
|
||||
if (record.baseOverrides.hasScale)
|
||||
finalData.mScale = recordData.mScale;
|
||||
|
||||
if (record.baseOverrides.hasBloodType)
|
||||
finalData.mBloodType = recordData.mBloodType;
|
||||
|
||||
if (record.baseOverrides.hasSubtype)
|
||||
finalData.mData.mType = recordData.mData.mType;
|
||||
|
||||
|
|
|
@ -115,6 +115,9 @@ namespace mwmp
|
|||
bool hasGender = false;
|
||||
bool hasFaction = false;
|
||||
|
||||
bool hasScale = false;
|
||||
bool hasBloodType = false;
|
||||
|
||||
bool hasLevel = false;
|
||||
bool hasMagicka = false;
|
||||
bool hasFatigue = false;
|
||||
|
|
|
@ -222,6 +222,8 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
|||
RW(recordData.mId, send, true);
|
||||
RW(recordData.mName, send, true);
|
||||
RW(recordData.mModel, send, true);
|
||||
RW(recordData.mScale, send);
|
||||
RW(recordData.mBloodType, send);
|
||||
RW(recordData.mData.mType, send);
|
||||
RW(recordData.mData.mLevel, send);
|
||||
RW(recordData.mData.mHealth, send);
|
||||
|
@ -240,6 +242,8 @@ void PacketRecordDynamic::Packet(RakNet::BitStream *bs, bool send)
|
|||
auto &&overrides = record.baseOverrides;
|
||||
RW(overrides.hasName, send);
|
||||
RW(overrides.hasModel, send);
|
||||
RW(overrides.hasScale, send);
|
||||
RW(overrides.hasBloodType, send);
|
||||
RW(overrides.hasSubtype, send);
|
||||
RW(overrides.hasLevel, send);
|
||||
RW(overrides.hasHealth, send);
|
||||
|
|
Loading…
Reference in a new issue