This commit is contained in:
Loudrob 2015-03-29 12:19:47 -04:00
parent 9b755ed2a7
commit 35abc0b1c3
2 changed files with 7 additions and 5 deletions

View file

@ -2,7 +2,7 @@
from pandac.PandaModules import * from pandac.PandaModules import *
hashVal = 3216321797L hashVal = 188749006
from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot

View file

@ -27,7 +27,7 @@ class DistributedNPCPetclerkAI(DistributedNPCToonBaseAI):
if self.isBusy(): if self.isBusy():
self.freeAvatar(avId) self.freeAvatar(avId)
return return
self.petSeeds = self.petMgr.getAvailablePets(3, ZoneUtil.getCanonicalSafeZoneId(self.zoneId)) self.petSeeds = self.air.petMgr.getAvailablePets(3, ZoneUtil.getCanonicalHoodId(self.zoneId))
numGenders = len(PetDNA.PetGenders) numGenders = len(PetDNA.PetGenders)
self.petSeeds *= numGenders self.petSeeds *= numGenders
self.petSeeds.sort() self.petSeeds.sort()
@ -105,11 +105,12 @@ class DistributedNPCPetclerkAI(DistributedNPCToonBaseAI):
if av.petId != 0: if av.petId != 0:
simbase.air.petMgr.deleteToonsPet(avId) simbase.air.petMgr.deleteToonsPet(avId)
gender = petNum % len(PetDNA.PetGenders) gender = petNum % len(PetDNA.PetGenders)
if nameIndex not in xrange(0, len(TTLocalizer.PetNameDictionary) - 1): if nameIndex not in xrange(0, TTLocalizer.PetNameIndexMAX):
self.air.writeServerEvent('avoid_crash', avId, "DistributedNPCPetclerkAI.petAdopted and didn't have valid nameIndex!") self.air.writeServerEvent('avoid_crash', avId, "DistributedNPCPetclerkAI.petAdopted and didn't have valid nameIndex!")
self.notify.warning("somebody called petAdopted and didn't have valid nameIndex to adopt! avId: %s" % avId) self.notify.warning("somebody called petAdopted and didn't have valid nameIndex to adopt! avId: %s" % avId)
return return
simbase.air.petMgr.createNewPetFromSeed(avId, self.petSeeds[petNum], nameIndex=nameIndex, gender=gender, safeZoneId=zoneId) simbase.air.petMgr.createNewPetFromSeed(avId, self.petSeeds[petNum], nameIndex=nameIndex, gender=gender, safeZoneId=zoneId)
self.notify.warning("Created new pet from seed")
self.transactionType = 'adopt' self.transactionType = 'adopt'
bankPrice = min(av.getBankMoney(), cost) bankPrice = min(av.getBankMoney(), cost)
walletPrice = cost - bankPrice walletPrice = cost - bankPrice
@ -126,6 +127,7 @@ class DistributedNPCPetclerkAI(DistributedNPCToonBaseAI):
if av: if av:
simbase.air.petMgr.deleteToonsPet(avId) simbase.air.petMgr.deleteToonsPet(avId)
self.transactionType = 'return' self.transactionType = 'return'
self.transactionDone() self.transactionDone()
def transactionDone(self): def transactionDone(self):