Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on entity wipe #2344

Open
ScrachStack opened this issue Jan 16, 2024 · 5 comments
Open

Crash on entity wipe #2344

ScrachStack opened this issue Jan 16, 2024 · 5 comments
Assignees
Labels
bug crash RedM Issues/PRs related to RedM triage Needs a preliminary assessment to determine the urgency and required action

Comments

@ScrachStack
Copy link

What happened?

RegisterCommand("entitywipe", function()
    local playerPed = cache.ped
    local playerCoords = GetEntityCoords(playerPed)

    local radius = 20.0 

    local entityPool = GetGamePool('CPed')
    for i = 1, #entityPool do
        local distance = #(GetEntityCoords(entityPool[i]) - playerCoords)

        if distance < radius then
                DeleteEntity(entityPool[i])
            
        end
    end

    RedTrainer.Notify("Entity Wipe", "20.0 Radius Wiped.", 'info')
end, true)
``` this code causes a crash

### Expected result

entity should have wiped

### Reproduction steps

run command above

### Importancy

Crash

### Area(s)

RedM

### Specific version(s)

REDM GAME BUILD 1491 LATEST artifacts AS OF 1/16/2024

### Additional information

![image](https://github.com/citizenfx/fivem/assets/122732007/ebeacfa9-881f-4c3b-ae12-9832e043dee7)
[CfxCrashDump_2024_01_16_18_06_23.zip](https://github.com/citizenfx/fivem/files/13954192/CfxCrashDump_2024_01_16_18_06_23.zip)
@ScrachStack ScrachStack added bug triage Needs a preliminary assessment to determine the urgency and required action labels Jan 16, 2024
@github-actions github-actions bot added crash RedM Issues/PRs related to RedM labels Jan 16, 2024
@blattersturm
Copy link
Contributor

blattersturm commented Jan 16, 2024

I suppose RedM doesn't have an equivalent to this FiveM patch that prevents deleting the local player ped, as that would crash the game:

static void deletePed(fwEntity* entity)
{
if (*g_pedFactory && (*g_pedFactory)->localPlayerPed == entity)
{
return;
}
return deletePedReal(entity);
}

@ScrachStack
Copy link
Author

yea thats why I made this cause if you delete entity in fivem the entity just disappears then reappears

@Disquse
Copy link
Contributor

Disquse commented Jan 17, 2024

I suppose RedM doesn't have an equivalent to this FiveM patch that prevents deleting the local player ped, as that would crash the game:

But RedM shouldn't crash if you remove your local player ped 🤔

@ScrachStack
Copy link
Author

I suppose RedM doesn't have an equivalent to this FiveM patch that prevents deleting the local player ped, as that would crash the game:

But RedM shouldn't crash if you remove your local player ped 🤔

First time this happened I died and couldn't respawn as my pet wasn't there the 2nd time I joined back and tried it I crashed I posted it above if it helps.

@ScrachStack
Copy link
Author

..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug crash RedM Issues/PRs related to RedM triage Needs a preliminary assessment to determine the urgency and required action
Projects
None yet
Development

No branches or pull requests

4 participants