1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-07 11:17:46 +00:00

Merge pull request #674 from collett8192/update_5.25

Implement greater than 65535 effect entry value.
This commit is contained in:
Mordred 2020-05-15 23:46:10 +02:00 committed by GitHub
commit 74f8c35fac
3 changed files with 15 additions and 7 deletions

View file

@ -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;
};

View file

@ -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;
}

View file

@ -11,7 +11,7 @@ using namespace Sapphire::Common;
std::string Sapphire::World::Manager::EventMgr::getEventName( uint32_t eventId )
{
auto& exdData = Common::Service< Data::ExdDataGenerated >::ref();
uint16_t eventType = eventId >> 16;
auto eventType = static_cast< Event::EventHandler::EventHandlerType >( eventId >> 16 );
auto unknown = std::string{ "unknown" };