[Quest API] Reload content flags globally when a content flag is set (#3564)

This commit is contained in:
Chris Miles 2023-08-20 20:56:40 -05:00 committed by GitHub
parent c47644ea46
commit 7122ac33b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 0 deletions

View File

@ -2746,6 +2746,7 @@ bool Perl__IsContentFlagEnabled(std::string flag_name)
void Perl__SetContentFlag(std::string flag_name, bool enabled)
{
content_service.SetContentFlag(flag_name, enabled);
zone->ReloadContentFlags();
}
Expedition* Perl__get_expedition()

View File

@ -1812,6 +1812,7 @@ bool lua_is_content_flag_enabled(std::string content_flag){
void lua_set_content_flag(std::string flag_name, bool enabled){
content_service.SetContentFlag(flag_name, enabled);
zone->ReloadContentFlags();
}
Lua_Expedition lua_get_expedition() {

View File

@ -3136,3 +3136,13 @@ bool Zone::CompareDataBucket(uint8 bucket_comparison, const std::string& bucket_
return passes;
}
void Zone::ReloadContentFlags()
{
auto pack = new ServerPacket(ServerOP_ReloadContentFlags, 0);
if (pack) {
worldserver.SendPacket(pack);
}
safe_delete(pack);
}

View File

@ -395,6 +395,8 @@ public:
void SetIsHotzone(bool is_hotzone);
void ReloadContentFlags();
private:
bool allow_mercs;
bool can_bind;