Pet file cleanup

This commit is contained in:
John Cote 2015-04-28 00:24:58 -04:00
parent 227595fc64
commit 985b2a345b
3 changed files with 74 additions and 84 deletions

View file

@ -51,5 +51,3 @@ class DistributedPetUD(DistributedObjectUD):
def setLastSeenTimestamp(self, timestamp):
pass

View file

@ -12,7 +12,7 @@ def getDayId():
return int(time.time() // DAY)
class PetManagerAI:
NUM_DAILY_PETS = 5 # per hood
NUM_DAILY_PETS = 5 # Per hood.
cachePath = config.GetString('air-pet-cache', 'astron/databases/air_cache/')
def __init__(self, air):
@ -25,7 +25,6 @@ class PetManagerAI:
self.seeds = cPickle.loads(data)
if self.seeds.get('day', -1) != getDayId() or len(self.seeds.get(ToontownGlobals.ToontownCentral, [])) != self.NUM_DAILY_PETS:
self.generateSeeds()
else:
self.generateSeeds()
@ -80,7 +79,4 @@ class PetManagerAI:
if pet:
if pet in self.air.doId2do:
self.air.doId2do[pet].requestDelete()
av.b_setPetId(0)
# XXX to do: check for current pet and destroy it if generated

View file

@ -20,7 +20,6 @@ def housePointCollision(x, y):
for i, h in enumerate(houses):
if inCircle(x, y, h, houseRadius):
return 1
return 0
def generatePos():
@ -61,7 +60,6 @@ def houseCollision(pt1, pt2):
for i, h in enumerate(houses):
if lineInCircle(pt1, pt2, h):
return 1
return 0
def generatePath(start, end):
@ -136,7 +134,6 @@ class PetMoverAI(FSM):
def __stateComplete(self):
try:
self.request("Still")
except:
pass
@ -186,4 +183,3 @@ class PetMoverAI(FSM):
self.__chaseCallback = callback
self.demand("Chase", av)