Skip to content

Enhance LOD model ID handling for entities#4871

Closed
Zephkek wants to merge 1 commit intomultitheftauto:masterfrom
Zephkek:fix/lod-line-of-sight
Closed

Enhance LOD model ID handling for entities#4871
Zephkek wants to merge 1 commit intomultitheftauto:masterfrom
Zephkek:fix/lod-line-of-sight

Conversation

@Zephkek
Copy link
Copy Markdown
Contributor

@Zephkek Zephkek commented May 1, 2026

Summary

Makes processLineOfSight and testSphereAgainstWorld return the entity's own model ID when a ray hits a LOD entity directly, instead of returning 0.

Motivation

Follow-up to #4863. For co-located HD/LOD placements (e.g., billboards), rays that hit the LOD entity itself previously returned worldLODModelID = 0 because LODs naturally have m_pLod == NULL.

This patch fixes that by checking if the hit entity is a LOD (numLodChildren > 0) and reporting its own ID. Standard non-LOD buildings (numLodChildren == 0) are unaffected and still correctly return 0.

Test Plan

  • Shared LODs (BillBd3): Consistently returns LOD ID 1266 from all angles, regardless of whether the ray hits the HD or LOD entity first.
  • Singleton pairs & plain buildings: Unchanged; standard buildings still return 0.
  • Scripted low-LOD objects: Unaffected (still use m_pLod).

Checklist

  • Code follows guidelines
  • Reviewable commit-by-commit

Added LOD model ID reporting for entities in CWorldSA.
@Zephkek Zephkek closed this May 1, 2026
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