Skip to content

Fix buildings losing their setLowLODElement link - #5484

Open
Flashmyname wants to merge 1 commit into
multitheftauto:masterfrom
Flashmyname:fix/building-lod-links
Open

Flashmyname wants to merge 1 commit into
multitheftauto:masterfrom
Flashmyname:fix/building-lod-links

Conversation

@Flashmyname

Copy link
Copy Markdown
Contributor

Summary

A building's setLowLODElement link was lost after setElementPosition, a dimension change or a building pool resize.

The cleanup #5440 added to Destroy also runs on those recreates, so that part is taken out and the null checks stay. Unlink still clears both sides on delete.

Motivation

Regression from #5440.

Test plan

With runcode:

crun a=createBuilding(1337,0,0,500) b=createBuilding(1337,0,0,510) setLowLODElement(a,b) setElementPosition(a,0,0,505) return getLowLODElement(a)==b, isElementLowLOD(b)
crun setLowLODElement(a,b) engineSetPoolCapacity("building",engineGetPoolCapacity("building")+5000) return getLowLODElement(a)==b, isElementLowLOD(b)
crun setLowLODElement(a,b) setElementDimension(localPlayer,1) setElementDimension(localPlayer,0) return getLowLODElement(a)==b, isElementLowLOD(b)

Master returns false, false on each, with the fix true, true.

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