Skip to content

Commit bbd5568

Browse files
committed
Fix ped randomizer crash on 1.0.3411.0
1 parent 5239d42 commit bbd5568

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/peds/peds_PlayerFixes.hh

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "CModelInfo.hh"
77
#include "ParserUtils.hh"
8+
#include "common/minhook.hh"
89
#include "mission/missions_YscUtils.hh"
910
#include "peds_Compatibility.hh"
1011

@@ -210,13 +211,10 @@ public:
210211
// Hook to reset the saved player model during saving to make sure
211212
// you don't get a random player on loading without Rainbomizer and
212213
// (more importantly) to prevent softlocks and crashes this causes.
213-
// Pattern from Robot (don't insert u word here)
214-
REGISTER_JMP_HOOK (12,
215-
"? 89 5c ? ? 55 56 57 41 54 41 55 41 56 41 57 ? 8d "
216-
"? ? d9 ? 81 ec 90 00 00 00 ? 8b ? ? ? ? ? 33 f6 ? "
217-
"8b f1 ? 8b ? ? ? 85 ff 0f 84 ? ? ? ? ? 8b",
218-
0, FixSavedPlayerModel, void,
219-
CPlayerPedSaveStructure *);
214+
// Pattern from Parik (don't insert u word here)
215+
REGISTER_MH_HOOK_BRANCH (
216+
"89 ? c8 00 00 00 eb ? ? 8b ? ? 8b c8 ? 89 ? e8 ? ? ? ? ", 17,
217+
FixSavedPlayerModel, void, CPlayerPedSaveStructure *);
220218

221219
// This patch enables phone models for all ped models
222220
injector::MakeNOP (

0 commit comments

Comments
 (0)