vaendryl / Sunrider

source code of the visual novel 'Sunrider'
http://sunrider-vn.com/
41 stars 21 forks source link

BM.active_weapon can sometimes be None even though BM.targetingmode == True #93

Closed vaendryl closed 9 years ago

vaendryl commented 9 years ago
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 18092, in script
    $BM.battle()  #continue the battle
  File "game/script.rpy", line 18092, in <module>
    $BM.battle()  #continue the battle
  File "game/classes.rpy", line 953, in battle
    self.result = ui.interact()
  File "game/screens custom.rpy", line 98, in execute
    screen battle_screen:
  File "game/screens custom.rpy", line 130, in execute
    viewport id "grid":
  File "game/screens custom.rpy", line 265, in execute
    for ship in BM.ships: #cycle through every ship in the battle
  File "game/screens custom.rpy", line 267, in execute
    if ship.location != None:
  File "game/screens custom.rpy", line 327, in execute
    if ship.faction == 'Player':
  File "game/screens custom.rpy", line 341, in execute
    if BM.targetingmode:
  File "game/screens custom.rpy", line 345, in execute
    if BM.active_weapon.wtype == 'Melee' and (ship.stype != 'Ryder' or get_ship_distance(BM.selected,ship) != 1):
AttributeError: 'NoneType' object has no attribute 'wtype'
DoumanAsh commented 9 years ago

Hm... maybe after enemy turn end?

vaendryl commented 9 years ago

not 100% what caused this, but I think it's fixed in 7.1a