Skip to content

Commit

Permalink
Two minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nadult committed Jan 14, 2025
1 parent 9d02e4b commit d44f803
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/game/turret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void Turret::fireProjectile(const FBox &target_box, const Weapon &weapon, float
Ray3F best_ray = *computeBestShootingRay(target_box, weapon).asRay();

if(randomness > 0.0f) {
float3 dir = perturbVector(best_ray.dir(), random(), random(), randomness);
float3 dir = normalize(perturbVector(best_ray.dir(), random(), random(), randomness));
best_ray = Ray3F(best_ray.origin(), dir);
}

Expand Down
2 changes: 1 addition & 1 deletion src/grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Grid::Grid(const int2 &size) {
m_size = worldToGrid(size + int2(node_size - 1, node_size - 1));
if(m_size.x * m_size.y > 0) {
m_nodes.resize(m_size.x * m_size.y);
m_row_rects.resize(m_size.y, int2(0, 0));
m_row_rects.resize(m_size.y + 1, int2(0, 0));
//TODO: row_rects not updated when removing objects, this will degrade performance
// when drawing entitiy grids

Expand Down

0 comments on commit d44f803

Please sign in to comment.