Skip to content

Commit

Permalink
fix: 🐛 factory die too many times
Browse files Browse the repository at this point in the history
  • Loading branch information
panxuc committed May 24, 2024
1 parent 9f65260 commit b017de0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions logic/GameClass/GameObj/Areas/Construction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,17 @@ public bool Construct(int constructSpeed, ConstructionType constructionType, Shi
}
public bool BeAttacked(Bullet bullet)
{
var previousActivated = IsActivated.Get();
if (bullet!.Parent!.TeamID != TeamID)
{
long subHP = bullet.AP;
HP.SubPositiveV(subHP);
}
if (HP == 0)
if (HP.IsBelowMaxTimes(0.5))
{
IsActivated.Set(false);
}
return HP.IsBelowMaxTimes(0.5);
return HP.IsBelowMaxTimes(0.5) && previousActivated;
}
public void AddConstructNum(int add = 1)
{
Expand Down

0 comments on commit b017de0

Please sign in to comment.