Skip to content

Commit

Permalink
MM6Patch v2.5.7:
Browse files Browse the repository at this point in the history
[*] Support (i.e. no problems like crashes) for old saves with inconsequential incorrect data caused by my bug fixed in the previous version.
  • Loading branch information
GrayFace committed Mar 4, 2022
1 parent 0360145 commit 5d95fa3
Show file tree
Hide file tree
Showing 12 changed files with 2,687 additions and 2,652 deletions.
5,282 changes: 2,641 additions & 2,641 deletions MMPatches/Install/MM6patch.map

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion MMPatches/Install/MM6patch/Files/MM6Patch ReadMe.TXT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GrayFace MM6 Patch v2.5.6
GrayFace MM6 Patch v2.5.7
By Sergey Rozhenko <mailto:sergroj@mail.ru>
https://grayface.github.io/

Expand All @@ -11,6 +11,10 @@ At the end of ReadMe you'll find info on how to report errors.

([+] - feature, [-] - fixed bug, [*] - other)

New in version 2.5.7:
<< MM6 - MM8 >>
[*] Support (i.e. no problems like crashes) for old saves with inconsequential incorrect data caused by my bug fixed in the previous version.

New in version 2.5.6:
<< MM6 - MM8 >>
[+] New command available to map scripts (*.evt) that powers some of the MM6 and MM7 changes of this version (code 0x45 - RefundChestArtifacts).
Expand Down
Binary file modified MMPatches/Install/MM6patch/Files/MM6patch.dll
Binary file not shown.
6 changes: 5 additions & 1 deletion MMPatches/Install/MM6patchBuka/Files/MM6Patch ReadMe_rus.TXT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GrayFace MM6 Patch v2.5.6
GrayFace MM6 Patch v2.5.7
�����: ������ ������� <mailto:sergroj@mail.ru>
https://grayface.github.io/ru/
������� ����� ReadMe �� �������: Black Phantom <mailto:mm6789@yandex.ru>
Expand All @@ -10,6 +10,10 @@ https://grayface.github.io/ru/

([+] - ����, [-] - ������������ ���, [*] - ������)

��������� ������ 2.5.7:
<< MM6 - MM8 >>
[*] ��������� ���������� � ��������� �������, ���������� ���� �����, ������������ � ���������� ������. ������ ��� ������ ����� �� �� ��� �� ������.

��������� ������ 2.5.6:
<< MM6 - MM8 >>
[+] ����� �������, ��������� ��� �������� ���� (*.evt), ������� ��������� ������� ��������� ��������� ����� � MM6 � MM7 (��� 0x45 - RefundChestArtifacts).
Expand Down
Binary file modified MMPatches/Install/MM6patchBuka/Files/MM6patch.dll
Binary file not shown.
Binary file modified MMPatches/Install/MM6patchLoc/Files/MM6patch.dll
Binary file not shown.
6 changes: 5 additions & 1 deletion MMPatches/Install/MM6patchLoc/eng/MM6Patch ReadMe.TXT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GrayFace MM6 Patch v2.5.6
GrayFace MM6 Patch v2.5.7
By Sergey Rozhenko <mailto:sergroj@mail.ru>
https://grayface.github.io/

Expand All @@ -11,6 +11,10 @@ At the end of ReadMe you'll find info on how to report errors.

([+] - feature, [-] - fixed bug, [*] - other)

New in version 2.5.7:
<< MM6 - MM8 >>
[*] Support (i.e. no problems like crashes) for old saves with inconsequential incorrect data caused by my bug fixed in the previous version.

New in version 2.5.6:
<< MM6 - MM8 >>
[+] New command available to map scripts (*.evt) that powers some of the MM6 and MM7 changes of this version (code 0x45 - RefundChestArtifacts).
Expand Down
6 changes: 5 additions & 1 deletion MMPatches/Install/MM6patchLoc/rus/MM6Patch ReadMe_rus.TXT
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GrayFace MM6 Patch v2.5.6
GrayFace MM6 Patch v2.5.7
�����: ������ ������� <mailto:sergroj@mail.ru>
https://grayface.github.io/ru/
������� ����� ReadMe �� �������: Black Phantom <mailto:mm6789@yandex.ru>
Expand All @@ -10,6 +10,10 @@ https://grayface.github.io/ru/

([+] - ����, [-] - ������������ ���, [*] - ������)

��������� ������ 2.5.7:
<< MM6 - MM8 >>
[*] ��������� ���������� � ��������� �������, ���������� ���� �����, ������������ � ���������� ������. ������ ��� ������ ����� �� �� ��� �� ������.

��������� ������ 2.5.6:
<< MM6 - MM8 >>
[+] ����� �������, ��������� ��� �������� ���� (*.evt), ������� ��������� ������� ��������� ��������� ����� � MM6 � MM7 (��� 0x45 - RefundChestArtifacts).
Expand Down
4 changes: 4 additions & 0 deletions MMPatches/MM6Patch/MM6patch.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ Version 2.5.6:
[-] My bug: DisableHooks option wasn't working for some hooks
[-] My bug: With custom *.games.lod archives incorrect data was written to autosave on New Game start
Version 2.5.7:
(MM6-MM8)
[*] No more crashes when playing saves with incorrect data from pre-2.5.6 bug in custom *.games.lod support
Åñëè çàãðóçèòü ñåéâ, ãäå âñå ðîæè îäèíàêîâûå, à ïîòîì ñåéâ ñ ðàçíûìè, áóäóò ÷åðíûå ïÿòíà íà ìåñòå ðîæ
Expand Down
Binary file modified MMPatches/MM6Patch/MM6patch.res
Binary file not shown.
4 changes: 4 additions & 0 deletions MMPatches/MMCommon/MMCommon.pas
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ interface
hqDontSkipSimpleMessage = 88;
hqFixItemDuplicates = 89;
hqFixClubsGeneration = 90;
hqFixAcidBurst = 91;

{$IFDEF mm6}
m6 = 1;
Expand Down Expand Up @@ -191,6 +192,7 @@ interface
DontSkipSimpleMessage: LongBool; // (unused in MM8)
FixItemDuplicates: LongBool; //
FixClubsGeneration: LongBool; // (MM8 only)
FixAcidBurst: LongBool; // (unused in MM6)
end;

var
Expand Down Expand Up @@ -700,6 +702,7 @@ TSpellBuff = record
_malloc: function(size:int):ptr cdecl = ptr(m6*$4AE753 + m7*$4CADC2 + m8*$4D9F62);
_new: function(size:int):ptr cdecl = ptr(m6*$4AEBA5 + m7*$4CB06B + m8*$4D9E0B);
_free: procedure(p:ptr) cdecl = ptr(m6*$4AE724 + m7*$4CAEFC + m8*$4DA09C);
_strcmpi: function(s1, s2: PChar): int cdecl = ptr(m6*$4AF370 + m7*$4CAAF0 + m8*$4DA920);
_ProcessActions: TProcedure = ptr(m6*$42ADA0 + m7*$4304D6 + m8*$42EDD8);
_LoadBitmap: function(_, __, this: int; pal: {$IFNDEF mm8}int{$ELSE}int64{$ENDIF}; name: PChar): int = ptr(m6*$40B430 + m7*$40FB2C + m8*$410D70);
_DrawBmpTrans: procedure(_, __, screen: int; bmp:{$IFNDEF mm8}uint{$ELSE}uint64{$ENDIF}; y, x: int) = ptr(m7*$4A6204 + m8*$4A419B);
Expand Down Expand Up @@ -1245,6 +1248,7 @@ procedure LoadIni;
FixSouldrinker:= ReadBool('FixSouldrinker', true, false);
FixClubsDelay:= ReadBool('FixClubsDelay', true, false);
ClimbBetter:= ReadBool('ClimbBetter', true, false);
FixAcidBurst:= ReadBool('FixAcidBurst', true, false);
{$ENDIF}
FixHouseAnimationRestart:= ReadBool('FixHouseAnimationRestart', true, false);
info:= 'Makes right mouse button act as Esc in houses, NPC, map entrance and message dialogs';
Expand Down
25 changes: 18 additions & 7 deletions MMPatches/MMCommon/MMHooks.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1457,8 +1457,11 @@ procedure UnmarkChestArtifacts(a: PChest);
// inc(Result);
//end;

procedure RefillAnyProc(buf: pchar);
procedure RefillAnyProc(buf: pchar; skip: int);
begin
if pint(buf - 4 - 32*(1 - m6))^ = 0 then
exit; // never visited before
inc(buf, skip);
if m6 = 0 then
inc(buf, _SpritesCount^*2);
inc(buf, 4 + pint(buf)^*_MonOff_Size);
Expand All @@ -1470,17 +1473,15 @@ procedure RefillAnyProc(buf: pchar);

procedure RefillBlvProc(buf: pchar);
begin
inc(buf, _VisibleOutlinesSize^ + (1 - m6)*_IndoorFacetsCount^*4);
RefillAnyProc(buf);
RefillAnyProc(buf, _VisibleOutlinesSize^ + (1 - m6)*_IndoorFacetsCount^*4);
end;

var
OdmFacetBitsCount: int;

procedure RefillOdmProc(buf: pchar);
begin
inc(buf, 968*2 + OdmFacetBitsCount*4);
RefillAnyProc(buf);
RefillAnyProc(buf, 968*2 + OdmFacetBitsCount*4);
end;

procedure RefillBlvHook;
Expand Down Expand Up @@ -3514,9 +3515,17 @@ procedure FixSouldrinkerHook;
//----- Acid Burst doing physical damage

procedure FixAcidBurst;
const
sNone: PChar = 'none';
asm
cmp dword ptr [esp + $24 - 8], 29
jnz @std
push esi
push sNone
call _strcmpi
add esp, 8
test eax, eax
jnz @std
mov byte ptr [edi], 2
@std:
end;
Expand Down Expand Up @@ -4387,7 +4396,7 @@ procedure ReadGamesFileHook;
(p: $40570B; newp: @FixShrapmetal; t: RShtBefore; Querry: hqFixMonsterSpells), // Fix monsters' Shrapmetal spread
(p: $47BB77; newp: @FixSpritesWrapAround; t: RShtBefore; size: 7), // Don't show sprites from another side of the map with increased FOV
(p: $42E4F0; old: $43642D; newp: @FixSouldrinkerHook; t: RShtCall; Querry: hqFixSouldrinker), // Souldrinker was hitting monsters beyond party range
(p: $453A31; old: $453AE6; newp: @FixAcidBurst; t: RShtBeforeJmp6), // Acid Burst doing physical damage
(p: $453A31; old: $453AE6; newp: @FixAcidBurst; t: RShtBeforeJmp6; Querry: hqFixAcidBurst), // Acid Burst doing physical damage
(p: $404B02; newp: @FixMonSpellCast; t: RShtBefore), // Spells that couldn't be cast by monsters before
(p: $468FCF; newp: @EquipOnSpearHook; t: RShtAfter; size: 6), // Unable to equip sword or dagger when non-master spear is equipped
(p: $469037; size: $469041 - $469037), // Unable to equip sword or dagger when non-master spear is equipped
Expand Down Expand Up @@ -4532,7 +4541,7 @@ procedure ReadGamesFileHook;
(p: $40531F; newp: @FixShrapmetal; t: RShtBefore; size: 8; Querry: hqFixMonsterSpells), // Fix Shrapmetal spread
(p: $47AE66; newp: @FixSpritesWrapAround; t: RShtBefore; size: 7), // Don't show sprites from another side of the map with increased FOV
(p: $42C730; old: $433D70; newp: @FixSouldrinkerHook; t: RShtCall; Querry: hqFixSouldrinker), // Souldrinker was hitting monsters beyond party range
(p: $45119B; old: $451250; newp: @FixAcidBurst; t: RShtBeforeJmp6), // Acid Burst doing physical damage
(p: $45119B; old: $451250; newp: @FixAcidBurst; t: RShtBeforeJmp6; Querry: hqFixAcidBurst), // Acid Burst doing physical damage
(p: $467453; newp: @EquipOnSpearHook; t: RShtAfter; size: 6), // Unable to equip sword or dagger when non-master spear is equipped
(p: $4674BB; size: $4674C5 - $4674BB), // Unable to equip sword or dagger when non-master spear is equipped
(p: $40EFC3; newp: @FixArcomage; t: RShtAfter; size: 6), // Fix Arcomage hanging
Expand Down Expand Up @@ -4644,6 +4653,8 @@ procedure ApplyMMDeferredHooks;
ApplyHooks(hqDontSkipSimpleMessage);
if Options.FixItemDuplicates then
ApplyHooks(hqFixItemDuplicates);
if Options.FixAcidBurst then
ApplyHooks(hqFixAcidBurst);
end;

procedure ApplyMMHooksSW;
Expand Down

0 comments on commit 5d95fa3

Please sign in to comment.