Skip to content

Commit

Permalink
revert(Game): revert revision at Game.AddShip
Browse files Browse the repository at this point in the history
  • Loading branch information
asdawej committed Dec 23, 2023
1 parent 7e5743a commit 73d38dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion logic/Gaming/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public long AddShip(ShipInitInfo shipInitInfo)
bool validBirthPoint = false;
foreach (XY birthPoint in teamList[(int)shipInitInfo.teamID].BirthPointList)
{
if (GameData.ApproachToInteract(GameData.PosGridToCellXY(pos), birthPoint) && GameData.PosGridToCellXY(pos) != birthPoint)
if (GameData.ApproachToInteract(pos, birthPoint) && pos != birthPoint)
{
validBirthPoint = true;
break;
Expand Down
2 changes: 0 additions & 2 deletions logic/Server/RpcServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ public override async Task AddPlayer(PlayerMsg request, IServerStreamWriter<Mess

lock (addPlayerLock)
{
// ShipInitInfo?
XY birthPoint = new(request.X, request.Y);
Game.ShipInitInfo playerInitInfo = new(request.TeamId, request.PlayerId, birthPoint, Transformation.ShipTypeFromProto(request.ShipType));
// AddShip?
long newPlayerID = game.AddShip(playerInitInfo);
if (newPlayerID == GameObj.invalidID)
return;
Expand Down

0 comments on commit 73d38dc

Please sign in to comment.