Changeset 407:bdc8bc78a796


Ignore:
Timestamp:
Nov 21, 2009, 6:44:19 AM (11 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Convert:
svn:b4e93282-eac8-4b8b-b765-0f5d36de2b68/trunk/rinkhals@412
Message:

Handle corner case aroudn entering the map

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gamelib/animal.py

    r406 r407  
    345345                    min_cost = cost
    346346                    best = point
    347         if min_cost < 20:
     347        if min_cost < 20 or not gameboard.in_bounds(self.pos):
     348            # If we're not on the gameboard yet, there's no point in looking
     349            # for an optimal path.
    348350            return best
    349351        # Else expensive step, so think further
Note: See TracChangeset for help on using the changeset viewer.