Skip to content

Commit

Permalink
Merge pull request #399 from Panxuc/dev
Browse files Browse the repository at this point in the history
fix: 🐛 factory die too many times
  • Loading branch information
DragonAura authored May 24, 2024
2 parents 9f65260 + b017de0 commit 3e201cf
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 3e201cf

Please sign in to comment.