|
@@ -103,18 +103,15 @@ public class CommandScript extends Command {
|
|
try {
|
|
try {
|
|
if(arg[1].equals("all")) {
|
|
if(arg[1].equals("all")) {
|
|
scripts.clearPlayerRegistry();
|
|
scripts.clearPlayerRegistry();
|
|
- if(scripts.getScriptManager().removeScriptsSafe()) {
|
|
|
|
- sendMessage(cs, "All active scripts were terminated.");
|
|
|
|
- } else {
|
|
|
|
- sendMessage(cs, "Iterating is not allowed currently.");
|
|
|
|
- }
|
|
|
|
|
|
+ scripts.getScriptManager().removeScripts();
|
|
|
|
+ sendMessage(cs, "All active scripts were terminated.");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
int id = Integer.parseInt(arg[1]);
|
|
int id = Integer.parseInt(arg[1]);
|
|
- Script qd = scripts.getScriptManager().getScript(id);
|
|
|
|
- if(qd != null) {
|
|
|
|
- scripts.getScriptManager().removeScriptSafe(qd);
|
|
|
|
- sendMessage(cs, String.format("Script '%s' was terminated.", qd.getName()));
|
|
|
|
|
|
+ Script sc = scripts.getScriptManager().getScript(id);
|
|
|
|
+ if(sc != null) {
|
|
|
|
+ scripts.getScriptManager().removeScript(sc);
|
|
|
|
+ sendMessage(cs, String.format("Script '%s' was terminated.", sc.getName()));
|
|
} else {
|
|
} else {
|
|
sendMessage(cs, String.format("Script id '%d' is not valid.", id));
|
|
sendMessage(cs, String.format("Script id '%d' is not valid.", id));
|
|
}
|
|
}
|