What happened?
When calling INVENTORY::_0xFD41D1D4350F6413, the native works correctly when the player is alone, but fails silently when another player is nearby.
After analyzing the decompiled shop_general.c script (func_775), the issue is that the flags field (f_6 of the struct passed to the native) gets blocking bits (4 and 8) set when:
func_773() returns true (detects another player nearby via tunable checks)
Global_1956123.f_1 is 0 (catalog not marked as "open")
This results in f_6 = 12 (bits 4 | 8), which causes the native to reject the inventory operation. The only bypass is if the item is in the shop's 20-item whitelist (Global_1915715.f_3[shopId].f_418[]), which resets f_6 to 0.
Expected result
The native INVENTORY::_0xFD41D1D4350F6413 should process the inventory operation regardless of whether another player is nearby, or at minimum provide an error/return value indicating why it was blocked.
Reproduction steps
- Join an online session and go to a shop
- Call INVENTORY::_0xFD41D1D4350F6413 with a valid item struct — it works
- Have another player stand near you (same shop area)
- Call the same native with the same parameters — it silently fails
Importancy
There's a workaround
Area(s)
RedM
Specific version(s)
Build 1491.50
Additional information
Root cause traced in decompiled script script_mp_rel/shop_general.c, function func_775 (lines 25242-25362).
The blocking logic chain:
- func_773() detects multiplayer context via tunable hashes
- Combined with !Global_1956123.f_1 (catalog not open), sets bVar35 = true
- This forces bVar37 = true → iVar32 |= 4 | 8 (blocking flags)
- Unless the item is in the shop whitelist (Global_1915715.f_3[shopId].f_418[0..19]), the flags remain and the native rejects the operation
Possible workarounds:
- Set Global_1956123.f_1 = 1 before calling the native
- Force f_6 = 0 in the struct before passing it to the native
- Add the item to the shop whitelist array
What happened?
When calling
INVENTORY::_0xFD41D1D4350F6413, the native works correctly when the player is alone, but fails silently when another player is nearby.After analyzing the decompiled
shop_general.cscript (func_775), the issue is that the flags field (f_6of the struct passed to the native) gets blocking bits (4 and 8) set when:func_773()returnstrue(detects another player nearby via tunable checks)Global_1956123.f_1is0(catalog not marked as "open")This results in
f_6 = 12(bits 4 | 8), which causes the native to reject the inventory operation. The only bypass is if the item is in the shop's 20-item whitelist (Global_1915715.f_3[shopId].f_418[]), which resetsf_6to0.Expected result
The native
INVENTORY::_0xFD41D1D4350F6413should process the inventory operation regardless of whether another player is nearby, or at minimum provide an error/return value indicating why it was blocked.Reproduction steps
Importancy
There's a workaround
Area(s)
RedM
Specific version(s)
Build 1491.50
Additional information
Root cause traced in decompiled script
script_mp_rel/shop_general.c, functionfunc_775(lines 25242-25362).The blocking logic chain:
Possible workarounds: