mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 14:37:44 +00:00
Weather works again.
This commit is contained in:
parent
aa0c318494
commit
1270f496b8
2 changed files with 14 additions and 9 deletions
8
deps/datReader/Exd/Structs.h
vendored
8
deps/datReader/Exd/Structs.h
vendored
|
@ -658,6 +658,12 @@ namespace Component::Excel
|
|||
int8_t padding0[2];
|
||||
};
|
||||
|
||||
struct WeatherRate
|
||||
{
|
||||
int32_t WeatherId[8];
|
||||
uint8_t Rate[8];
|
||||
};
|
||||
|
||||
/* 195172 */
|
||||
struct Aetheryte
|
||||
{
|
||||
|
@ -695,8 +701,8 @@ namespace Component::Excel
|
|||
uint8_t BattalionMode;
|
||||
uint8_t ExclusiveType;
|
||||
uint8_t IntendedUse;
|
||||
uint8_t WeatherRate;
|
||||
uint8_t Breath;
|
||||
uint8_t Unknown;
|
||||
uint8_t Resident;
|
||||
uint8_t Unknown1;
|
||||
uint8_t Unknown2;
|
||||
|
|
|
@ -98,22 +98,21 @@ void Sapphire::Territory::loadWeatherRates()
|
|||
auto& exdData = Common::Service< Data::ExdData >::ref();
|
||||
|
||||
// EXD TODO: this must be different in 2.3
|
||||
/* uint8_t weatherRateId = m_territoryTypeInfo->data().weatherRate > exdData.getWeatherRateIdList().size() ?
|
||||
uint8_t{ 0 } : m_territoryTypeInfo->weatherRate;
|
||||
uint8_t weatherRateId = m_territoryTypeInfo->data().WeatherRate > exdData.getIdList< Component::Excel::WeatherRate >().size() ?
|
||||
uint8_t{ 0 } : m_territoryTypeInfo->data().WeatherRate;
|
||||
|
||||
uint8_t sumPc = 0;
|
||||
auto weatherRateFields = exdData.m_WeatherRateDat.get_row( weatherRateId );
|
||||
for( size_t i = 0; i < 16; )
|
||||
auto weatherRate = exdData.getRow< Component::Excel::WeatherRate >( weatherRateId );
|
||||
for( size_t i = 0; i < 8; ++i )
|
||||
{
|
||||
int32_t weatherId = std::get< int32_t >( weatherRateFields[ i ] );
|
||||
int32_t weatherId = weatherRate->data().WeatherId[ i ];
|
||||
|
||||
if( weatherId == 0 )
|
||||
break;
|
||||
|
||||
sumPc += std::get< uint8_t >( weatherRateFields[ i + 1 ] );
|
||||
sumPc += weatherRate->data().Rate[ i ];
|
||||
m_weatherRateMap[ sumPc ] = weatherId;
|
||||
i += 2;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
Sapphire::Territory::~Territory() = default;
|
||||
|
|
Loading…
Add table
Reference in a new issue