mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-25 14:07:46 +00:00
Fix for weather crash
This commit is contained in:
parent
413c9f1007
commit
3eb0ad0c86
4 changed files with 27 additions and 6 deletions
|
@ -2378,10 +2378,11 @@
|
||||||
id = exdData->getField< std::string >( row, 5 );
|
id = exdData->getField< std::string >( row, 5 );
|
||||||
sizeFactor = exdData->getField< uint16_t >( row, 6 );
|
sizeFactor = exdData->getField< uint16_t >( row, 6 );
|
||||||
offsetX = exdData->getField< int16_t >( row, 7 );
|
offsetX = exdData->getField< int16_t >( row, 7 );
|
||||||
discoveryIndex = exdData->getField< int16_t >( row, 8 );
|
offsetY = exdData->getField< int16_t >( row, 8 );
|
||||||
placeNameRegion = exdData->getField< uint16_t >( row, 9 );
|
placeNameRegion = exdData->getField< uint16_t >( row, 9 );
|
||||||
placeName = exdData->getField< uint16_t >( row, 10 );
|
placeName = exdData->getField< uint16_t >( row, 10 );
|
||||||
placeNameSub = exdData->getField< uint16_t >( row, 11 );
|
placeNameSub = exdData->getField< uint16_t >( row, 11 );
|
||||||
|
discoveryIndex = exdData->getField< int16_t >( row, 12 );
|
||||||
territoryType = exdData->getField< uint16_t >( row, 14 );
|
territoryType = exdData->getField< uint16_t >( row, 14 );
|
||||||
discoveryArrayByte = exdData->getField< bool >( row, 15 );
|
discoveryArrayByte = exdData->getField< bool >( row, 15 );
|
||||||
}
|
}
|
||||||
|
@ -3711,6 +3712,10 @@
|
||||||
defaultTalkNPCWin = exdData->getField< uint32_t >( row, 22 );
|
defaultTalkNPCWin = exdData->getField< uint32_t >( row, 22 );
|
||||||
defaultTalkDraw = exdData->getField< uint32_t >( row, 23 );
|
defaultTalkDraw = exdData->getField< uint32_t >( row, 23 );
|
||||||
defaultTalkPCWin = exdData->getField< uint32_t >( row, 24 );
|
defaultTalkPCWin = exdData->getField< uint32_t >( row, 24 );
|
||||||
|
itemPossibleReward.push_back( exdData->getField< uint32_t >( row, 26 ) );
|
||||||
|
itemPossibleReward.push_back( exdData->getField< uint32_t >( row, 27 ) );
|
||||||
|
itemPossibleReward.push_back( exdData->getField< uint32_t >( row, 28 ) );
|
||||||
|
itemPossibleReward.push_back( exdData->getField< uint32_t >( row, 29 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Data::TripleTriadCard::TripleTriadCard( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
Core::Data::TripleTriadCard::TripleTriadCard( uint32_t row_id, Core::Data::ExdDataGenerated* exdData )
|
||||||
|
|
|
@ -2424,10 +2424,11 @@ struct Map
|
||||||
std::string id;
|
std::string id;
|
||||||
uint16_t sizeFactor;
|
uint16_t sizeFactor;
|
||||||
int16_t offsetX;
|
int16_t offsetX;
|
||||||
int16_t discoveryIndex;
|
int16_t offsetY;
|
||||||
uint16_t placeNameRegion;
|
uint16_t placeNameRegion;
|
||||||
uint16_t placeName;
|
uint16_t placeName;
|
||||||
uint16_t placeNameSub;
|
uint16_t placeNameSub;
|
||||||
|
int16_t discoveryIndex;
|
||||||
uint16_t territoryType;
|
uint16_t territoryType;
|
||||||
bool discoveryArrayByte;
|
bool discoveryArrayByte;
|
||||||
|
|
||||||
|
@ -3215,6 +3216,7 @@ struct TripleTriad
|
||||||
uint32_t defaultTalkNPCWin;
|
uint32_t defaultTalkNPCWin;
|
||||||
uint32_t defaultTalkDraw;
|
uint32_t defaultTalkDraw;
|
||||||
uint32_t defaultTalkPCWin;
|
uint32_t defaultTalkPCWin;
|
||||||
|
std::vector< uint32_t > itemPossibleReward;
|
||||||
|
|
||||||
TripleTriad( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
|
TripleTriad( uint32_t row_id, Core::Data::ExdDataGenerated* exdData );
|
||||||
};
|
};
|
||||||
|
|
|
@ -225,8 +225,10 @@ uint8_t Zone::getNextWeather()
|
||||||
|
|
||||||
auto rate = static_cast< uint8_t >( step2 % 0x64 );
|
auto rate = static_cast< uint8_t >( step2 % 0x64 );
|
||||||
|
|
||||||
auto weatherRate = g_exdDataGen.getWeatherRate( zoneInfo->weatherRate );
|
uint8_t weatherRateNum = zoneInfo->weatherRate > g_exdDataGen.getWeatherRateIdList().size() ? 0 : zoneInfo->weatherRate;
|
||||||
auto weatherRateFields = g_exdDataGen.m_WeatherRateDat.get_row( zoneInfo->weatherRate );
|
|
||||||
|
auto weatherRate = g_exdDataGen.getWeatherRate( weatherRateNum );
|
||||||
|
auto weatherRateFields = g_exdDataGen.m_WeatherRateDat.get_row( weatherRateNum );
|
||||||
|
|
||||||
std::map< uint8_t, int32_t> weatherRateMap;
|
std::map< uint8_t, int32_t> weatherRateMap;
|
||||||
|
|
||||||
|
@ -238,7 +240,7 @@ uint8_t Zone::getNextWeather()
|
||||||
if( weatherId == 0 )
|
if( weatherId == 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
sumPc += boost::get<int32_t>( weatherRateFields[i + 1] );
|
sumPc += boost::get<uint8_t>( weatherRateFields[i + 1] );
|
||||||
weatherRateMap[sumPc] = weatherId;
|
weatherRateMap[sumPc] = weatherId;
|
||||||
|
|
||||||
i += 2;
|
i += 2;
|
||||||
|
|
|
@ -6253,7 +6253,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index": 8,
|
"index": 12,
|
||||||
"name": "DiscoveryIndex"
|
"name": "DiscoveryIndex"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -9114,6 +9114,18 @@
|
||||||
"type": "link",
|
"type": "link",
|
||||||
"target": "DefaultTalk"
|
"target": "DefaultTalk"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"index": 26,
|
||||||
|
"type": "repeat",
|
||||||
|
"count": 4,
|
||||||
|
"definition": {
|
||||||
|
"name": "Item{PossibleReward}",
|
||||||
|
"converter": {
|
||||||
|
"type": "link",
|
||||||
|
"target": "Item"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue