Merge pull request #8 from milestorme/master

clean up config
This commit is contained in:
Micrah 2019-08-21 11:43:27 +10:00 committed by GitHub
commit 211294f28e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,8 +65,6 @@ config file for quick modifications.
#include "Player.h"
#include "Chat.h"
bool CongratsEnable = true;
bool CongratsAnnounceModule = true;
class CongratsConfig : public WorldScript
{
@ -84,13 +82,6 @@ public:
sConfigMgr->LoadMore(cfg_file.c_str());
}
}
// Load Configuration Settings
void SetInitialWorldSettings()
{
CongratsEnable = sConfigMgr->GetBoolDefault("Congrats.Enable", true);
CongratsAnnounceModule = sConfigMgr->GetBoolDefault("Congrats.Announce", true);
}
};
class CongratsAnnounce : public PlayerScript
@ -103,14 +94,11 @@ public:
void OnLogin(Player* player)
{
// Announce Module
if (CongratsEnable)
{
if (CongratsAnnounceModule)
if (sConfigMgr->GetBoolDefault("Congrats.Announce", true))
{
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00CongratsOnLevel |rmodule.");
}
}
}
};
class CongratsOnLevel : public PlayerScript