forked from 2009Scape/Server
Catch potential exception for number formatting for input dialogues.
This commit is contained in:
parent
cace504446
commit
86e53f67b8
1 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package core.net.packet.in;
|
||||
|
||||
import api.ContentAPI;
|
||||
import core.game.node.entity.player.Player;
|
||||
import core.game.node.entity.player.link.RunScript;
|
||||
import core.net.packet.IncomingPacket;
|
||||
|
|
@ -29,7 +30,11 @@ public class RunScriptPacketHandler implements IncomingPacket {
|
|||
} else {
|
||||
value = buffer.getInt();
|
||||
}
|
||||
script.invoke(value);
|
||||
try {
|
||||
script.invoke(value);
|
||||
} catch (NumberFormatException nfe){
|
||||
ContentAPI.sendDialogue(player, "That number's a bit large, don't you think?");
|
||||
}
|
||||
player.removeAttribute("runscript");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue