This commit is contained in:
Charles 2001-05-18 13:20:55 +00:00
parent de88f966a9
commit 4142818b5c
2 changed files with 40 additions and 1 deletions

View file

@ -26,6 +26,7 @@ void CNpcBarrelHazard::init()
CNpcHazard::init();
m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH );
m_rotation = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -111,6 +112,41 @@ void CNpcBarrelHazard::processMovement( int _frames )
}
}
if ( moveX < 0 )
{
m_rotation -= 64 * _frames;
m_rotation &= 4095;
}
else if ( moveX > 0 )
{
m_rotation += 64 * _frames;
m_rotation &= 4095;
}
Pos.vx += moveX;
Pos.vy += moveY;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcBarrelHazard::render()
{
CHazardThing::render();
if (canRender())
{
DVECTOR &renderPos=getRenderPos();
SVECTOR rotation;
rotation.vx = 0;
rotation.vy = 0;
rotation.vz = m_rotation;
VECTOR scale;
scale.vx = ONE;
scale.vy = ONE;
scale.vz = ONE;
m_modelGfx->Render(renderPos,&rotation,&scale);
}
}