Skip to content

Commit

Permalink
feat(Era): Update Era source code to 3.9.10. Commit: 9ddfbbf
Browse files Browse the repository at this point in the history
Signed-off-by: VuceticBranislav <24853106+VuceticBranislav@users.noreply.github.com>
  • Loading branch information
VuceticBranislav committed Jan 4, 2024
1 parent 651128f commit 06a6eb8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
19 changes: 17 additions & 2 deletions Era/Triggers.pas
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(***) interface (***)
uses
Windows, SysUtils, UtilsB2,
Core, PatchApi, GameExt, Heroes, ApiJack, Erm, EventMan, Legacy;
Core, PatchApi, GameExt, Heroes, ApiJack, Erm, EventMan, DlgMes, Legacy;

const
NO_STACK = -1;
Expand Down Expand Up @@ -349,7 +349,10 @@ procedure Hook_MainGameLoop (h: PatchApi.THiHook; This: pointer); stdcall;
end;

PatchApi.Call(PatchApi.THISCALL_, h.GetDefaultFunc(), [This]);
Dec(MainGameLoopDepth);

if MainGameLoopDepth > 0 then begin
Dec(MainGameLoopDepth);
end;

if MainGameLoopDepth = 0 then begin
Erm.FireErmEvent(Erm.TRIGGER_ONGAMELEAVE);
Expand Down Expand Up @@ -726,7 +729,18 @@ function Hook_AfterHeroGainLevel (Context: ApiJack.PHookContext): longbool; stdc
procedure OnGameLeave (Event: GameExt.PEvent); stdcall;
begin
GameExt.SetMapDir('');

// Fix incompatibilities with older HD mod versions
if MainGameLoopDepth <> 0 then begin
MainGameLoopDepth := 0;
Erm.FireErmEvent(Erm.TRIGGER_ONGAMELEAVE);
end;
end;

procedure OnAbnormalGameLeave (Event: GameExt.PEvent); stdcall;
begin
MainGameLoopDepth := 0;
Erm.FireErmEvent(Erm.TRIGGER_ONGAMELEAVE);
end;

procedure OnAfterWoG (Event: GameExt.PEvent); stdcall;
Expand Down Expand Up @@ -825,4 +839,5 @@ procedure OnAfterWoG (Event: GameExt.PEvent); stdcall;
begin
EventMan.GetInstance.On('OnAfterWoG', OnAfterWoG);
EventMan.GetInstance.On('OnGameLeave', OnGameLeave);
EventMan.GetInstance.On('OnAbnormalGameLeave', OnAbnormalGameLeave);
end.
2 changes: 1 addition & 1 deletion Era/VersionInfo.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VER_Major = 3;
VER_Minor = 9;
VER_Build = 9;
VER_Build = 10;
VER_Revision = 0;
VER_Sufix = '-port';

Expand Down
8 changes: 4 additions & 4 deletions Era/VersionInfo.rc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,9,9,0
PRODUCTVERSION 3,9,9,0
FILEVERSION 3,9,10,0
PRODUCTVERSION 3,9,10,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS (VER_PRIVATEBUILD | VER_PRERELEASE | VER_DEBUG)
FILEOS VOS_NT | VOS__WINDOWS32
Expand All @@ -25,8 +25,8 @@ BEGIN
BEGIN
BLOCK "000004E4"
BEGIN
VALUE "ProductVersion", "3.9.9.0\0"
VALUE "FileVersion", "3.9.9.0\0"
VALUE "ProductVersion", "3.9.10.0\0"
VALUE "FileVersion", "3.9.10.0\0"
VALUE "CompanyName", "BerSoft\0"
VALUE "FileDescription", "Era Project\0"
VALUE "InternalName", "\0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
Contains ERA and VFS projects as well as B2 library.<br/>
<br/></i>
Original commits containing code are from <a href="https://github.com/ethernidee">ethernidee</a> repositories:<br/>
ERA: <a href="https://github.com/ethernidee/era/tree/5de26a570aec9a4074af885b745d96820b464e7e"><strong>5de26a5</strong></a><br/>
ERA: <a href="https://github.com/ethernidee/era/tree/9ddfbbf2d1a59a87f8a80a468262878c3ecd0501"><strong>9ddfbbf</strong></a><br/>
VFS: <a href="https://github.com/ethernidee/vfs/tree/5e4a7f0acf1bdfa9eadb3f63c7177e8f0ccbf2e0"><strong>5e4a7f0</strong></a><br/>
B2: <a href="https://github.com/ethernidee/b2/tree/001251eb5f45378c329b6a60a4a4d87c346f36a0"><strong>001251e</strong></a>
</p>
Expand Down

0 comments on commit 06a6eb8

Please sign in to comment.