mirror of
https://github.com/azerothcore/mod-solo-lfg
synced 2025-11-29 15:58:17 +08:00
fix(Core): reloading config (#25)
This commit is contained in:
@@ -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->GetIntDefault("SoloLFG.Enable", true))
|
if (sConfigMgr->GetBoolDefault("SoloLFG.Enable", true) != sLFGMgr->IsSoloLFG())
|
||||||
{
|
|
||||||
if (!sLFGMgr->IsSoloLFG())
|
|
||||||
{
|
{
|
||||||
sLFGMgr->ToggleSoloLFG();
|
sLFGMgr->ToggleSoloLFG();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddLfgSoloScripts()
|
void AddLfgSoloScripts()
|
||||||
|
|||||||
Reference in New Issue
Block a user