fix(factions): the player can strike allied creatures again
Valheim 1.0's hit filters (Attack melee/area, Projectile OnHit/DoAOE/ IsValidTarget, Aoe.ShouldHit) skip a target when BaseAI.IsEnemy says false and the attacker is a player without PvP. The truce said false for every allied creature, so the blow passed through: no damage, no grudge, nothing for kin to join. RaceGrudge.StrikeScope opens a scope around those six methods in which both truce patches stand down for the player's own hit; everything else keeps the truce.
This commit is contained in:
parent
fdc5d9fab7
commit
4ee98d90cb
3 changed files with 57 additions and 0 deletions
|
|
@ -165,6 +165,10 @@ namespace RacesOfValheim
|
|||
if (!__result) return; // already not enemies, nothing to add
|
||||
if (a == null || b == null) return;
|
||||
|
||||
// The player's own blow. Peace is the creature's choice, not a shield. See
|
||||
// RaceGrudge.StrikeScope.
|
||||
if (RaceGrudge.PlayerStrikes(a)) return;
|
||||
|
||||
if (IsThrallTruce(a, b) || IsThrallTruce(b, a))
|
||||
{
|
||||
__result = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue