diff --git a/Makefile b/Makefile index 97f7cd86..065844af 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ MXQ_VERSION_MAJOR = 0 MXQ_VERSION_MINOR = 27 -MXQ_VERSION_PATCH = 1 +MXQ_VERSION_PATCH = 2 MXQ_VERSION_EXTRA = "beta" MXQ_VERSIONDATE = 2021 diff --git a/mxqd_control.c b/mxqd_control.c index 46080c43..138963c8 100644 --- a/mxqd_control.c +++ b/mxqd_control.c @@ -34,6 +34,22 @@ static int server_is_qualified(struct mxq_server *server, struct mxq_group *grou if (parser_context.result == 0) return 0; // evaluated to false } + if (*server->daemon.prerequisites != 0) { + if (*group->tags == 0) { + return 0; + } + _mx_cleanup_(keywordset_free_byref) struct keywordset *kws = keywordset_new(group->tags); + struct parser_context parser_context = { + .input = server->daemon.prerequisites, + .tags = kws, + .pos = 0, + .result = 0, + }; + if (yyparse(&parser_context)) + return 0; // syntax error in expression + if (parser_context.result == 0) + return 0; // evaluated to false + } return (1); }