Skip to content

Fix garages automatically closing/opening#4684

Open
FileEX wants to merge 2 commits intomultitheftauto:masterfrom
FileEX:bugfix/garage-states
Open

Fix garages automatically closing/opening#4684
FileEX wants to merge 2 commits intomultitheftauto:masterfrom
FileEX:bugfix/garage-states

Conversation

@FileEX
Copy link
Member

@FileEX FileEX commented Feb 2, 2026

Summary

When a ped model is being set (for example, the first time after joining the game, when changing a skin, or when calling engineRestreamWorld, stream-in etc), CPedSA::Respawn calls CGameLogic::RestorePlayerStuffDuringResurrection (it’s probably enough to call just CWorld::Remove and CWorld::Add, since the rest of what this function does seems unnecessary but that’s not what this PR is about).

This function, among other things, calls CGarages::PlayerArrestedOrDied, which can close garages that are currently open or open garages that should remain closed. This PR disables the call to that function.

Motivation

#4683

Test plan

Works good.

crun me.position = Vector3(1843.37, -1856.32, 13.875) -- garage is closed now

Before

crun me.position = Vector3(1843.37, -1856.32, 13.875) -- garage is opened
crun isGarageOpen(3) -- true
srun isGarageOpen(3) -- false
crun setGarageOpen(3, false)
crun engineRestreamWorld()
-- garage opening again

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

@FileEX FileEX requested a review from a team as a code owner February 2, 2026 08:57
@FileEX FileEX added the bugfix Solution to a bug of any kind label Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Specific garages spawn open and reopen after reconnect despite being set to closed

1 participant