Skip to content

Commit

Permalink
fix bug in drivers when player is reboot: repair
Browse files Browse the repository at this point in the history
  • Loading branch information
zhzhussupovkz committed Dec 25, 2013
1 parent e0e7722 commit 0438f1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/objects/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,10 @@ def add_injury
@injury = true
end

#repair
def repair
@injury = false
end

end

1 change: 1 addition & 0 deletions core/world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def update
if (e.x - @taxi.x).abs <= 15.0 && (e.y - @taxi.y).abs <= 15.0
@drivers.each do |d| d.add_injury end
@taxi.add_injury
@drivers.each do |d| d.repair end
end
end
rescue Exception => e
Expand Down

0 comments on commit 0438f1d

Please sign in to comment.