Changeset 127 for trunk/UGame.pas
- Timestamp:
- Jun 17, 2017, 3:14:16 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r126 r127 394 394 procedure BuildBridges; 395 395 procedure BuildMapAreas; 396 procedure InitClients; 396 397 public 397 398 Players: TPlayers; … … 2703 2704 end; 2704 2705 2706 procedure TGame.InitClients; 2707 var 2708 I: Integer; 2709 begin 2710 Clients.Clear; 2711 Clients.New('Spectator'); 2712 for I := 0 to Players.Count - 1 do 2713 with TPlayer(Players[I]) do 2714 if Mode = pmHuman then begin 2715 Clients.New(TPlayer(Players[I]).Name); 2716 TPlayer(Players[I]).Client := TClient(Clients.Last); 2717 end; 2718 2719 for I := 0 to Clients.Count - 1 do 2720 with TClient(Clients[I]) do begin 2721 View.Clear; 2722 View.Zoom := 1; 2723 if Assigned(ControlPlayer) then View.CenterPlayerCity(ControlPlayer) 2724 else View.CenterMap; 2725 end; 2726 end; 2727 2705 2728 procedure TGame.SaveConfig(Config: TXmlConfig; Path: string); 2706 2729 begin … … 2793 2816 else CurrentPlayer := nil; 2794 2817 2818 InitClients; 2819 2795 2820 NewNode := FindNode('UnitMoves'); 2796 2821 if Assigned(NewNode) then … … 3044 3069 else CurrentPlayer := nil; 3045 3070 3046 Clients.Clear; 3047 Clients.New('Spectator'); 3048 for I := 0 to Players.Count - 1 do 3049 with TPlayer(Players[I]) do 3050 if Mode = pmHuman then begin 3051 Clients.New(TPlayer(Players[I]).Name); 3052 TPlayer(Players[I]).Client := TClient(Clients.Last); 3053 end; 3054 3055 for I := 0 to Clients.Count - 1 do 3056 with TClient(Clients[I]) do begin 3057 View.Clear; 3058 View.Zoom := 1; 3059 if Assigned(ControlPlayer) then View.CenterPlayerCity(ControlPlayer) 3060 else View.CenterMap; 3061 end; 3071 InitClients; 3062 3072 end; 3063 3073
Note:
See TracChangeset
for help on using the changeset viewer.