/** * @brief Check whether 'target' has just triggered any new reaction fire * @param[in] target The entity triggering fire */ void ReactionFire::updateAllTargets (const Edict* target) { Actor* shooter = nullptr; /* check all possible shooters */ while ((shooter = G_EdictsGetNextLivingActor(shooter))) { /* check whether reaction fire is possible (friend/foe, LoS) */ if (isPossible(shooter, target)) { const int TUs = G_ReactionFireGetTUsForItem(shooter, target); if (TUs < 0) continue; /* no suitable weapon */ rft.add(shooter, target, TUs); } else { rft.remove(shooter, target); } } }
/** * @brief Check whether 'target' has just triggered any new reaction fire * @param[in] target The entity triggering fire */ static void G_ReactionFireTargetsUpdateAll (const edict_t *target) { edict_t *shooter = NULL; /* check all possible shooters */ while ((shooter = G_EdictsGetNextLivingActor(shooter))) { /* check whether reaction fire is possible (friend/foe, LoS */ if (G_ReactionFireIsPossible(shooter, target)) { const int TUs = G_ReactionFireGetTUsForItem(shooter, target, RIGHT(shooter)); if (TUs < 0) continue; /* no suitable weapon */ rft.add(shooter, target, TUs); } else { rft.remove(shooter, target); } } }