Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
shangfengh authored Apr 27, 2024
2 parents 75deb4b + bc23dc7 commit ed8019c
Show file tree
Hide file tree
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
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions logic/Gaming/ActionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ed8019c

Please sign in to comment.