[Fix] Issue with pilot being marked as hostile when not hostile. :/
This commit is contained in:
parent
e4f76c9b08
commit
484b482c4b
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user