Skip to content

Fix crash after a dimension change creates many buildings at once - #5483

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

Flashmyname wants to merge 1 commit into
multitheftauto:masterfrom
Flashmyname:fix/building-pool-dimension

Conversation

@Flashmyname

Copy link
Copy Markdown
Contributor

Summary

Switching to a dimension with many buildings filled the building pool, and the next IPL stream-in crashed the client.

Motivation

Regression from #5139.

Test plan

With runcode, a few seconds apart:

crun setElementDimension(localPlayer,1) setElementPosition(localPlayer,-2900,-2900,5)
crun createBuilding(1337,0,0,3) for i=1,engineGetPoolCapacity("building")-engineGetPoolUsedCapacity("building")+100 do createBuilding(1337,0,0,3) end
crun setElementDimension(localPlayer,0) setElementPosition(localPlayer,-2150,200,40) return engineGetPoolCapacity("building")-engineGetPoolUsedCapacity("building")

Master returns 0 and crashes at 0x5381A5 as the area streams in, with the fix it returns the free slot count and keeps running.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant