Skip to content

Commit

Permalink
Merge pull request #397 from Panxuc/dev
Browse files Browse the repository at this point in the history
fix: 🐛 repairwormhole
  • Loading branch information
hhzzff authored May 23, 2024
2 parents 420ea59 + d7d6c53 commit 9f65260
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions logic/GameClass/GameObj/Map/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,9 @@ public IOutOfBound GetOutOfBound(XY pos)
{
return (Ship?)GameObjDict[GameObjType.Ship].Find(gameObj => (teamID == ((Ship)gameObj).TeamID) && playerID == ((Ship)gameObj).PlayerID);
}

public static bool WormholeInteract(Wormhole gameObj, XY Pos)
{
foreach (WormholeCell cell in gameObj.Cells)
{
if (GameData.ApproachToInteract(cell.Position, Pos))
return true;
}
return false;
}
public GameObj? OneForInteract(XY Pos, GameObjType gameObjType)
{
return (GameObj?)GameObjDict[gameObjType].Find(gameObj =>
((GameData.ApproachToInteract(gameObj.Position, Pos)) ||
(gameObjType == GameObjType.Wormhole && WormholeInteract((Wormhole)gameObj, Pos)))
);
return (GameObj?)GameObjDict[gameObjType].Find(gameObj => GameData.ApproachToInteract(gameObj.Position, Pos));
}
public GameObj? OneInTheSameCell(XY Pos, GameObjType gameObjType)
{
Expand Down

0 comments on commit 9f65260

Please sign in to comment.