To not crash when i use SetPlayerModel on a freemode ped model with extra 5/7/15 [B2372/B2189/B1604] ymts assigned to it.
What actually happens
It crashes when you assign 5/7/15 [B2372/B2189/B1604] extra ymts to a freemode ped model and uses the SetPlayerModel native.
Category of bug (eg. client, server, weapons, peds, native)
Client/Peds
Reproducible steps, preferably with example script(s)
Start the repro resource according to your game build, and use the SetPlayerModel native with any GTA:O freemode ped (mp_m_freemode_01 or mp_f_freemode_01) to see the crash ocurring.
B1604: Limit of extra .ymts assigned to a freemode ped: 14 (15+ will crash) B2189: Limit of extra .ymts assigned to a freemode ped: 6 (7+ will crash) B2372: Limit of extra .ymts assigned to a freemode ped: 4 (5+ will crash)
Crash hashes for each game build: B1604: oven-happy-sad || GTA5.exe!sub_1406B14FC (0xf) B2189: earth-august-saturn || FiveM_b2189_GTAProcess.exe!sub_1406D21B0 (0xf) B2372: yellow-stairway-december || FiveM_b2372_GTAProcess.exe!sub_14070E7A8 (0xf)
Even mp_creaturesmetadata ymts will count on this crash, thats why on B2189 the limit has decreased in 8 units, due to the addition of mpvinewood, mpheist3, mpsummer & mpheist4 (each one adding 2 ymts).
And in the B2372, the limit has decreased in 2 units (in comparison to the B2189) due to the mptuner addition.
B1604 has that limit too, but it’s pretty higher than B2189. Today i hit the crash with 15 addon clothes packs, while B2189 it’s occur when i hit 7 or more. So it’s not related only to B2189.
Log on B1604:
InvokeNative: execution failed: Error executing native 0x00a1cadd00108836 at address 0x1407a0b54.
SCRIPT ERROR: Execution of native 00a1cadd00108836 in script host failed: Error executing native 0x00a1cadd00108836 at address 0x1407a0b54.^7
SetPlayerModel^7 (^5SetPlayerModel.lua^7:7)
The crash is not related to the amount of Clothes packs loaded. It’s related to the amount of .ymts assigned to a ped model. Even mp_creaturesmetadata ymts will cause that crash.
It’s not related only to B2189, it’s can happen too on B1604. The difference is: On newer builds, the amount of ymts already assigned to MP Peds are higher than in older builds. For example: Cayo Perico Build has 8 more ymts assigned to every MP Ped than B1604 (4 CPedVariationInfo & 4 CCreatureMetaData) due to the last 4 DLCs added into the game (Diamond Casino, Casino Heist, Summer & Cayo Perico). So, i added a new repro resource to B1604 too.
Appears to be a case of rage::fwMetaDataStore (.#mt streaming module) not having loaded some specific requested metadata file, but the game assuming it would have.
Might just be a maximum size in some request list.
… oh, no, don’t say this is fwArchetypeStreamingModule::GetDependencies (overridden as CModelInfoStreamingModule) ending up with a maximum amount? This metadata store entry is also used from the resource-paged-in callback in CPedModelInfo, so that’d imply this metadata has to be loaded before the MI is loaded…
Correct. A CPedModelInfo gets some long list of .#mt files added as dependency before streaming in, and despite Rockstar’s best efforts to pass a limit of 80 (direct and indirect?) dependencies to this fetch in rage::strRequestMgr::RequestObject, I guess that’s… not enough.
Not sure if this is trivial to fix, stack-allocated bits and I’m really not feeling like having a function with this many downstream dependencies change its stack frame size leading to exception handling getting really confused.
Thanks. I tested it on B1604 and it’s working nicely.
One question: Is this fix supposed to be working on B2189 too? I tested both builds, and the game still crashing on B2189, but now with a different crash than the previous reported one:
Yeah, really seems. I tested the previous repro resource to B2189 and it is not causing that new crash. I’m looking into it to know what is causing it to provide a new repro resource for that.
This repro resource to B1604 is now triggering that new crash on B2189. (Difference between those repro resources: The B1604 one has more .ymts & .metas than the B2189).
Hi, could you make this FIX again? Since we are also having this issue, and now when we join our server, we get instant crash. I dont think this one issue could be the one that making other crash? We tested it on canary version of FiveM and did not have any issues. Thank you.