Skip to content

Commit

Permalink
Merge pull request eesast#392 from Panxuc/dev
Browse files Browse the repository at this point in the history
fix: 🐛 wormhole keep killing, construction not zero
  • Loading branch information
panxuc authored May 22, 2024
2 parents 5fc1a38 + fc520f2 commit af2639e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions logic/GameClass/GameObj/Areas/Construction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ public bool BeAttacked(Bullet bullet)
}
if (HP == 0)
{
lock (lockOfConstructionType)
constructionType = ConstructionType.Null;
IsActivated.Set(false);
}
return HP.IsBelowMaxTimes(0.5);
Expand Down
3 changes: 2 additions & 1 deletion logic/Gaming/AttackManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ private void BombObj(Bullet bullet, GameObj objBeingShot)
}
break;
case GameObjType.Wormhole:
var previousHP = ((WormholeCell)objBeingShot).Wormhole.HP;
((WormholeCell)objBeingShot).Wormhole.BeAttacked(bullet);
if (((WormholeCell)objBeingShot).Wormhole.HP < GameData.WormholeHP / 2)
if (previousHP >= GameData.WormholeHP / 2 && ((WormholeCell)objBeingShot).Wormhole.HP < GameData.WormholeHP / 2)
{
var shipList = gameMap.ShipInTheList(((WormholeCell)objBeingShot).Wormhole.Cells);
if (shipList != null)
Expand Down

0 comments on commit af2639e

Please sign in to comment.