diff --git a/source/enemy/nanemone.cpp b/source/enemy/nanemone.cpp index 65c770ac3..cfcc19a07 100644 --- a/source/enemy/nanemone.cpp +++ b/source/enemy/nanemone.cpp @@ -190,7 +190,7 @@ void CNpcEnemy::processCloseAnemone2Attack( int _frames ) DVECTOR spikePos; heading = m_heading - 1024 + ( fireLoop * 512 ); - heading %= 4096; + heading &= 4095; spikePos = Pos; spikePos.vx += ( 10 * rcos( heading ) ) >> 12; diff --git a/source/enemy/ngeneric.cpp b/source/enemy/ngeneric.cpp index 1a917d505..5d762beef 100644 --- a/source/enemy/ngeneric.cpp +++ b/source/enemy/ngeneric.cpp @@ -62,7 +62,7 @@ void CNpcEnemy::processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32 } m_heading += moveDist; - m_heading = m_heading % ONE; + m_heading &= 4095; s32 preShiftX = _frames * speed * rcos( m_heading ); s32 preShiftY = _frames * speed * rsin( m_heading ); @@ -146,8 +146,9 @@ bool CNpcEnemy::processGroundCollisionReverse( s32 *moveX, s32 *moveY ) *moveY = -(*moveY); m_heading += 2048; - m_heading &= 4096; } + + m_heading &= 4095; } return( xBlocked | yBlocked ); @@ -203,7 +204,7 @@ void CNpcEnemy::processGenericFixedPathMove( int _frames, s32 *moveX, s32 *moveY } m_heading += *moveDist; - m_heading = m_heading % ONE; + m_heading &= 4095; s32 preShiftX = _frames * m_data[m_type].speed * rcos( m_heading ); s32 preShiftY = _frames * m_data[m_type].speed * rsin( m_heading ); diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 24fc29ad5..0ecc9a20f 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -386,18 +386,6 @@ void CNpcEnemy::postInit() case NPC_INIT_RETURNING_HAZARD: { - DVECTOR newPos; - - newPos.vx = 100; - newPos.vy = 10; - - m_npcPath.addWaypoint( newPos ); - - newPos.vx = 500; - newPos.vy = 10; - - m_npcPath.addWaypoint( newPos ); - m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH ); break; @@ -452,7 +440,7 @@ void CNpcEnemy::postInit() DVECTOR spikePos; heading = m_heading - 1024 + ( fireLoop * 512 ); - heading %= 4096; + heading &= 4095; spikePos = Pos; spikePos.vx += ( 10 * rcos( heading ) ) >> 12; diff --git a/source/enemy/nsjfish.cpp b/source/enemy/nsjfish.cpp index 949c8ac64..ddf7c1470 100644 --- a/source/enemy/nsjfish.cpp +++ b/source/enemy/nsjfish.cpp @@ -146,7 +146,7 @@ void CNpcEnemy::processCloseSmallJellyfishEvade( int _frames ) headingToPlayer -= 1024; } - headingToPlayer %= ONE; + headingToPlayer &= 4095; s16 decDir, incDir;