This commit is contained in:
2026-09-10 04:18:49 +07:00
parent 8e9289a621
commit b8a9545b52
3 changed files with 18 additions and 6 deletions
+3
View File
@@ -248,6 +248,9 @@ func (s *server) UpdateGameMapItem(ctx context.Context, req *proto.UpdateGameMap
return nil, status.Error(codes.InvalidArgument, "некорректный объект карты")
}
if err := s.mapRepo.Update(ctx, game_map_repo.Item{GameID: int(req.GameId), Kind: req.Kind, ItemID: int(req.ItemId), X: int(req.X), Y: int(req.Y), Hidden: req.Hidden}); err != nil {
if errors.Is(err, game_map_repo.ErrItemNotFound) {
return nil, status.Error(codes.NotFound, "объект карты не найден")
}
return nil, status.Error(codes.Internal, "не удалось изменить карту")
}
return &proto.UpdateGameMapItemRsp{}, nil