Fix typo and handle NoBackendError

The typo caused the trade following evolutions with move learning to crash
This commit is contained in:
Lorenzo Carletti 2022-04-23 18:43:00 +02:00
parent 2ed28eb8f5
commit 2cffee468a
3 changed files with 10 additions and 7 deletions

View File

@ -73,11 +73,14 @@ signal.signal(signal.SIGINT, signal_handler)
# The execution path
try:
devices = list(usb.core.find(find_all=True,idVendor=0xcafe, idProduct=0x4011))
for d in devices:
#print('Device: %s' % d.product)
dev = d
try:
devices = list(usb.core.find(find_all=True,idVendor=0xcafe, idProduct=0x4011))
for d in devices:
#print('Device: %s' % d.product)
dev = d
except usb.core.NoBackendError as e:
pass
sender = sendByte
receiver = receiveByte

View File

@ -98,7 +98,7 @@ class GSCTradingClient:
if val is not None:
updating_mon = self.trader.other_pokemon.pokemon[self.trader.other_pokemon.get_last_mon_index()]
data = [updating_mon.get_species()] + val
data = self.trader.checks.apply_checks_to_data(self.trader.checks.moves_checks_map_path, data)
data = self.trader.checks.apply_checks_to_data(self.trader.checks.moves_checks_map, data)
for i in range(4):
updating_mon.set_move(i, data[i+1], max_pp=False)
updating_mon.set_pp(i, data[i+5])

View File

@ -47,7 +47,7 @@ class RBYTradingClient(GSCTradingClient):
val = self.get_with_counter(self.moves_transfer)
if val is not None:
updating_mon = self.trader.other_pokemon.pokemon[self.trader.other_pokemon.get_last_mon_index()]
data = self.trader.checks.apply_checks_to_data(self.trader.checks.moves_checks_map_path, val)
data = self.trader.checks.apply_checks_to_data(self.trader.checks.moves_checks_map, val)
for i in range(4):
updating_mon.set_move(i, data[i+1], max_pp=False)
updating_mon.set_pp(i, data[i+5])