Skip to content

Commit

Permalink
Merge pull request #627 from lionaneesh/dev
Browse files Browse the repository at this point in the history
Fix the bug when player is stuck looting a dead body and can get beaten to death meanwhile
  • Loading branch information
Xian55 authored Dec 2, 2024
2 parents 08b6372 + 4e50e45 commit 25a63cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
8 changes: 3 additions & 5 deletions Core/Goals/ConsumeCorpseGoal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ public ConsumeCorpseGoal(ILogger<ConsumeCorpseGoal> logger,
{
AddPrecondition(GoapKey.consumablecorpsenearby, true);
}
else
{
AddPrecondition(GoapKey.damagedone, false);
AddPrecondition(GoapKey.damagetaken, false);
}
AddPrecondition(GoapKey.pulled, false);
AddPrecondition(GoapKey.dangercombat, false);
AddPrecondition(GoapKey.incombat, false);

AddPrecondition(GoapKey.producedcorpse, true);
AddPrecondition(GoapKey.consumecorpse, false);
Expand Down
10 changes: 4 additions & 6 deletions Core/Goals/CorpseConsumedGoal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ public CorpseConsumedGoal(ILogger<CorpseConsumedGoal> logger,
{
AddPrecondition(GoapKey.consumablecorpsenearby, true);
}
else
{
AddPrecondition(GoapKey.damagedone, false);
AddPrecondition(GoapKey.damagetaken, false);
}
AddPrecondition(GoapKey.pulled, false);
AddPrecondition(GoapKey.dangercombat, false);
AddPrecondition(GoapKey.incombat, false);

AddPrecondition(GoapKey.consumecorpse, true);

Expand Down Expand Up @@ -70,4 +68,4 @@ public override void OnEnter()
Level = LogLevel.Information,
Message = "Total: {total} | Remaining: {remains}")]
static partial void LogConsumed(ILogger logger, int total, int remains);
}
}

0 comments on commit 25a63cf

Please sign in to comment.