Primarily this is a patch to add sqrt to DECORATE expressions. However, to do so I extended FxGlobalFunctionCall into a generalized base class for DECORATE functions so that they can be added quickly and easily without hacking them in like abs. Or incurring an on-evaluation-lookup cost like the current FxGlobalFunctionCall.
It is my sincere hope that this rewrite is actually suitable for future additions to DECORATE expressions. Especially given the probably large number of functions that would be considered useful. (Such as, say, a CheckInventory for DECORATE.) So if there is anything I can do to further that goal, I am entirely willing to do so myself if asked. (Two things in particular that I'd like to change from the patch as-is is to break up cos/sin and to change abs to use the new system.)
(As a side note, I used a separate file because I think thingdef_expression.cpp is quite large enough already. If adding the code there would be preferred I could rewrite the patch to do so.)
- (3.2 KiB) Downloaded 15 times