Changeset 149 for trunk


Ignore:
Timestamp:
Nov 4, 2018, 7:25:44 PM (5 years ago)
Author:
chronos
Message:
  • Fixed: Wrong vertical position of unit lack red background frame in city screen.
  • Fixed: Wrong index evaluation in game load function.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GameServer.pas

    r145 r149  
    11111111  MovieMode: boolean): boolean;
    11121112var
    1113   j: TBrain;
     1113  J: TBrain;
    11141114  i, ix, d, p1, Command, Subject: integer;
     1115  K: Integer;
    11151116{$IFDEF TEXTLOG}LoadPos0: integer; {$ENDIF}
    11161117  Data: pointer;
     
    11191120  s: string[255];
    11201121  SaveMap: array [0 .. lxmax * lymax - 1] of Byte;
    1121   started, StatRequest: boolean;
     1122  Started, StatRequest: boolean;
    11221123begin
    11231124  SavePath := Path;
     
    11271128    fmShareExclusive);
    11281129  LogFile.Position := 0;
    1129   LogFile.read(s[1], 8); { file id }
    1130   LogFile.read(i, 4); { c-evo version }
    1131   LogFile.read(j, 4); { exe time }
     1130  LogFile.Read(s[1], 8); { file id }
     1131  LogFile.Read(i, 4); { c-evo version }
     1132  LogFile.Read(J, 4); { exe time }
    11321133
    11331134  if (i >= FirstBookCompatibleVersion) and (i <= Version) then
    11341135  begin
    11351136    result := true;
    1136     LogFile.read(lx, 4);
    1137     LogFile.read(ly, 4);
     1137    LogFile.Read(lx, 4);
     1138    LogFile.Read(ly, 4);
    11381139    MapSize := lx * ly;
    1139     LogFile.read(LandMass, 4);
     1140    LogFile.Read(LandMass, 4);
    11401141    if LandMass = 0 then
    1141       LogFile.read(RealMap, MapSize * 4); // use predefined map
    1142     LogFile.read(MaxTurn, 4);
    1143     LogFile.read(RND, 4);
    1144     LogFile.read(GTurn, 4);
    1145     LogFile.read(SaveMap, 4);
     1142      LogFile.Read(RealMap, MapSize * 4); // use predefined map
     1143    LogFile.Read(MaxTurn, 4);
     1144    LogFile.Read(RND, 4);
     1145    LogFile.Read(GTurn, 4);
     1146    LogFile.Read(SaveMap, 4);
    11461147    if SaveMap[0] <> $80 then
    11471148      LogFile.read(SaveMap[4], ((MapSize - 1) div 4 + 1) * 4 - 4);
    11481149    for p1 := 0 to nPl - 1 do
    11491150    begin
    1150       LogFile.read(s[0], 4);
     1151      LogFile.Read(s[0], 4);
    11511152      if s[0] = #0 then
    11521153        PlayersBrain[p1] := nil
    11531154      else
    11541155      begin
    1155         LogFile.read(s[4], Byte(s[0]) div 4 * 4);
    1156         LogFile.read(OriginalDataVersion[p1], 4);
    1157         LogFile.read(d, 4); { behavior }
    1158         LogFile.read(Difficulty[p1], 4);
    1159         j := Brains.Last;
    1160         while Assigned(J) and (AnsiCompareFileName(j.FileName, s) <> 0) do
    1161           J := PlayersBrain[PlayersBrain.IndexOf(J) - 1];
    1162         if not Assigned(j) then
     1156        LogFile.Read(s[4], Byte(s[0]) div 4 * 4);
     1157        LogFile.Read(OriginalDataVersion[p1], 4);
     1158        LogFile.Read(d, 4); { behavior }
     1159        LogFile.Read(Difficulty[p1], 4);
     1160        J := Brains.Last;
     1161        while Assigned(J) and (AnsiCompareFileName(J.FileName, s) <> 0) do begin
     1162          K := PlayersBrain.IndexOf(J) - 1;
     1163          if K >= 0 then J := PlayersBrain[K]
     1164            else J := nil;
     1165        end;
     1166        if not Assigned(J) then
    11631167        begin // ai not found -- replace by local player
    11641168          ProcessClientData[p1] := false;
    11651169          NotifyMessage := s;
    11661170          Notify(ntAIError);
    1167           j := BrainTerm;
     1171          J := BrainTerm;
    11681172        end
    11691173        else
     
    11771181  end
    11781182  else
    1179     result := false;
    1180 
    1181   if result then
    1182   begin
     1183    Result := false;
     1184
     1185  if Result then begin
    11831186    CL := TCmdList.Create;
    11841187    CL.LoadFromFile(LogFile);
     
    11861189  LogFile.Free;
    11871190  if not result then
    1188     exit;
     1191    Exit;
    11891192
    11901193  Notify(ntStartDone);
  • trunk/LocalPlayer/CityScreen.pas

    r136 r149  
    756756    else
    757757    begin
    758       MakeRed(xProd + dxBar - 6, yProd + dyBar, wBar + 10, 38);
     758      MakeRed(xProd + dxBar - 6, yProd + dyBar + 17, wBar + 10, 38);
    759759      CountBar(offscreen, xProd + dxBar, yProd + dyBar + 16, wBar, 3,
    760760        Phrases.Lookup('LACK'), -Report.Production, RedTex);
Note: See TracChangeset for help on using the changeset viewer.