Skip to content

Commit 4e281de

Browse files
committed
Fix ladder fix crash
1 parent c07e90d commit 4e281de

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/peds/peds_AnimalFixes.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,14 @@ PedRandomizer_AnimalFixes::FixLadderClimbAsAnimal ()
109109
0x66, 0x0f, 0x6e, 0xc0 // movd xmm0,eax
110110
};
111111

112-
void *ptr = hook::get_pattern (
112+
auto pattern = hook::pattern (
113113
"f3 0f 10 40 64 8a 42 0c fe c8 3c 01 0f 96 ? f6 d9 ? 1b c0 ? 23 c2 "
114114
"f3 0f 5c 40 40 f3 0f 58 f8 ");
115+
116+
if (pattern.size())
117+
return;
118+
119+
void* ptr = pattern.get_first();
115120
injector::MakeNOP (ptr, 28);
116121
injector::WriteMemoryRaw (ptr, xmm0_0p57, sizeof (xmm0_0p57), true);
117122
}

0 commit comments

Comments
 (0)