altmp / altv-issues

Issues and roadmap for alt:V project
93 stars 16 forks source link

Client crash when having 32+ props attached to ped in first person #796

Closed Hardy535 closed 3 years ago

Hardy535 commented 3 years ago

Client/server version 3.0-rc2 (server and client)

Current behavior The game crashes, probably there is a limit of 32 in GTA for that?

Expected behavior Do not crash :)

Steps to reproduce Attach 33 or more props to the player and change the camera to first person. There will be no problems when using the close, mid or far camera, only first person crashes it. Simple example to reproduce the crash:

for (let i = 0; i < 33; i++) {
    let playerScriptID = alt.Player.local.scriptID;
    let pos = alt.Player.local.pos;
    let prop = game.createObject(game.getHashKey("prop_golf_ball"), pos.x, pos.y, pos.z, false, false, true);

    // Attach prop to bone "SKEL_R_Hand" of player (bone doesn't matter for this crash)
    game.attachEntityToEntity(prop, playerScriptID, game.getPedBoneIndex(playerScriptID, 57005), 0, 0, i, 0, 0, 0, true, true, false, true, 1, true);
}

Context (environment) We are attaching props to the player like weapons objects, objects holding in hand, etc. with our own prop sync. Sometimes 32 props are just not enough and in that case the game will crash when going into first person.

Possible solution If it's a pool or a limit maybe increase it from 32 to like 128?

Crash dump altv_3.0-rc2_Social Club_0x1641c51_07-01-2021_14-15-28.zip

tastydev commented 3 years ago

can confirm, game is also crashing on clean gamemode with this code snippet as soon as u go into first person altv_2.2-dev12_Steam_0x16448ad_07-01-2021_23-25-42.zip

martonp96 commented 3 years ago

I checked this, seems like the 32 is hardcoded and it's not a pool to just increase easily. (fwAltSkeletonExtension fails to add in FirstPersonProp update)

martonp96 commented 3 years ago

fixed in dev

C0kkie commented 3 years ago

It causes problems, will be disabled for now