battle: fix more crashes with street battles
This commit is contained in:
parent
e87f30a135
commit
2f6e16a293
5 changed files with 10 additions and 5 deletions
|
@ -28,6 +28,7 @@ from toontown.toon import Toon
|
||||||
from toontown.toonbase import ToontownGlobals
|
from toontown.toonbase import ToontownGlobals
|
||||||
from toontown.toontowngui import TTDialog
|
from toontown.toontowngui import TTDialog
|
||||||
import copy
|
import copy
|
||||||
|
import functools
|
||||||
from toontown.toonbase import TTLocalizer
|
from toontown.toonbase import TTLocalizer
|
||||||
from toontown.toon import NPCToons
|
from toontown.toon import NPCToons
|
||||||
camPos = Point3(14, 0, 10)
|
camPos = Point3(14, 0, 10)
|
||||||
|
@ -778,7 +779,7 @@ class Movie(DirectObject.DirectObject):
|
||||||
return -1
|
return -1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
self.toonAttackDicts.sort(compFunc)
|
self.toonAttackDicts.sort(key=functools.cmp_to_key(compFunc))
|
||||||
return
|
return
|
||||||
|
|
||||||
def __findToonAttack(self, track):
|
def __findToonAttack(self, track):
|
||||||
|
|
|
@ -8,6 +8,7 @@ from . import MovieUtil
|
||||||
from . import MovieNPCSOS
|
from . import MovieNPCSOS
|
||||||
from .MovieUtil import calcAvgSuitPos
|
from .MovieUtil import calcAvgSuitPos
|
||||||
from direct.showutil import Effects
|
from direct.showutil import Effects
|
||||||
|
import functools
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('MovieDrop')
|
notify = DirectNotifyGlobal.directNotify.newCategory('MovieDrop')
|
||||||
hitSoundFiles = ('AA_drop_flowerpot.mp3', 'AA_drop_sandbag.mp3', 'AA_drop_anvil.mp3', 'AA_drop_bigweight.mp3', 'AA_drop_safe.mp3', 'AA_drop_piano.mp3', 'AA_drop_boat.mp3')
|
hitSoundFiles = ('AA_drop_flowerpot.mp3', 'AA_drop_sandbag.mp3', 'AA_drop_anvil.mp3', 'AA_drop_bigweight.mp3', 'AA_drop_safe.mp3', 'AA_drop_piano.mp3', 'AA_drop_boat.mp3')
|
||||||
missSoundFiles = ('AA_drop_flowerpot_miss.mp3', 'AA_drop_sandbag_miss.mp3', 'AA_drop_anvil_miss.mp3', 'AA_drop_bigweight_miss.mp3', 'AA_drop_safe_miss.mp3', 'AA_drop_piano_miss.mp3', 'AA_drop_boat_miss.mp3')
|
missSoundFiles = ('AA_drop_flowerpot_miss.mp3', 'AA_drop_sandbag_miss.mp3', 'AA_drop_anvil_miss.mp3', 'AA_drop_bigweight_miss.mp3', 'AA_drop_safe_miss.mp3', 'AA_drop_piano_miss.mp3', 'AA_drop_boat_miss.mp3')
|
||||||
|
@ -68,7 +69,7 @@ def doDrops(drops):
|
||||||
return -1
|
return -1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
suitDrops.sort(compFunc)
|
suitDrops.sort(key=functools.cmp_to_key(compFunc))
|
||||||
delay = 0.0
|
delay = 0.0
|
||||||
mtrack = Parallel(name='toplevel-drop')
|
mtrack = Parallel(name='toplevel-drop')
|
||||||
npcDrops = {}
|
npcDrops = {}
|
||||||
|
|
|
@ -7,6 +7,7 @@ from toontown.toon.ToonDNA import *
|
||||||
from toontown.suit.SuitDNA import *
|
from toontown.suit.SuitDNA import *
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
import random
|
import random
|
||||||
|
import functools
|
||||||
from . import MovieCamera
|
from . import MovieCamera
|
||||||
from . import MovieUtil
|
from . import MovieUtil
|
||||||
from .MovieUtil import calcAvgSuitPos
|
from .MovieUtil import calcAvgSuitPos
|
||||||
|
@ -45,7 +46,7 @@ def doFires(fires):
|
||||||
elif len(a) < len(b):
|
elif len(a) < len(b):
|
||||||
return -1
|
return -1
|
||||||
return 0
|
return 0
|
||||||
suitFires.sort(compFunc)
|
suitFires.sort(key=functools.cmp_to_key(compFunc))
|
||||||
|
|
||||||
totalHitDict = {}
|
totalHitDict = {}
|
||||||
singleHitDict = {}
|
singleHitDict = {}
|
||||||
|
|
|
@ -11,6 +11,7 @@ from . import BattleParticles
|
||||||
from toontown.toonbase import ToontownGlobals
|
from toontown.toonbase import ToontownGlobals
|
||||||
from toontown.toonbase import ToontownBattleGlobals
|
from toontown.toonbase import ToontownBattleGlobals
|
||||||
import random
|
import random
|
||||||
|
import functools
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory('MovieSquirt')
|
notify = DirectNotifyGlobal.directNotify.newCategory('MovieSquirt')
|
||||||
hitSoundFiles = ('AA_squirt_flowersquirt.mp3', 'AA_squirt_glasswater.mp3', 'AA_squirt_neonwatergun.mp3', 'AA_squirt_seltzer.mp3', 'firehose_spray.mp3', 'AA_throw_stormcloud.mp3', 'AA_squirt_Geyser.mp3')
|
hitSoundFiles = ('AA_squirt_flowersquirt.mp3', 'AA_squirt_glasswater.mp3', 'AA_squirt_neonwatergun.mp3', 'AA_squirt_seltzer.mp3', 'firehose_spray.mp3', 'AA_throw_stormcloud.mp3', 'AA_squirt_Geyser.mp3')
|
||||||
missSoundFiles = ('AA_squirt_flowersquirt_miss.mp3', 'AA_squirt_glasswater_miss.mp3', 'AA_squirt_neonwatergun_miss.mp3', 'AA_squirt_seltzer_miss.mp3', 'firehose_spray.mp3', 'AA_throw_stormcloud_miss.mp3', 'AA_squirt_Geyser.mp3')
|
missSoundFiles = ('AA_squirt_flowersquirt_miss.mp3', 'AA_squirt_glasswater_miss.mp3', 'AA_squirt_neonwatergun_miss.mp3', 'AA_squirt_seltzer_miss.mp3', 'firehose_spray.mp3', 'AA_throw_stormcloud_miss.mp3', 'AA_squirt_Geyser.mp3')
|
||||||
|
@ -57,7 +58,7 @@ def doSquirts(squirts):
|
||||||
elif len(a) < len(b):
|
elif len(a) < len(b):
|
||||||
return -1
|
return -1
|
||||||
return 0
|
return 0
|
||||||
suitSquirts.sort(compFunc)
|
suitSquirts.sort(key=functools.cmp_to_key(compFunc))
|
||||||
|
|
||||||
delay = 0.0
|
delay = 0.0
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ from toontown.toon.ToonDNA import *
|
||||||
from toontown.suit.SuitDNA import *
|
from toontown.suit.SuitDNA import *
|
||||||
from direct.directnotify import DirectNotifyGlobal
|
from direct.directnotify import DirectNotifyGlobal
|
||||||
import random
|
import random
|
||||||
|
import functools
|
||||||
from . import MovieCamera
|
from . import MovieCamera
|
||||||
from . import MovieUtil
|
from . import MovieUtil
|
||||||
from .MovieUtil import calcAvgSuitPos
|
from .MovieUtil import calcAvgSuitPos
|
||||||
|
@ -49,7 +50,7 @@ def doThrows(throws):
|
||||||
return -1
|
return -1
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
suitThrows.sort(compFunc)
|
suitThrows.sort(key=functools.cmp_to_key(compFunc))
|
||||||
totalHitDict = {}
|
totalHitDict = {}
|
||||||
singleHitDict = {}
|
singleHitDict = {}
|
||||||
groupHitDict = {}
|
groupHitDict = {}
|
||||||
|
|
Loading…
Reference in a new issue