Thread: [PI]Unreachable Statement - Quick Help

Results 1 to 4 of 4
  1. #1 [PI]Unreachable Statement - Quick Help 
    Registered Member
    Join Date
    Jun 2010
    Posts
    27
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Here's my problem in clickingbuttons.java. I tried re-adding teleport cases and got this..
    Code:
    src\server\model\players\packets\ClickingButtons.java:257: unreachable statement
    
                       break;
                       ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    That is my error. Everything compiled fine, until I re-added the cases for teleports. Here is what I added:

    Code:
    //1st tele option
    			case 9190:
    if (c.teleAction == 1) {
    					//rock crabs
    					c.getPA().spellTeleport(2676, 3715, 0);
    				} else if (c.teleAction == 2) {
    					//barrows
    					c.getPA().spellTeleport(3565, 3314, 0);
    
    				} else if (c.teleAction == 3) {
    					//godwars
    					c.getPA().spellTeleport(2916, 3612, 0);
    				} else if (c.teleAction == 4) {
    					//varrock wildy
    					c.getPA().spellTeleport(2539, 4716, 0);
    				} else if (c.teleAction == 5) {
    					c.getPA().spellTeleport(3046,9779,0);
    				}
    				
    				if (c.dialogueAction == 10) {
    					c.getPA().spellTeleport(2845, 4832, 0);
    					c.dialogueAction = -1;
    				} else if (c.dialogueAction == 11) {
    					c.getPA().spellTeleport(2786, 4839, 0);
    					c.dialogueAction = -1;
    				} else if (c.dialogueAction == 12) {
    					c.getPA().spellTeleport(2398, 4841, 0);
    					c.dialogueAction = -1;
                                    }
    				break;
    				//mining - 3046,9779,0
    			//smithing - 3079,9502,0
    			//2nd tele option
    			case 9191:
    if (c.teleAction == 1) {
    					//tav dungeon
    					c.getPA().spellTeleport(2884, 9798, 0);
    				} else if (c.teleAction == 2) {
    					//pest control
    					c.getPA().spellTeleport(2662, 2650, 0);
    				} else if (c.teleAction == 3) {
    					//kbd
    					c.getPA().spellTeleport(3007, 3849, 0);
    				} else if (c.teleAction == 4) {
    					//graveyard
    					c.getPA().spellTeleport(2978, 3616, 0);
    				} else if (c.teleAction == 5) {
    					c.getPA().spellTeleport(3079,9502,0);
    				}
    				if (c.dialogueAction == 10) {
    					c.getPA().spellTeleport(2796, 4818, 0);
    					c.dialogueAction = -1;
    				} else if (c.dialogueAction == 11) {
    					c.getPA().spellTeleport(2527, 4833, 0);
    					c.dialogueAction = -1;
    				} else if (c.dialogueAction == 12) {
    					c.getPA().spellTeleport(2464, 4834, 0);
    					c.dialogueAction = -1;
                                    }
    				break;
    			//3rd tele option	
    			case 9192:
    if (c.teleAction == 1) {
    					//slayer tower
    					c.getPA().spellTeleport(3428, 3537, 0);
    				} else if (c.teleAction == 2) {
    					//tzhaar
    					c.getPA().spellTeleport(2400, 5179, 0);
    				} else if (c.teleAction == 3) {
    					//dag kings
    					c.getPA().spellTeleport(1910, 4367, 0);
    					c.sendMessage("Climb down the ladder to get into the lair.");
    				} else if (c.teleAction == 4) {
    					//44 portals
    					c.getPA().spellTeleport(2975, 3873, 0);
    				} else if (c.teleAction == 5) {
    					c.getPA().spellTeleport(2597,3408,0);
    				}
    				if (c.dialogueAction == 10) {
    					c.getPA().spellTeleport(2713, 4836, 0);
    					c.dialogueAction = -1;
    				} else if (c.dialogueAction == 11) {
    					c.getPA().spellTeleport(2162, 4833, 0);
    					c.dialogueAction = -1;
    				} else if (c.dialogueAction == 12) {
    					c.getPA().spellTeleport(2207, 4836, 0);
    					c.dialogueAction = -1;
                                    }
    				break;
    			//4th tele option
    			case 9193:
    
    				if (c.teleAction == 1) {
    					//brimhaven dungeon
    					c.getPA().spellTeleport(2710, 9466, 0);
    				} else if (c.teleAction == 2) {
    					//duel arena
    					c.getPA().spellTeleport(3366, 3266, 0);
    				} else if (c.teleAction == 3) {
    					//chaos elemental
    					c.getPA().spellTeleport(3295, 3921, 0);
    				} else if (c.teleAction == 4) {
    					//gdz
    					c.getPA().spellTeleport(3288, 3886, 0);
    				} else if (c.teleAction == 5) {
    					c.getPA().spellTeleport(2724,3484,0);
    					c.sendMessage("For magic logs, try north of the duel arena.");
    				}
    				if (c.dialogueAction == 10) {
    					c.getPA().spellTeleport(2660, 4839, 0);
    					c.dialogueAction = -1;
    				} else if (c.dialogueAction == 11) {
    					//c.getPA().spellTeleport(2527, 4833, 0); astrals here
    					c.getRunecrafting().craftRunes(2489);
    					c.dialogueAction = -1;
    				} else if (c.dialogueAction == 12) {
    					//c.getPA().spellTeleport(2464, 4834, 0); bloods here
    					c.getRunecrafting().craftRunes(2489);
    					c.dialogueAction = -1;
                                    }
    				break;
    			//5th tele option
    			case 9194:
    
    				if (c.teleAction == 1) {
    					//island
    					c.getPA().spellTeleport(2895, 2727, 0);
    				} else if (c.teleAction == 2) {
    					//last minigame spot
    					c.sendMessage("Suggest something for this spot on the forums!");
    					c.getPA().closeAllWindows();
    				} else if (c.teleAction == 3) {
    					//last monster spot
    					c.sendMessage("Suggest something for this spot on the forums!");
    					c.getPA().closeAllWindows();
    				} else if (c.teleAction == 4) {
    					//ardy lever
    					c.getPA().spellTeleport(3093, 3503, 0);
    				} else if (c.teleAction == 5) {
    					c.getPA().spellTeleport(2812,3463,0);
    				}
    				if (c.dialogueAction == 10 || c.dialogueAction == 11) {
    					c.dialogueId++;
    					c.getDH().sendDialogues(c.dialogueId, 0);
    				} else if (c.dialogueAction == 12) {
    					c.dialogueId = 17;
    					c.getDH().sendDialogues(c.dialogueId, 0);
                                    }
    				break;
    It's probably a simple fix, but it's got me stumped.

    Thanks in advance.
    ~Love Old School PKing like it was in 2007?
    Skilling? Minigames? Check out my server GyroScape.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Chiief's Avatar
    Join Date
    Jun 2010
    Posts
    1,544
    Thanks given
    69
    Thanks received
    238
    Rep Power
    611
    Which line is 257?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jun 2010
    Posts
    27
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Found the problem. It turns out there was an extra break on that line.

    Great learning experience for me, and for everone else who has this problem - Count the lines it says. I was on line 257 - Count the lines on that line will be your problem.

    Thanks for the willingness to help, I appreciate it.
    ~Love Old School PKing like it was in 2007?
    Skilling? Minigames? Check out my server GyroScape.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Its paris's Avatar
    Join Date
    Apr 2009
    Posts
    1,141
    Thanks given
    56
    Thanks received
    234
    Rep Power
    689
    Quote Originally Posted by Valance View Post
    Found the problem. It turns out there was an extra break on that line.

    Great learning experience for me, and for everone else who has this problem - Count the lines it says. I was on line 257 - Count the lines on that line will be your problem.

    Thanks for the willingness to help, I appreciate it.
    Most text editors and IDE's support find line (ctrl + g), so no more counting.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •