Looping issues

Results 1 to 1 of 1
  1. #1
    Flow even is offline
    MemberRank
    Nov 2012 Join Date
    BaniLocation
    610Posts

    Looping issues

    This is inside PlayerStat.java:
    Code:
            if (chra.hasAngel()){
                  chra.spawnAngel(equippedSummon);
            }
    This is inside MapleCharatcer:
    Code:
        public boolean hasAngel(){
            return angelEquipped;
        }
        
        public void spawnAngel(int buff){
            final Item item = getInventory(MapleInventoryType.EQUIPPED).getItem((byte)-12);
            angelRing=buff;
         
            if(!(hasEquipped(1112594) || hasEquipped(1112585) || hasEquipped(1112586) || hasEquipped(1112663))){
               if(angelEquipped==true){
                  this.dispelSkill(buff);
                  dropMessage(1, "[Insert Angel name's skill here!] has been removed from your inventory.");
                  getStat().equippedSummon=0;
                  angelRing=0;
                  angelEquipped=false;
             }
                return; // If the rings are not equipped, return to where the function was called
           }
            
            switch (item.getItemId()){
                    case 1112594:
                    case 1112585:
                    case 1112586:
                    case 1112663:{
                    if (angelRing > 0) {
                       SkillFactory.getSkill(angelRing).getEffect(1).applyTo(this);
                       angelEquipped=true;
                    }
                   break;
            }
          }
        }
    I am trying to make it so it goes in the function once if the item is equipped, if not it will skip over the if statement in the top.
    The top one is in a loop which makes the player dc, because the effect is spamming until the client cannot take it anymore. Any ideas?

    EDIT: more information about the loop, is that it runs the check if the player has items equipped which raises stats and etc...
    Last edited by even; 07-12-12 at 08:52 PM.




Advertisement