Skip to content

Commit

Permalink
Only spawn roots that are in the direction of the crusher
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Aug 27, 2024
1 parent 016b8a4 commit 4820569
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/badguy/crusher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,20 @@ Crusher::collision_solid(const CollisionHit& hit)
}
}
}
if (hit.bottom)
spawn_roots(Direction::DOWN);
else if (hit.top)
spawn_roots(Direction::UP);
else if (hit.left)
spawn_roots(Direction::LEFT);
else if (hit.right)
spawn_roots(Direction::RIGHT);
if(m_sideways)
{
if (hit.left)
spawn_roots(Direction::LEFT);
else if (hit.right)
spawn_roots(Direction::RIGHT);
}
else
{
if (hit.bottom)
spawn_roots(Direction::DOWN);
else if (hit.top)
spawn_roots(Direction::UP);
}
break;
default:
log_debug << "Crusher in invalid state" << std::endl;
Expand Down

0 comments on commit 4820569

Please sign in to comment.