- Timestamp:
- Aug 12, 2024, 5:03:49 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GameServer.pas
r592 r604 393 393 end; 394 394 395 const 396 AutoSavePrefix = '~'; 397 395 398 function ToAutoSaveFileName(FileName: string): string; 396 399 begin 397 Result := ExtractFileDir(FileName) + DirectorySeparator + '~' + ExtractFileName(FileName); 400 if Copy(ExtractFileName(FileName), 1, 1) <> AutoSavePrefix then 401 Result := ExtractFileDir(FileName) + DirectorySeparator + AutoSavePrefix + ExtractFileName(FileName) 402 else Result := FileName; 403 end; 404 405 function FromAutoSaveFileName(FileName: string): string; 406 begin 407 if Copy(ExtractFileName(FileName), 1, 1) = AutoSavePrefix then 408 Result := ExtractFileDir(FileName) + DirectorySeparator + Copy(ExtractFileName(FileName), 2, MaxInt) 409 else Result := FileName; 398 410 end; 399 411 … … 401 413 begin 402 414 FileName := ExtractFileName(FileName); 403 Result := (Length(FileName) > 0) and (FileName[1] = '~');415 Result := (Length(FileName) > 0) and (FileName[1] = AutoSavePrefix); 404 416 end; 405 417 … … 1250 1262 NoLogCityTileChanges; 1251 1263 if IsAutoSaveFileName(LogFileName) then begin 1252 Delete(LogFileName, 1, 1);1264 LogFileName := FromAutoSaveFileName(LogFileName); 1253 1265 nLogOpened := -1; 1254 1266 end
Note:
See TracChangeset
for help on using the changeset viewer.