mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-04 01:37:47 +00:00
greater than 65535 effect entry value.
This commit is contained in:
parent
fb8d4e9794
commit
d5677b2a5a
2 changed files with 14 additions and 6 deletions
|
@ -662,6 +662,7 @@ namespace Sapphire::Common
|
|||
{
|
||||
None = 0,
|
||||
Absorbed = 0x04,
|
||||
ExtendedValue = 0x40,
|
||||
EffectOnSource = 0x80,
|
||||
Reflected = 0xA0,
|
||||
};
|
||||
|
@ -690,7 +691,7 @@ namespace Sapphire::Common
|
|||
* Has no effect on what is shown and stored in value
|
||||
*/
|
||||
uint8_t param2;
|
||||
uint8_t valueMultiplier; // This multiplies whatever value is in the 'value' param by 10. Possibly a workaround for big numbers
|
||||
uint8_t extendedValueHighestByte;
|
||||
uint8_t flags;
|
||||
int16_t value;
|
||||
};
|
||||
|
|
|
@ -96,14 +96,21 @@ void EffectResult::mount( uint16_t mountId )
|
|||
Common::EffectEntry EffectResult::buildEffectEntry() const
|
||||
{
|
||||
Common::EffectEntry entry{};
|
||||
|
||||
// todo: that retarded shit so > u16 max numbers work
|
||||
entry.value = getValue();
|
||||
entry.effectType = m_type;
|
||||
if( m_value > 0x0000FFFF )
|
||||
{
|
||||
entry.value = static_cast< uint16_t >( m_value & 0x0000FFFF );
|
||||
entry.extendedValueHighestByte = static_cast< uint8_t >( m_value >> 16 );
|
||||
entry.flags = static_cast< uint8_t >( m_flag ) + static_cast< uint8_t >( Common::ActionEffectResultFlag::ExtendedValue );
|
||||
}
|
||||
else
|
||||
{
|
||||
entry.value = static_cast< uint16_t >( m_value );
|
||||
entry.flags = static_cast< uint8_t >( m_flag );
|
||||
}
|
||||
entry.param0 = m_param0;
|
||||
entry.param1 = m_param1;
|
||||
entry.effectType = m_type;
|
||||
entry.param2 = m_param2;
|
||||
entry.flags = static_cast< uint8_t >( m_flag );
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue