Resolving some compatibility !

This commit is contained in:
Ad5001 2016-06-10 19:09:16 +02:00
parent 98db40563b
commit 8164e0af6a
2 changed files with 4 additions and 4 deletions

BIN
UHC.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -163,14 +163,14 @@ switch($cmd->getName()){
} }
} }
break; break;
case "scenarios" { case "scenarios":
if(isset($args[2])) { if(isset($args[2])) {
if(isset($this->worlds[$sender->getLevel()->getName()]) and !isset($this->games[$sender->getLevel()->getName()])) { if(isset($this->worlds[$sender->getLevel()->getName()]) and !isset($this->games[$sender->getLevel()->getName()])) {
if(file_exists($this->getDataFolder() . "scenarios/" . $args[2] . ".php")) { // yes, I'm treating args[2] before args[1] but who cares x) ? if(file_exists($this->getDataFolder() . "scenarios/" . $args[2] . ".php")) { // yes, I'm treating args[2] before args[1] but who cares x) ?
switch($args[1]) { switch($args[1]) {
case "add": case "add":
$sl = new \pocketmine\plugin\ScriptPluginLoader($this->getServer()); require_once(realpath($this->getDataFolder() . "scenarios/" . $args[2] . ".php"));
$scenarios[$args[2]] = $sl->load(realpath($this->getDataFolder() . "scenarios/" . $args[2] . ".php")); $scenarios[$args[2]] = new $args[2]();
$scenarios[$args[2]]->onEnable(); $scenarios[$args[2]]->onEnable();
break; break;
case "remove": case "remove":
@ -181,7 +181,7 @@ switch($cmd->getName()){
} }
} }
} }
} break;
} }
return false; return false;
} }