diff --git a/source/hazard/hmasher.cpp b/source/hazard/hmasher.cpp index 3a97566c5..bf13b2ef3 100644 --- a/source/hazard/hmasher.cpp +++ b/source/hazard/hmasher.cpp @@ -21,6 +21,9 @@ #include "game\game.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CNpcMasherHazard::init() { CNpcHazard::init(); @@ -28,6 +31,8 @@ void CNpcMasherHazard::init() m_state = MASHER_DROPPING; } +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CNpcMasherHazard::processMovement( int _frames ) { switch ( m_state ) @@ -82,3 +87,16 @@ void CNpcMasherHazard::processMovement( int _frames ) } } } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcMasherHazard::setGraphic( sThingHazard *ThisHazard ) +{ + m_modelGfx = new ("ModelGfx") CModelGfx; + m_modelGfx->SetModel( ThisHazard->Gfx ); + + sBBox boundingBox = m_modelGfx->GetBBox(); + boundingBox.YMin = boundingBox.YMax - 18; + setCollisionSize( ( boundingBox.XMax - boundingBox.XMin ), ( boundingBox.YMax - boundingBox.YMin ) ); + setCollisionCentreOffset( ( boundingBox.XMax + boundingBox.XMin ) >> 1, ( boundingBox.YMax + boundingBox.YMin ) >> 1 ); +} diff --git a/source/hazard/hmasher.h b/source/hazard/hmasher.h index de1ce816f..86a2421e4 100644 --- a/source/hazard/hmasher.h +++ b/source/hazard/hmasher.h @@ -22,6 +22,7 @@ class CNpcMasherHazard : public CNpcHazard { public: void init(); + virtual void setGraphic( sThingHazard *ThisHazard ); protected: void processMovement( int _frames );