[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
4 changed files with 14 additions and 0 deletions
+1
View File
@@ -2746,6 +2746,7 @@ bool Perl__IsContentFlagEnabled(std::string flag_name)
void Perl__SetContentFlag(std::string flag_name, bool enabled) void Perl__SetContentFlag(std::string flag_name, bool enabled)
{ {
content_service.SetContentFlag(flag_name, enabled); content_service.SetContentFlag(flag_name, enabled);
zone->ReloadContentFlags();
} }
Expedition* Perl__get_expedition() Expedition* Perl__get_expedition()
+1
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){ void lua_set_content_flag(std::string flag_name, bool enabled){
content_service.SetContentFlag(flag_name, enabled); content_service.SetContentFlag(flag_name, enabled);
zone->ReloadContentFlags();
} }
Lua_Expedition lua_get_expedition() { Lua_Expedition lua_get_expedition() {
+10
View File
@@ -3136,3 +3136,13 @@ bool Zone::CompareDataBucket(uint8 bucket_comparison, const std::string& bucket_
return passes; return passes;
} }
void Zone::ReloadContentFlags()
{
auto pack = new ServerPacket(ServerOP_ReloadContentFlags, 0);
if (pack) {
worldserver.SendPacket(pack);
}
safe_delete(pack);
}
+2
View File
@@ -395,6 +395,8 @@ public:
void SetIsHotzone(bool is_hotzone); void SetIsHotzone(bool is_hotzone);
void ReloadContentFlags();
private: private:
bool allow_mercs; bool allow_mercs;
bool can_bind; bool can_bind;