Skip to content

Commit

Permalink
When using run() or sudo() from main.ms, it functions properly now.
Browse files Browse the repository at this point in the history
  • Loading branch information
LadyCailin committed Aug 10, 2013
1 parent 38bdaae commit 398fa6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static MCServer Get() {
}

public boolean dispatchCommand(MCCommandSender sender, String command){
return s.dispatchCommand(new BukkitMCCommandSender(sender).c, command);
return s.dispatchCommand(((BukkitMCCommandSender)sender).c, command);
}

public MCPluginManager getPluginManager() {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/laytonsmith/core/AliasCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ public void compileMS(MCPlayer player, Environment env) {
for (FileInfo fi : ms) {
boolean exception = false;
try {
env.getEnv(CommandHelperEnvironment.class).SetCommandSender(Static.getServer().getConsole());
MethodScriptCompiler.registerAutoIncludes(env, null);
MethodScriptCompiler.execute(MethodScriptCompiler.compile(MethodScriptCompiler.lex(fi.contents, fi.file, true)), env, null, null);
} catch (ConfigCompileException e) {
Expand All @@ -551,6 +552,8 @@ public void compileMS(MCPlayer player, Environment env) {
} catch(ProgramFlowManipulationException e){
exception = true;
ConfigRuntimeException.React(ConfigRuntimeException.CreateUncatchableException("Cannot break program flow in main files.", e.getTarget()), env);
} finally {
env.getEnv(CommandHelperEnvironment.class).SetCommandSender(null);
}
if (exception) {
if (Prefs.HaltOnFailure()) {
Expand Down

0 comments on commit 398fa6d

Please sign in to comment.