Skip to content

Fix getElementRadius returning false for buildings - #5138

Merged
FileEX merged 1 commit into
multitheftauto:masterfrom
TheCrazy17:fix/building-element-radius
Aug 2, 2026
Merged

Fix getElementRadius returning false for buildings#5138
FileEX merged 1 commit into
multitheftauto:masterfrom
TheCrazy17:fix/building-element-radius

Conversation

@TheCrazy17

Copy link
Copy Markdown
Contributor

Summary

getElementRadius's type switch never had a case for buildings; it fell through to the final return false, even though CClientBuilding already exposes GetModel() the same way objects and peds do. Added the missing case, same pattern already used right below it in GetElementDistanceFromCentreOfMassToBaseOfModel.

Motivation

Fixes #5137.

Test plan

Created a building with createBuilding, called getElementRadius on it; now returns the model's bounding radius instead of false. Also re-tested getElementRadius on a ped, vehicle and object to confirm the existing cases are untouched.

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 Aug 2, 2026
@FileEX FileEX added this to the 1.7 (Current) milestone Aug 2, 2026
@FileEX
FileEX merged commit 16b6aa2 into multitheftauto:master Aug 2, 2026
10 checks passed
@TheCrazy17
TheCrazy17 deleted the fix/building-element-radius branch August 2, 2026 23:22
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.

getElementRadius returns false for buildings

2 participants