Fix Coverity warning about odd null check in TempObstacleHilightTool
m_sample was being checked for null after being used, which looks like a null dereference, though actually if m_sample becomes null, the tool will be deactivated anyway. Regardless, this code looks more sensible.
This commit is contained in:
parent
222fa1ee6f
commit
e4791becd5
@ -726,7 +726,7 @@ public:
|
|||||||
|
|
||||||
virtual void handleRender()
|
virtual void handleRender()
|
||||||
{
|
{
|
||||||
if (m_hitPosSet)
|
if (m_hitPosSet && m_sample)
|
||||||
{
|
{
|
||||||
const float s = m_sample->getAgentRadius();
|
const float s = m_sample->getAgentRadius();
|
||||||
glColor4ub(0,0,0,128);
|
glColor4ub(0,0,0,128);
|
||||||
@ -741,14 +741,10 @@ public:
|
|||||||
glEnd();
|
glEnd();
|
||||||
glLineWidth(1.0f);
|
glLineWidth(1.0f);
|
||||||
|
|
||||||
if (m_sample)
|
|
||||||
{
|
|
||||||
int tx=0, ty=0;
|
int tx=0, ty=0;
|
||||||
m_sample->getTilePos(m_hitPos, tx, ty);
|
m_sample->getTilePos(m_hitPos, tx, ty);
|
||||||
m_sample->renderCachedTile(tx,ty,m_drawType);
|
m_sample->renderCachedTile(tx,ty,m_drawType);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void handleRenderOverlay(double* proj, double* model, int* view)
|
virtual void handleRenderOverlay(double* proj, double* model, int* view)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user