library ErrataGE; {$mode objfpc}{$H+} {$R *.res} uses Classes { you can add units after this } , uHCDefines , uHCGCI, uHCGlobals, uHCTypeDefs, uHCEventHelpers, uHCDateTime , uHCAnnexDefs, uHCAnnexHelpers, uLazGUIGlobals, uHCUtils , Windows, ShellAPI, SysUtils ; const DLLVERN = 1; DLLVERINTN = 43; var gPHarpEventHead: PHCHarpoonEvent; gPStartGroup: PHCGroup; {*** Return DLL internal version, i.e. revision 5 of my DLL ***} function DLLVer():word;export;cdecl; begin result := DLLVERN; end; {*** Return DLL interface version, i.e. revision 1 of my HCE interface spec ***} function DLLVerInt():word;export;cdecl; begin result := DLLVERINTN; end; {*** Return DLL description, 255 characters max ***} function DLLDesc():PAnsiChar;export;cdecl; begin result := 'perform corrrective tasks within GE at game start by Don Thomas'; end; {*** Free DLL ***} procedure DLLFree();export;cdecl; begin // Do any cleanup here, this is the end end; {*** Init DLL ***} procedure DLLInit(hwndHC: HWND; pathHC: PAnsiChar; verHC: PAnsiChar; verSaveGame: LongWord; funcRefs: PHCDLL_FUNC_REF; PGEClosing: Pointer; PDLLBusy: Pointer; verInterface: LongWord; srandSeed: longword; harpoon_uuid_session: PAnsiChar; hclicense_dt_expire: Int64; hclicense_licensee: PAnsiChar; usblicense_desc: PAnsiChar; RESRSRStructureVersion: ulong; AnnexVersion: ushort; GameComponent: uchar; pLosTable: PHCLosTable);export;cdecl; begin uLazGUIGlobals.PDLLBusy:=PDLLBusy; end; procedure HarpoonEventHead(HarpEventHead: PHCHarpoonEvent);export;cdecl; begin gPHarpEventHead:= HarpEventHead; end; procedure StartGroup(StartGroup: PHCGroup);export;cdecl; begin gPStartGroup:= StartGroup; end; procedure ScenLoaded(intWhichRound: Long); export; cdecl; var lPEvent: PHCHarpoonEvent; lPEventUnit: PHCUnit; // could count corrections and post to staff messages?? begin if intWhichRound = SCENLOADED_EXPORTDLLS_DONE then // all systems are go, dlls are loaded, scenario is loaded begin // 250711 repair formation and airPat mismatch groups Byte(PDLLBusy^):= CTRUE; // lPEvent := gPHarpEventHead; while (lPEvent <> nil) do begin if (lPEvent^.unit_uuid <> '') then // there's an event unit begin lPEventUnit:= HCuuid2UnitPtr(lPEvent^.unit_uuid, gPStartGroup, lPEvent^.ourGroup); if lPEventUnit <> nil then // there's a valid event unit begin if (lPEvent^.ourGroup <> lPEventUnit^.Group) then // there's a mismatch with event and unit groups assume unit group is correct lPEvent^.ourGroup:= lPEventUnit^.Group; end else // there is a nil unit - usually a air-patrol unit was split off but event wasn't updated begin lPEvent^.unit_uuid:= ''; end; end; // there was an event with unit-uuid otherwise do nothing lPEvent := lPEvent^.next; end; /// Byte(PDLLBusy^):= CFALSE; end; // ended check for bad air patrol and formation event unit assignment end; exports DLLVer, DLLVerInt, DLLDesc, DLLFree, DLLInit, //ScenLoad, //MsgLog, StartGroup, HarpoonEventHead, //UnitTop, ScenLoaded ; end.