File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed
Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -601,9 +601,11 @@ _Init_Game_Check_Spawn_Arg_No_Intro:
601601
602602_HouseClass__Make_Ally_STFU_when_Allying_In_Loading_Screen_Spawner:
603603 cmp byte [ IsDoingAlliancesSpawner ], 1
604- jz 0x004BDE68
605- test al , al ; hooked by patch
606- jz 0x4BDE68
604+ je 0x004BDE68
605+ cmp byte [ AlliesAllowed ], 0
606+ je 0x004BDE68
607+ test al , al ; fix code that our jump-to-hook destroyed
608+ jz 0x004BDE68
607609 jmp 0x004BDDB9
608610
609611_SessionClass__Free_Scenario_Descriptions_RETN_Patch:
Original file line number Diff line number Diff line change @@ -161,6 +161,8 @@ hack 0x0061913B ; Extend trigger action jump table
161161 jz .Remove_Attached_Objects_Action
162162 cmp edx , 115
163163 jz .Assign_Mission_To_All_Units_Action
164+ cmp edx , 116
165+ jz .Make_Ally_One_Sided_Action
164166
165167 cmp edx , 68h
166168 ja 0x0061A9C5 ; default
@@ -419,3 +421,24 @@ hack 0x0061913B ; Extend trigger action jump table
419421 jl .AM_Loop_MainBody
420422 jmp 0x00619F9F ; success
421423
424+
425+
426+ ; ***********************************
427+ ; *** Make Ally (One-Sided) ***
428+ ; ***********************************
429+ .Make_Ally_One_Sided_Action:
430+ mov ecx , [ esi + 40h ] ; Fetch first parameter
431+ cmp ecx , 0FFFFFFFFh
432+ jz 0x00619F9F ; success
433+ call 0x004C4730 ; HouseClass::As_Pointer(HousesType)
434+ mov ecx , [ esp + 1C4h ] ; Fetch owning house from trigger data
435+ push eax
436+ ; We need to increment ScenarioInit to allow houses to ally even if they would be the "last enemies" to each other in multiplayer
437+ mov edi , [ ScenarioInit ]
438+ inc edi
439+ mov [ ScenarioInit ], edi
440+ call 0x004BDB50 ; HouseClass::Make_Ally(HouseClass *)
441+ mov edi , [ ScenarioInit ]
442+ dec edi
443+ mov [ ScenarioInit ], edi
444+ jmp 0x00619F9F ; success
You can’t perform that action at this time.
0 commit comments