Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 fort attack everyone #281

Merged
merged 2 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading