int CEventHandler::AllowWeaponTargetCheck(unsigned int attackerID, unsigned int attackerWeaponNum, unsigned int attackerWeaponDefID) { int result = -1; for (int i = 0; i < listAllowWeaponTargetCheck.size(); ) { CEventClient* ec = listAllowWeaponTargetCheck[i]; int result2 = ec->AllowWeaponTargetCheck(attackerID, attackerWeaponNum, attackerWeaponDefID); if (result2 > result) result = result2; if (i < listAllowWeaponTargetCheck.size() && ec == listAllowWeaponTargetCheck[i]) ++i; /* the call-in may remove itself from the list */ } return result; }