Skip to content

Commit

Permalink
Merge pull request #22 from BDCarrillo/patch-1
Browse files Browse the repository at this point in the history
First whack at painter marks not clearing properly
  • Loading branch information
InvalidArgument3 authored Jul 25, 2024
2 parents dcbf864 + 5e9a024 commit 623d113
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Data/Scripts/CoreSystems/Ai/AiTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ internal void Sync(PaintedTargetPacket packet, Ai ai)

internal FakeWorldTargetInfo GetFakeTargetInfo(Ai ai)
{
var cleared = false;
if (TmpEntity != null && EntityId == TmpEntity.EntityId && TmpEntity.Physics != null && !TmpEntity.MarkedForClose && !TmpEntity.Closed)
{
if (Session.I.Tick != LastInfoTick)
Expand All @@ -273,15 +274,17 @@ internal FakeWorldTargetInfo GetFakeTargetInfo(Ai ai)
else if (Type == FakeType.Painted && EntityId != 0)
{
ClearMark(Session.I.Tick, MarkClearResons.PaintSwitchOrNoTargetInDb);
cleared = true;
}
}
}
else if (Type == FakeType.Painted && EntityId != 0)
{
ClearMark(Session.I.Tick, MarkClearResons.NoTarget);
cleared = true;
}

return FakeInfo;
return cleared ? null : FakeInfo;
}

internal enum MarkClearResons
Expand Down

0 comments on commit 623d113

Please sign in to comment.