Skip to content

Commit

Permalink
Merge pull request eesast#281 from Panxuc/dev
Browse files Browse the repository at this point in the history
fix: 🐛 fort attack everyone
asdawej authored Apr 27, 2024
2 parents 299d5f0 + a7ca555 commit bc23dc7
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions logic/GameClass/GameObj/Map/Map.cs
Original file line number Diff line number Diff line change
@@ -117,10 +117,10 @@ public static bool WormholeInteract(Wormhole gameObj, XY Pos)
return (GameObj?)GameObjDict[gameObjType].Find(gameObj =>
GameData.IsInTheRange(gameObj.Position, Pos, range));
}
public List<Ship>? ShipInTheRange(XY Pos, int range)
public List<Ship>? ShipInTheRangeNotTeamID(XY Pos, int range, long teamID)
{
return GameObjDict[GameObjType.Ship].Cast<Ship>()?.FindAll(ship =>
GameData.IsInTheRange(ship.Position, Pos, range));
(GameData.IsInTheRange(ship.Position, Pos, range) && ship.TeamID != teamID));
}
public List<Ship>? ShipInTheList(List<CellXY> PosList)
{
4 changes: 2 additions & 2 deletions logic/Gaming/ActionManager.cs
Original file line number Diff line number Diff line change
@@ -209,8 +209,8 @@ public bool Construct(Ship ship, ConstructionType constructionType)
gameMap.Timer.IsGaming && !construction.HP.IsBelowMaxTimes(0.5),
loopToDo: () =>
{
var ships = gameMap.ShipInTheRange(
construction.Position, GameData.FortRange);
var ships = gameMap.ShipInTheRangeNotTeamID(
construction.Position, GameData.FortRange, construction.TeamID);
if (ships == null || ships.Count == 0)
{
return true;

0 comments on commit bc23dc7

Please sign in to comment.