diff --git a/src/weapon.c b/src/weapon.c index b2a7c28..49455ff 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -323,8 +323,10 @@ static void weapon_hit(Weapon* w, Pilot* p, WeaponLayer layer) { if(!pilot_isPlayer(p)) { if((player_target == p->id) || (RNG(0,2) == 0)) { if((w->parent == PLAYER_ID) && - (!pilot_isFlag(p, PILOT_HOSTILE) || (RNG(0, 2) == 0))) + (!pilot_isFlag(p, PILOT_HOSTILE) || (RNG(0, 2) == 0))) { faction_modPlayer(p->faction, -1); // Slowly lower faction. + pilot_setFlag(p, PILOT_HOSTILE); + } ai_attacked(p, w->parent); } spfx_add(outfit_spfx(w->outfit), @@ -335,10 +337,6 @@ static void weapon_hit(Weapon* w, Pilot* p, WeaponLayer layer) { VX(w->solid->pos), VY(w->solid->pos), VX(p->solid->vel), VY(p->solid->vel), SPFX_LAYER_FRONT); - if(w->parent == PLAYER_ID) - // Make hostile to player. - pilot_setFlag(p, PILOT_HOSTILE); - // Let the ship know that is should take some kind of damage. pilot_hit(p, w->solid, w->parent, outfit_dmgShield(w->outfit), outfit_dmgShield(w->outfit)); // We don't need the weapon particle any longer.