Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Client/game_sa/CProjectileInfoSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ void CProjectileInfoSA::RemoveProjectile(CProjectileInfo* pProjectileInfo, CProj
// Has it not already been removed by GTA?
if (pProjectileInfo->IsActive())
{
// Fix crash when disconnecting
// GH #3876
if (!projectileInfoInterface->pEntProjectileOwner || projectileInfoInterface->pEntProjectileOwner->nType == ENTITY_TYPE_NOTHING || projectileInfoInterface->pEntProjectileOwner->pReferences == reinterpret_cast<void*>(0x80808080))
bBlow = false;
Comment on lines +51 to +52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to find a reason why pEntProjectileOwner was freed.
It looks like MTA doesn't delete all projectiles while disconnecting.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the goal of this PR. This PR is only a temporary solution to prevent the game from crashing. If you want, feel free to investigate the cause and open a PR with the fix, and then I'll close mine. For now, this PR is just a temporary crash patch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporary solutions have a high chance to become permanent.
The solution is too dirty. We don't rush with this issue.


if (bBlow)
{
DWORD dwFunc = FUNC_RemoveProjectile;
Expand Down
Loading