mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
Merge pull request #795 from noudess/master
Fix the LoadGFG function to no longer have the unused parameter.
This commit is contained in:
commit
ce5c09441f
2
zone/command.cpp
Normal file → Executable file
2
zone/command.cpp
Normal file → Executable file
@ -1688,7 +1688,7 @@ void command_zheader(Client *c, const Seperator *sep)
|
|||||||
c->Message(0, "Invalid Zone Name: %s", sep->argplus[1]);
|
c->Message(0, "Invalid Zone Name: %s", sep->argplus[1]);
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if (zone->LoadZoneCFG(sep->argplus[1], true))
|
if (zone->LoadZoneCFG(sep->argplus[1], 0))
|
||||||
c->Message(0, "Successfully loaded zone header for %s from database.", sep->argplus[1]);
|
c->Message(0, "Successfully loaded zone header for %s from database.", sep->argplus[1]);
|
||||||
else
|
else
|
||||||
c->Message(0, "Failed to load zone header %s from database", sep->argplus[1]);
|
c->Message(0, "Failed to load zone header %s from database", sep->argplus[1]);
|
||||||
|
|||||||
31
zone/zone.cpp
Normal file → Executable file
31
zone/zone.cpp
Normal file → Executable file
@ -893,7 +893,7 @@ bool Zone::Init(bool iStaticZone) {
|
|||||||
SetStaticZone(iStaticZone);
|
SetStaticZone(iStaticZone);
|
||||||
|
|
||||||
//load the zone config file.
|
//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
|
LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults
|
||||||
|
|
||||||
if(RuleManager::Instance()->GetActiveRulesetID() != default_ruleset)
|
if(RuleManager::Instance()->GetActiveRulesetID() != default_ruleset)
|
||||||
@ -1054,35 +1054,27 @@ void Zone::ReloadStaticData() {
|
|||||||
zone->LoadNPCEmotes(&NPCEmoteList);
|
zone->LoadNPCEmotes(&NPCEmoteList);
|
||||||
|
|
||||||
//load the zone config file.
|
//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
|
LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults
|
||||||
|
|
||||||
Log(Logs::General, Logs::Status, "Zone Static Data Reloaded.");
|
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));
|
memset(&newzone_data, 0, sizeof(NewZone_Struct));
|
||||||
if(instance_id == 0)
|
|
||||||
{
|
|
||||||
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;
|
map_name = nullptr;
|
||||||
|
|
||||||
if(!database.GetZoneCFG(database.GetZoneID(filename), instance_id, &newzone_data, can_bind,
|
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))
|
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);
|
safe_delete_array(map_name);
|
||||||
if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind,
|
if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate,
|
||||||
can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name))
|
can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name))
|
||||||
{
|
{
|
||||||
Log(Logs::General, Logs::Error, "Error loading the Zone Config.");
|
Log(Logs::General, Logs::Error, "Error loading the Zone Config.");
|
||||||
return false;
|
return false;
|
||||||
@ -1274,7 +1266,8 @@ bool Zone::Process() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Weather_Timer->Check()){
|
if(Weather_Timer->Check())
|
||||||
|
{
|
||||||
Weather_Timer->Disable();
|
Weather_Timer->Disable();
|
||||||
this->ChangeWeather();
|
this->ChangeWeather();
|
||||||
}
|
}
|
||||||
|
|||||||
2
zone/zone.h
Normal file → Executable file
2
zone/zone.h
Normal file → Executable file
@ -93,7 +93,7 @@ public:
|
|||||||
bool is_zone_time_localized;
|
bool is_zone_time_localized;
|
||||||
|
|
||||||
bool Init(bool iStaticZone);
|
bool Init(bool iStaticZone);
|
||||||
bool LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDefault = false);
|
bool LoadZoneCFG(const char* filename, uint16 instance_id);
|
||||||
bool SaveZoneCFG();
|
bool SaveZoneCFG();
|
||||||
bool IsLoaded();
|
bool IsLoaded();
|
||||||
bool IsPVPZone() { return pvpzone; }
|
bool IsPVPZone() { return pvpzone; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user