Changeset 370 for trunk/Core.pas


Ignore:
Timestamp:
Jan 2, 2025, 4:56:18 PM (4 days ago)
Author:
chronos
Message:
  • Fixed: Game systems were not loaded correctly due to wrong relative path inside flatpak.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Core.pas

    r365 r370  
    524524{$ENDIF}
    525525begin
    526   GameFilesDir := '';
     526  GameFilesDir := ExtractFilePath(ParamStr(0));
    527527  {$IFDEF Linux}
    528528  // If installed in Linux system then use installation shared game directory for data files
     
    817817
    818818procedure TCore.Init;
     819var
     820  GameSystem: TGameSystem;
    819821begin
    820822  if not Core.Initialized then begin
     
    828830    // GameSystemName needs to be loaded before game systems config itself.
    829831    // Players reference Nations from game system.
    830     GameSettings.GameSystem.Assign(GameSystems.SearchByName(string(XMLConfig1.GetValue(DOMString('Game/GameSystemName'), DOMString('HexWars')))));
     832    GameSystem := GameSystems.SearchByName(string(XMLConfig1.GetValue(DOMString('Game/GameSystemName'), DOMString('HexWars'))));
     833    if Assigned(GameSystem) then GameSettings.GameSystem.Assign(GameSystem);
    831834    GameSettings.LoadConfig(XMLConfig1, 'Game');
    832835    Server.LoadConfig(XMLConfig1, 'Server');
Note: See TracChangeset for help on using the changeset viewer.