@@ -202,12 +202,18 @@ install_hook_name(HKAI_InitMapData, void, const char *mapname, char restart) {
202202 char physicsAltPath [0x200 ];
203203 snprintf (physicsPath , sizeof (physicsPath ), "Physics/%s_navmesh.hkt" , mapname );
204204 snprintf (physicsAltPath , sizeof (physicsAltPath ), Macfix_Path "/Physics/%s_navmesh.hkt" , mapname );
205- if (access (physicsPath , F_OK ) != 0 && access (physicsAltPath , F_OK ) != 0 ) {
205+
206+ // bees are broken on Demon Within - don't trust the original navmesh/navvolume
207+ bool shouldFixBees = strcmp (mapname , "cp_mi_cairo_infection2" ) == 0 ;
208+ if ((access (physicsPath , F_OK ) != 0 || (access (physicsPath , F_OK ) == 0 && shouldFixBees ))
209+ && access (physicsAltPath , F_OK ) != 0 ) {
206210 if (get_wine_path () == NULL )
207211 Com_Error (__FILE__ , __LINE__ , 2 , Error_Prefix "You do not have Wine installed, so we can't convert the map '^2%s^7'." , mapname );
208- char full_path [0x200 ];
209- build_usermods_path (mapname , ".ff" , 0x200 , full_path , 2 , (char * )(game_base_address + ADDR_g_workshopMapId ));
210- printf ("map fastfile is '%s'\n" , full_path );
212+ if (!shouldFixBees ) {
213+ char full_path [0x200 ];
214+ build_usermods_path (mapname , ".ff" , 0x200 , full_path , 2 , (char * )(game_base_address + ADDR_g_workshopMapId ));
215+ printf ("map fastfile is '%s'\n" , full_path );
216+ }
211217
212218 char xasset_path [0x200 ];
213219 snprintf (xasset_path , 0x200 , "maps/%s/%s_navmesh" , GetGamemodeString (), mapname );
@@ -378,11 +384,11 @@ void IOHIDDeviceUnscheduleFromRunLoop_new(IOHIDDeviceRef device, CFRunLoopRef ru
378384}
379385DYLD_INTERPOSE (IOHIDDeviceUnscheduleFromRunLoop_new , IOHIDDeviceUnscheduleFromRunLoop );
380386
381- // this will get called lots in SDL2.0.7's JoystickDeviceWasAddedCallback, so filter for PrimaryUsagePage
387+ // this will get called lots in SDL2.0.7's JoystickDeviceWasAddedCallback, so filter for PrimaryUsage
382388CFTypeRef IOHIDDeviceGetProperty_hook (IOHIDDeviceRef device , CFStringRef key )
383389{
384390 CFTypeRef orig = IOHIDDeviceGetProperty (device , key );
385- // that address is the CFString for PrimaryUsagePage
391+ // that address is the CFString for PrimaryUsage
386392 if (orig != NULL && key == (void * )(game_base_address + 0x1b8b420 ))
387393 {
388394 //printf("device = %p\n", device);
@@ -626,6 +632,10 @@ __attribute__((constructor)) static void dylib_main() {
626632 memset (curl_nops , 0x90 , sizeof (curl_nops ));
627633 DobbyCodePatch ((void * )(game_base_address + ADDR_Curl_ContentLengthSetStart ), curl_nops , sizeof (curl_nops ));
628634
635+ // replace the strcmp where HKAI_InitMapData checks to see if the map name is cp_mi_cairo_infection2
636+ uint8_t return_0 [] = { 0xB8 , 0 , 0 , 0 , 0 };
637+ DobbyCodePatch ((void * )(game_base_address + ADDR_HKAI_InitMapData_DemonWithinCheck ), return_0 , sizeof (return_0 ));
638+
629639 // patches the network version to match Windows
630640 network_version_patch ();
631641
0 commit comments