Skip to content

Commit

Permalink
Fixed a simple uninitialized ivar warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
zenspider committed May 20, 2013
1 parent 80df036 commit 2f3c5f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sample_bots/seek_and_destroy.rb
Expand Up @@ -8,6 +8,8 @@ class SeekAndDestroy < RTanque::Bot::Brain
TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 5.0 TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 5.0


def tick! def tick!
@desired_heading ||= nil

if (lock = self.get_radar_lock) if (lock = self.get_radar_lock)
self.destroy_lock(lock) self.destroy_lock(lock)
@desired_heading = nil @desired_heading = nil
Expand Down Expand Up @@ -48,4 +50,4 @@ def get_radar_lock
@locked_on = lock.name if lock @locked_on = lock.name if lock
lock lock
end end
end end

0 comments on commit 2f3c5f4

Please sign in to comment.