Open ShadowsAdi opened 3 years ago
This strikes me as a lot of work for very little benefit. It's a ton of code to write in the core, including a parser and evaluator for a domain-specific sublanguage. These kinds of conditions, stuffed into strings, also tend to be difficult to debug and maintain in scripts. There's minimal performance benefit. It also doesn't save you much work, since you can do the same filtering in the forward itself, with much greater flexibility and the same mount of typing.
I already don't like the way register_event/register_message/register_touch implemented.
New native: register_forward2:
Same as register_event function, would allow to receive the forward only when conditions match.
Function would look like :
native register_forward2(_forwardType, const function[], _post, const cond[]="", any:...);
Would allow to do such things :
Extracted from here: https://bugs.alliedmods.net/show_bug.cgi?id=5789