This commit is contained in:
2026-09-10 14:44:20 +07:00
parent 07576ee5fd
commit 27812c3781
4 changed files with 12 additions and 1 deletions
+6
View File
@@ -230,6 +230,12 @@ func (s *server) GetGameMap(ctx context.Context, req *proto.GetGameMapReq) (*pro
}
result := make([]*proto.MapItem, 0, len(items))
for _, item := range items {
if item.Kind == "screen" && screenStates[item.ItemID] == nil {
if err := s.mapRepo.Delete(ctx, item); err != nil {
return nil, status.Error(codes.Internal, "не удалось обновить карту")
}
continue
}
mapped := &proto.MapItem{Kind: item.Kind, ItemId: int32(item.ItemID), X: int32(item.X), Y: int32(item.Y), Hidden: item.Hidden}
if item.Kind == "team" {
mapped.Label = teamNames[item.ItemID]