-
Notifications
You must be signed in to change notification settings - Fork 13
Description
In the C API, foreach loops are handled through macros, where the foreach_break and foreach_return macros serve a purpose as they need to call RSDK.BreakForeachLoop() before exiting the loop. In the C++ API, however, foreach loops are handled by first constructing an std::list of all entities in GameObject::GetEntities, and then the loop code is ran after the entire entity list has been formed. Despite this, however, the C++ GameAPI bindings still include the foreach_break and foreach_return macros, despite simply break and return being all that's needed. Beyond being unnecessary, these macros incorrectly include calls to RSDK::RSDKTable->BreakForeachLoop(), which decrement the foreach stack pointer despite the GetActive/AllEntities loop already being completed.