diff options
| author | realtradam <[email protected]> | 2021-08-10 00:24:10 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2021-08-10 00:24:10 -0400 |
| commit | fef549030394f1662fcef86afa853b5238ec88d2 (patch) | |
| tree | 3924722a98f585d90dd6f0bf0bdfa452d3560559 /lib/rules/limit.rb | |
| parent | b22858807ffe83a35a956272c401aec17dadb759 (diff) | |
| download | ruboids-fef549030394f1662fcef86afa853b5238ec88d2.tar.gz ruboids-fef549030394f1662fcef86afa853b5238ec88d2.zip | |
rubocop autofixes
Diffstat (limited to 'lib/rules/limit.rb')
| -rw-r--r-- | lib/rules/limit.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/rules/limit.rb b/lib/rules/limit.rb index 5df8bc4..2921230 100644 --- a/lib/rules/limit.rb +++ b/lib/rules/limit.rb @@ -1,13 +1,15 @@ +# frozen_string_literal: true + # This special function is already called by apply_boid_calculations.rb # do not add or call this function elsewhere FF::Sys.new('Limit') do - unless $config.limit < 0 + unless $config.limit.negative? FF::Cmp::Boids.each do |boid| - if boid.entities[0].components[FF::Cmp::Piranha].nil? - multi = 1.0 - else - multi = 0.3 - end + multi = if boid.entities[0].components[FF::Cmp::Piranha].nil? + 1.0 + else + 0.3 + end absolute_velocity = Math.sqrt((boid.vx**2) + (boid.vy**2)) if absolute_velocity > ($config.limit * multi) |
