* Add ScriptName to game_weather.
--HG-- branch : trunk
This commit is contained in:
@@ -7227,12 +7227,12 @@ void ObjectMgr::LoadNPCSpellClickSpells()
|
||||
sLog.outString(">> Loaded %u spellclick definitions", count);
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadWeatherZoneChances()
|
||||
void ObjectMgr::LoadWeatherData()
|
||||
{
|
||||
uint32 count = 0;
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT zone, spring_rain_chance, spring_snow_chance, spring_storm_chance, summer_rain_chance, summer_snow_chance, summer_storm_chance, fall_rain_chance, fall_snow_chance, fall_storm_chance, winter_rain_chance, winter_snow_chance, winter_storm_chance FROM game_weather");
|
||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
|
||||
QueryResult_AutoPtr result = WorldDatabase.Query("SELECT zone, spring_rain_chance, spring_snow_chance, spring_storm_chance, summer_rain_chance, summer_snow_chance, summer_storm_chance, fall_rain_chance, fall_snow_chance, fall_storm_chance, winter_rain_chance, winter_snow_chance, winter_storm_chance, ScriptName FROM game_weather");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -7254,7 +7254,7 @@ void ObjectMgr::LoadWeatherZoneChances()
|
||||
|
||||
uint32 zone_id = fields[0].GetUInt32();
|
||||
|
||||
WeatherZoneChances& wzc = mWeatherZoneMap[zone_id];
|
||||
WeatherData& wzc = mWeatherZoneMap[zone_id];
|
||||
|
||||
for (uint8 season = 0; season < WEATHER_SEASONS; ++season)
|
||||
{
|
||||
@@ -7281,6 +7281,8 @@ void ObjectMgr::LoadWeatherZoneChances()
|
||||
}
|
||||
}
|
||||
|
||||
wzc.ScriptId = objmgr.GetScriptId(fields[13].GetString());
|
||||
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
@@ -8744,6 +8746,8 @@ void ObjectMgr::LoadScriptNames()
|
||||
"UNION "
|
||||
"SELECT DISTINCT(ScriptName) FROM transports WHERE ScriptName <> '' "
|
||||
"UNION "
|
||||
"SELECT DISTINCT(ScriptName) FROM game_weather WHERE ScriptName <> '' "
|
||||
"UNION "
|
||||
"SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
|
||||
|
||||
if (!result)
|
||||
|
||||
@@ -302,9 +302,10 @@ struct WeatherSeasonChances
|
||||
uint32 stormChance;
|
||||
};
|
||||
|
||||
struct WeatherZoneChances
|
||||
struct WeatherData
|
||||
{
|
||||
WeatherSeasonChances data[WEATHER_SEASONS];
|
||||
uint32 ScriptId;
|
||||
};
|
||||
|
||||
struct GraveYardData
|
||||
@@ -397,7 +398,7 @@ class ObjectMgr
|
||||
|
||||
typedef UNORDERED_MAP<uint32, PointOfInterest> PointOfInterestMap;
|
||||
|
||||
typedef UNORDERED_MAP<uint32, WeatherZoneChances> WeatherZoneMap;
|
||||
typedef UNORDERED_MAP<uint32, WeatherData> WeatherZoneMap;
|
||||
|
||||
typedef std::vector<std::string> ScriptNameMap;
|
||||
|
||||
@@ -687,7 +688,7 @@ class ObjectMgr
|
||||
|
||||
void LoadNPCSpellClickSpells();
|
||||
|
||||
void LoadWeatherZoneChances();
|
||||
void LoadWeatherData();
|
||||
void LoadGameTele();
|
||||
|
||||
void LoadNpcTextId();
|
||||
@@ -740,7 +741,7 @@ class ObjectMgr
|
||||
return NULL;
|
||||
}
|
||||
|
||||
WeatherZoneChances const* GetWeatherChances(uint32 zone_id) const
|
||||
WeatherData const* GetWeatherChances(uint32 zone_id) const
|
||||
{
|
||||
WeatherZoneMap::const_iterator itr = mWeatherZoneMap.find(zone_id);
|
||||
if (itr != mWeatherZoneMap.end())
|
||||
|
||||
Reference in New Issue
Block a user