void cmeasure_maybe_alert_success(object *objp) { //Is this a countermeasure, and does it have a parent if ( objp->type != OBJ_WEAPON || objp->parent < 0) { return; } Assert(Weapon_info[Weapons[objp->instance].weapon_info_index].wi_flags[Weapon::Info_Flags::Cmeasure]); if ( objp->parent == OBJ_INDEX(Player_obj) ) { hud_start_text_flash(XSTR("Evaded", 1430), 800); snd_play(gamesnd_get_game_sound(ship_get_sound(Player_obj, SND_MISSILE_EVADED_POPUP))); } else if ( Objects[objp->parent].flags[Object::Object_Flags::Player_ship] ) { send_countermeasure_success_packet( objp->parent ); } }
// If this is a player countermeasure, let the player know he evaded a missile void cmeasure_maybe_alert_success(object* objp) { //Is this a countermeasure, and does it have a parent if (objp->type != OBJ_WEAPON || objp->parent < 0) { return; } Assert(Weapon_info[Weapons[objp->instance].weapon_info_index].wi_flags & WIF_CMEASURE); if (objp->parent == OBJ_INDEX(Player_obj)) { hud_start_text_flash(XSTR("Evaded", 1430), 800); snd_play(&Snds[SND_MISSILE_EVADED_POPUP]); } else if (Objects[objp->parent].flags & OF_PLAYER_SHIP) { send_countermeasure_success_packet(objp->parent); } }