Changeset 192 for trunk/GameServer.pas
- Timestamp:
- May 7, 2020, 12:30:04 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GameServer.pas
r185 r192 122 122 Directories, CityProcessing, UnitProcessing, CmdList, LCLIntf, LCLType, 123 123 LMessages, Classes, SysUtils; 124 125 resourcestring 126 SNoAiFound = 'No AI libraries found in directory %s'; 124 127 125 128 var … … 256 259 BrainBeginner := nil; 257 260 258 if FindFirst( HomeDir + 'AI'+ DirectorySeparator + '*', faDirectory or faArchive or faReadOnly, f) = 0 then261 if FindFirst(GetAiDir + DirectorySeparator + '*', faDirectory or faArchive or faReadOnly, f) = 0 then 259 262 repeat 260 BasePath := HomeDir + 'AI'+ DirectorySeparator + f.Name;263 BasePath := GetAiDir + DirectorySeparator + f.Name; 261 264 if (f.Name <> '.') and (f.Name <> '..') and DirectoryExists(BasePath) then begin 262 265 NewBrain := Brains.AddNew; … … 272 275 273 276 if Brains.GetKindCount(btAI) = 0 then 274 raise Exception.Create(Format( 'No AI libraries found in directory %s', [HomeDir + 'AI']));277 raise Exception.Create(Format(SNoAiFound, [GetAiDir])); 275 278 end; 276 279 … … 4584 4587 constructor TBrain.Create; 4585 4588 begin 4586 Picture := nil; 4589 Picture := TBitmap.Create; 4590 Picture.SetSize(64, 64); 4587 4591 end; 4588 4592 4589 4593 destructor TBrain.Destroy; 4590 4594 begin 4591 if Assigned(Picture) then Picture.Free;4595 FreeAndNil(Picture); 4592 4596 inherited Destroy; 4593 4597 end;
Note:
See TracChangeset
for help on using the changeset viewer.