Remove a bunch of annoyting spaces
This commit is contained in:
parent
7e42fafa10
commit
75898aee55
2 changed files with 10 additions and 5 deletions
|
@ -5,7 +5,7 @@ import BankGlobals
|
|||
|
||||
class DistributedBankAI(DistributedFurnitureItemAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedBankAI")
|
||||
|
||||
|
||||
def __init__(self, air, furnitureMgr, item):
|
||||
DistributedFurnitureItemAI.__init__(self, air, furnitureMgr, item)
|
||||
self.avId = None
|
||||
|
@ -31,19 +31,19 @@ class DistributedBankAI(DistributedFurnitureItemAI):
|
|||
|
||||
def freeAvatar(self):
|
||||
pass
|
||||
|
||||
|
||||
def setMovie(self, mode, avId, time):
|
||||
self.movie = mode
|
||||
if self.movie != BankGlobals.BANK_MOVIE_CLEAR:
|
||||
taskMgr.doMethodLater(2.0, self.clearMovie, 'clear-movie-%d' % self.getDoId())
|
||||
|
||||
|
||||
def clearMovie(self, task):
|
||||
self.b_setMovie(BankGlobals.BANK_MOVIE_CLEAR, 0, globalClockDelta.getRealNetworkTime())
|
||||
|
||||
|
||||
def b_setMovie(self, mode, avId, time):
|
||||
self.setMovie(mode, avId, time)
|
||||
self.d_setMovie(mode, avId, time)
|
||||
|
||||
|
||||
def d_setMovie(self, mode, avId, time):
|
||||
self.sendUpdate('setMovie', [mode, avId, time])
|
||||
|
||||
|
|
|
@ -105,9 +105,11 @@ class DistributedPhoneAI(DistributedFurnitureItemAI):
|
|||
self.air.writeServerEvent('suspicious', avId=avId, issue='Tried to purchase while not using the phone!')
|
||||
return
|
||||
av = self.air.doId2do.get(avId)
|
||||
|
||||
if not av:
|
||||
self.air.writeServerEvent('suspicious', avId=avId, issue='Used phone from other shard!')
|
||||
return
|
||||
|
||||
item = CatalogItem.getItem(item)
|
||||
if isinstance(item, CatalogInvalidItem): # u wot m8
|
||||
self.air.writeServerEvent('suspicious', avId=avId, issue='Tried to purchase invalid catalog item.')
|
||||
|
@ -121,6 +123,7 @@ class DistributedPhoneAI(DistributedFurnitureItemAI):
|
|||
price = item.getPrice(0)
|
||||
else:
|
||||
return
|
||||
|
||||
if item.getDeliveryTime():
|
||||
if len(av.onOrder) > 3: #TODO correct number
|
||||
self.sendUpdateToAvatarId(avId, 'requestPurchaseResponse', [context, ToontownGlobals.P_OnOrderListFull])
|
||||
|
@ -137,9 +140,11 @@ class DistributedPhoneAI(DistributedFurnitureItemAI):
|
|||
if not av.takeMoney(price):
|
||||
#u wot m8
|
||||
return
|
||||
|
||||
resp = item.recordPurchase(av, optional)
|
||||
if resp < 0: # refund if purchase unsuccessful
|
||||
av.addMoney(price)
|
||||
|
||||
self.sendUpdateToAvatarId(avId, 'requestPurchaseResponse', [context, resp])
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue