Skip to content

Fix IPL buildings leaking when the building pool is larger than 32768 - #5463

Open
Flashmyname wants to merge 1 commit into
multitheftauto:masterfrom
Flashmyname:fix/ipl-remove-large-building-pool
Open

Flashmyname wants to merge 1 commit into
multitheftauto:masterfrom
Flashmyname:fix/ipl-remove-large-building-pool

Conversation

@Flashmyname

Copy link
Copy Markdown
Contributor

Summary

CIplStore::RemoveIpl finds an IPL's buildings through a 16 bit index range, so above 32768 slots it misses them and every stream-in adds another copy. Past that size it now scans the whole pool.

Motivation

Shrinking back is covered by #5462.

Test plan

crun engineSetPoolCapacity("building",100000) for i=1,(36000-engineGetPoolUsedCapacity("building"))/2 do createBuilding(1337,2900,-2900,0) end setElementPosition(localPlayer,-2150,200,40)
crun local t,p=0,{{-2150,200,40},{2050,1500,20}} setTimer(function() t=t+1 outputChatBox(t.." "..engineGetPoolUsedCapacity("building")) setElementPosition(localPlayer,unpack(p[t%2+1])) end,5000,8)

On master the count grows at every stop, with the fix SF and LV repeat the same numbers.

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 added the bugfix Solution to a bug of any kind label Sep 30, 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.

2 participants