View Single Post
  #393    
Old November 18th, 2012 (6:27 AM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
     
    Join Date: Jan 2008
    Location: England
    Posts: 5,180
    Quote:
    Originally Posted by mad.array View Post
    During the end of round phase in PokeBattle_Battle, I've found something slightly peculiar. Everything runs fine up until

    '@battlers[i].pbAbilitiesOnSwitchIn(false)' (Line 3372)

    This seems to only run through once (it is nested in a 'for i in priority' loop). Subsequently, the next turn starts before things like the flinch effect etc. have finished resetting.

    EDIT: I figured it out. Actually, it was posting it which drew my attention to it. '@battlers[i]' needs to be changed to i. I can't believe I've been scratching my head over this for the last half an hour!
    Yep, that's right. It's because I tend to copy lines of code from place to place, and don't always make sure it works. Different parts of the scripts refer to battlers in different ways, and indeed that end-of-round method refers to them in both ways in different places (sometimes i is a number, sometimes it's the battler itself).
    __________________
    Go to the Pokémon Essentials Wiki

    | Downloads | Tutorials | Fangames |
    | All Animations Project |

    Follow me on Twitter: @maruno42


    Reply With Quote