(b8fa3b004) Merge branch 'dev' into human-ai

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:10:07 +03:00
parent 7ebb0be29b
commit 9cc9137fff
12 changed files with 94 additions and 86 deletions
@@ -306,12 +306,12 @@ namespace Barotrauma
public override void OnAttacked(Character attacker, AttackResult attackResult)
{
// Damage from falling etc.
if (Character.LastDamageSource == null) { return; }
float damage = attackResult.Damage;
if (damage <= 0) { return; }
if (attacker == null || attacker.IsDead || attacker.Removed)
{
// Ignore damage from falling etc that we shouldn't react to.
if (Character.LastDamageSource == null) { return; }
AddCombatObjective(AIObjectiveCombat.CombatMode.Retreat, Rand.Range(0.5f, 1f, Rand.RandSync.Unsynced));
}
else if (IsFriendly(attacker))