Merge branch 'master' into movement_manager

This commit is contained in:
Akkadius
2018-12-17 01:39:37 -06:00
53 changed files with 4179 additions and 1927 deletions
Regular → Executable
+16 -23
View File
@@ -896,7 +896,7 @@ bool Zone::Init(bool iStaticZone) {
SetStaticZone(iStaticZone);
//load the zone config file.
if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion(), true)) // try loading the zone name...
if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion())) // try loading the zone name...
LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults
if(RuleManager::Instance()->GetActiveRulesetID() != default_ruleset)
@@ -1057,39 +1057,31 @@ void Zone::ReloadStaticData() {
zone->LoadNPCEmotes(&NPCEmoteList);
//load the zone config file.
if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion(), true)) // try loading the zone name...
if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion())) // try loading the zone name...
LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults
Log(Logs::General, Logs::Status, "Zone Static Data Reloaded.");
}
bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDefault)
bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id)
{
memset(&newzone_data, 0, sizeof(NewZone_Struct));
if(instance_id == 0)
map_name = nullptr;
if(!database.GetZoneCFG(database.GetZoneID(filename), instance_id, &newzone_data, can_bind,
can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name))
{
map_name = nullptr;
if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind,
can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name))
{
Log(Logs::General, Logs::Error, "Error loading the Zone Config.");
return false;
}
}
else
{
//Fall back to base zone if we don't find the instance version.
map_name = nullptr;
if(!database.GetZoneCFG(database.GetZoneID(filename), instance_id, &newzone_data, can_bind,
can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name))
// If loading a non-zero instance failed, try loading the default
if (instance_id != 0)
{
safe_delete_array(map_name);
if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind,
can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name))
{
if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate,
can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name))
{
Log(Logs::General, Logs::Error, "Error loading the Zone Config.");
return false;
}
}
}
}
@@ -1277,7 +1269,8 @@ bool Zone::Process() {
}
}
if(Weather_Timer->Check()){
if(Weather_Timer->Check())
{
Weather_Timer->Disable();
this->ChangeWeather();
}