mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 21:48:43 +01:00
Fix possible bugs with test & play commands
This commit is contained in:
parent
3c80c7635f
commit
1499f71a28
@ -70,7 +70,7 @@ public class PlayCommand extends DCommand {
|
|||||||
if ( !GameWorld.canPlayDungeon(identifier, player)) {
|
if ( !GameWorld.canPlayDungeon(identifier, player)) {
|
||||||
File file = new File(plugin.getDataFolder() + "/maps/" + identifier + "/config.yml");
|
File file = new File(plugin.getDataFolder() + "/maps/" + identifier + "/config.yml");
|
||||||
|
|
||||||
if (file != null) {
|
if (file.exists()) {
|
||||||
WorldConfig confReader = new WorldConfig(file);
|
WorldConfig confReader = new WorldConfig(file);
|
||||||
|
|
||||||
if (confReader != null) {
|
if (confReader != null) {
|
||||||
@ -96,6 +96,12 @@ public class PlayCommand extends DCommand {
|
|||||||
dGroup.setGameWorld(GameWorld.load(DGroup.getByPlayer(player).getMapName()));
|
dGroup.setGameWorld(GameWorld.load(DGroup.getByPlayer(player).getMapName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dGroup.getGameWorld() == null) {
|
||||||
|
MessageUtil.sendMessage(player, dMessages.getMessage(Messages.ERROR_NOT_SAVED, DGroup.getByPlayer(player).getMapName()));
|
||||||
|
dGroup.remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (dGroup.getGameWorld().getLocLobby() == null) {
|
if (dGroup.getGameWorld().getLocLobby() == null) {
|
||||||
new DPlayer(player, dGroup.getGameWorld().getWorld(), dGroup.getGameWorld().getWorld().getSpawnLocation(), false);
|
new DPlayer(player, dGroup.getGameWorld().getWorld(), dGroup.getGameWorld().getWorld().getSpawnLocation(), false);
|
||||||
|
|
||||||
|
@ -72,6 +72,12 @@ public class TestCommand extends DCommand {
|
|||||||
dGroup.setGameWorld(GameWorld.load(DGroup.getByPlayer(player).getMapName()));
|
dGroup.setGameWorld(GameWorld.load(DGroup.getByPlayer(player).getMapName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dGroup.getGameWorld() == null) {
|
||||||
|
MessageUtil.sendMessage(player, dMessages.getMessage(Messages.ERROR_NOT_SAVED, DGroup.getByPlayer(player).getMapName()));
|
||||||
|
dGroup.remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DPlayer newDPlayer;
|
DPlayer newDPlayer;
|
||||||
|
|
||||||
if (dGroup.getGameWorld().getLocLobby() == null) {
|
if (dGroup.getGameWorld().getLocLobby() == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user