oscar-broman / samp-weapon-config

A more consistent and responsive damage system with many new features
Apache License 2.0
91 stars 84 forks source link

Advanced foreach support #221

Closed NexiusTailer closed 2 years ago

NexiusTailer commented 2 years ago

Advanced support for any foreach edition, particularly foreach standalone: this and that. The first one doesn't have "_inc_y_iterate" definition at all, so at the moment such standalone edition isn't detected and used by weapon-config.

Despite the fact both standalone forks have not been maintained for last 2-3 years, those versions are still very popular and many prefer to use it separately from YSI. Check for "foreach" macro instead of "y_iterate"-related include guard macro solve this problem and still make it possible to use "original" YSI version and any foreach standalone release as well. y_iterate has higher priority and is included first if the script tries to find any foreach dependency.

UPD: According to the latest ColAndreas PRs (#97) I've noticed an alternative way to detect both YSI/all non-YSI foreach releases checking for "_Y_ITERATE_LOCAL_VERSION" and "_FOREACH_LOCAL_VERSION" definitions, but it's just another way if somebody needs that and/or sees it more reliable for himself.

ADRFranklin commented 2 years ago

Just waiting for you to commit the changes and I'll take a look. It does look like _Y_ITERATE_LOCAL_VERSION and _FOREACH_LOCAL_VERSION are the way to go.