1
0
forked from mirrors/0ad

Make CUnit::GetModel return a reference so it's clear it can never be NULL.

This was SVN commit r7464.
This commit is contained in:
Ykkrosh
2010-04-17 11:44:08 +00:00
parent 6a9de50692
commit 0547757a30
14 changed files with 63 additions and 62 deletions
+2 -2
View File
@@ -112,12 +112,12 @@ CUnit* CUnitManager::PickUnit(const CVector3D& origin, const CVector3D& dir, boo
if( ent && !ent->m_visible )
continue;
if (unit->GetModel()->GetBounds().RayIntersect(origin, dir, tmin, tmax)
if (unit->GetModel().GetBounds().RayIntersect(origin, dir, tmin, tmax)
&& losMgr->GetUnitStatus(unit, g_Game->GetLocalPlayer()) != UNIT_HIDDEN)
{
// Point of closest approach
CVector3D obj;
unit->GetModel()->GetBounds().GetCentre(obj);
unit->GetModel().GetBounds().GetCentre(obj);
CVector3D delta = obj - origin;
float distance = delta.Dot(dir);
CVector3D closest = origin + dir * distance;