Mt. silver, Rock Climb - startup performance

This commit is contained in:
infinitefusion
2022-11-26 15:11:57 -05:00
parent 215e6a2462
commit 75569daf27
94 changed files with 775 additions and 3143 deletions

View File

@@ -421,6 +421,12 @@ def pbTrainerBattleCore(*args)
foeItems.push(arg.items)
elsif arg.is_a?(Array) # [trainer type, trainer name, ID, speech (optional)]
trainer = pbLoadTrainer(arg[0],arg[1],arg[2])
if !trainer && $game_switches[SWITCH_MODERN_MODE] #retry without modern mode
$game_switches[SWITCH_MODERN_MODE]=false
trainer = pbLoadTrainer(arg[0],arg[1],arg[2])
$game_switches[SWITCH_MODERN_MODE]=true
end
pbMissingTrainer(arg[0],arg[1],arg[2]) if !trainer
return 0 if !trainer
@@ -529,6 +535,11 @@ def pbTrainerBattle(trainerID, trainerName, endSpeech=nil,
end
# Load the trainer's data, and call an event w0hich might modify it
trainer = pbLoadTrainer(trainerID,trainerName,trainerPartyID)
if !trainer && $game_switches[SWITCH_MODERN_MODE] #retry without modern mode
$game_switches[SWITCH_MODERN_MODE]=false
trainer = pbLoadTrainer(trainerID,trainerName,trainerPartyID)
$game_switches[SWITCH_MODERN_MODE]=true
end
pbMissingTrainer(trainerID,trainerName,trainerPartyID) if !trainer
return false if !trainer
Events.onTrainerPartyLoad.trigger(nil,trainer)