Skip to content

Fix removed world models reappearing after building pool resize - #5251

Open
PlatinMTA wants to merge 1 commit into
multitheftauto:masterfrom
PlatinMTA:fix/4722-removed-lods-coming-back
Open

Fix removed world models reappearing after building pool resize#5251
PlatinMTA wants to merge 1 commit into
multitheftauto:masterfrom
PlatinMTA:fix/4722-removed-lods-coming-back

Conversation

@PlatinMTA

Copy link
Copy Markdown
Contributor

Summary

When the building pool is resized CGameSA::SetBuildingPoolSize removes the whole game world with a backup, resizes the pool and restores the backup. The issue is that it ends up forgetting about the removed LLODs and adds them back.

CBuildingsPoolSA::RestoreBackup and CDummyPoolSA::RestoreBackup now call AddDataBuildingAndReapplyRemoval, removing the LLODs correctly after restoring.

Motivation

Fixes #4722

Test plan

Tested in a very heavy gamemode with around 3300 buildings, forcing engineSetPoolCapacity("building", 18000) (which would trigger the bug) and also tested removeGameWorld() and restoreGameWorld() for good measure. All seems good.

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.

Fixes multitheftauto#4722

When the building pool is resized CGameSA::SetBuildingPoolSize removes the whole game world with a backup, resizes the pool and restores the backup. The issue is that it ends up forgetting about the removed LLODs and adds them back.

CBuildingsPoolSA::RestoreBackup and CDummyPoolSA::RestoreBackup now call ``AddDataBuildingAndReapplyRemoval``, removing the LLODs correctly after restoring.

Tested in a very heavy gamemode with around 3300 buildings, forcing ``engineSetPoolCapacity("building", 18000)`` (which would trigger the bug) and also tested ``removeGameWorld()`` and ``restoreGameWorld()`` for good measure. All seems good.
@FileEX FileEX added the bugfix Solution to a bug of any kind label Aug 21, 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.

Removed lods randomly coming back

2 participants