fix(Core): reloading config (#25)

This commit is contained in:
UltraNix
2021-10-12 19:10:05 +02:00
committed by GitHub
parent ac351ece83
commit 0def32ca35

View File

@@ -15,9 +15,7 @@
class lfg_solo_announce : public PlayerScript class lfg_solo_announce : public PlayerScript
{ {
public: public:
lfg_solo_announce() : PlayerScript("lfg_solo_announce") {} lfg_solo_announce() : PlayerScript("lfg_solo_announce") {}
void OnLogin(Player* player) void OnLogin(Player* player)
@@ -30,23 +28,18 @@ public:
} }
}; };
class lfg_solo : public PlayerScript class lfg_solo : public WorldScript
{ {
public: public:
lfg_solo() : PlayerScript("lfg_solo") { } lfg_solo() : WorldScript("lfg_solo") {}
// Docker Installation prevents warnings. In order to avoid the issue, we need to add __attribute__ ((unused)) void OnAfterConfigLoad(bool /*reload*/) override
// to the player variable to tell the compiler it is fine not to use it. {
void OnLogin(Player* player) if (sConfigMgr->GetBoolDefault("SoloLFG.Enable", true) != sLFGMgr->IsSoloLFG())
{
if (sConfigMgr->GetIntDefault("SoloLFG.Enable", true))
{ {
if (!sLFGMgr->IsSoloLFG())
{
sLFGMgr->ToggleSoloLFG(); sLFGMgr->ToggleSoloLFG();
}
} }
} }
}; };
void AddLfgSoloScripts() void AddLfgSoloScripts()