C4Object *C4GameObjects::AtObject(int ctx, int cty, DWORD &ocf, C4Object *exclude) { DWORD cocf; C4Object *cObj; C4ObjectLink *clnk; for (clnk = ObjectsAt(ctx, cty).First; clnk && (cObj = clnk->Obj); clnk = clnk->Next) if (!exclude || (cObj != exclude && exclude->pLayer == cObj->pLayer)) if (cObj->Status) { cocf = ocf | OCF_Exclusive; if (cObj->At(ctx, cty, cocf)) { // Search match if (cocf & ocf) { ocf = cocf; return cObj; } // EXCLUSIVE block else return NULL; } } return NULL; }