@@ -741,8 +741,6 @@ int Com_sprintf_Hook(char *dest, unsigned int size, const char *fmt...)
741741 char *dst = dest + 5 ; // after "maps/"
742742 const char *src = dest + 8 ; // after "maps/mp/"
743743 memmove (dst, src, strlen (src) + 1 );
744-
745- DbgPrint (" Rewrote BSP path to %s\n " , dest);
746744 }
747745 }
748746
@@ -759,9 +757,6 @@ int Com_sprintf_Hook(char *dest, unsigned int size, const char *fmt...)
759757 const char *src = dest + 8 ; // after "maps/mp/"
760758 memmove (dst, src, strlen (src) + 1 );
761759 }
762-
763- DbgPrint (" Com_sprintf_Hook <- GScr_LoadLevelScript\n " );
764- DbgPrint (" %s\n " , dest);
765760 }
766761
767762 return result;
@@ -771,6 +766,7 @@ Detour Load_XAssetArrayCustom_Detour;
771766void Load_XAssetArrayCustom_Stub (int count)
772767{
773768 // Load the entire XAsset array
769+ // This ensures that the stream position is correct even if we are loading less assets later.
774770 Load_Stream (1 , *varXAsset, 8 * count);
775771
776772 // Override the count if needed AFTER progressing the stream correctly on asset list
@@ -877,8 +873,6 @@ void DB_LoadXFileInternal_Stub()
877873 g_load->stream .next_in += sizeof (fileVersion);
878874 g_load->stream .avail_in -= sizeof (fileVersion);
879875
880- DbgPrint (" fileVersion: %d\n " , fileVersion);
881-
882876 const std::uint32_t expectedFastfileVersion = 1 ;
883877
884878 if (fileVersion != expectedFastfileVersion)
@@ -951,11 +945,8 @@ void DB_LoadXFileInternal_Stub()
951945
952946 unsigned int alignedPos = (reinterpret_cast <std::uintptr_t >(*g_streamPos) + 3u ) & ~std::uintptr_t (3u );
953947 *g_streamPos = reinterpret_cast <std::uint8_t *>(alignedPos);
954-
955948 *varXAsset = reinterpret_cast <XAsset *>(*g_streamPos);
956-
957949 (*varXAssetList)->assets = *varXAsset;
958-
959950 Load_XAssetArrayCustom (assetCount);
960951 }
961952
0 commit comments