mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 20:16:36 -04:00
Fix /os map delete not outputting anything when used on map you don't own. (Thanks goodlyay)
This commit is contained in:
parent
0d80d86b54
commit
155527e609
@ -120,7 +120,7 @@ namespace MCGalaxy.Commands.Info {
|
||||
else
|
||||
Player.Message(p, "Commands available to " + group.ColoredName + " %Srank:");
|
||||
|
||||
string type = "Commands " + group.Name;
|
||||
string type = "Cmds " + group.Name;
|
||||
if (sort.Length > 0) type += " " + sort;
|
||||
MultiPageOutput.Output(p, cmds,
|
||||
(cmd) => CmdHelp.GetColor(cmd) + cmd.name,
|
||||
|
@ -81,7 +81,7 @@ namespace MCGalaxy.Commands.World {
|
||||
|
||||
static void HandleMap(Player p, string cmd, string value) {
|
||||
cmd = cmd.ToUpper();
|
||||
bool mapOnly = !(cmd == "ADD" || cmd == "DELETE" || cmd.Length == 0);
|
||||
bool mapOnly = !(cmd == "ADD" || cmd.Length == 0);
|
||||
if (mapOnly && !OwnsMap(p, p.level)) {
|
||||
Player.Message(p, "You may only perform that action on your own map."); return;
|
||||
}
|
||||
|
@ -23,13 +23,13 @@ namespace MCGalaxy.Commands.Misc {
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p.lastTeleportMap.Length == 0) {
|
||||
if (p.PreTeleportMap.Length == 0) {
|
||||
Player.Message(p, "You have not teleported anywhere yet"); return;
|
||||
}
|
||||
|
||||
if (!p.level.name.CaselessEq(p.lastTeleportMap))
|
||||
PlayerActions.ChangeMap(p, p.lastTeleportMap);
|
||||
p.SendPos(Entities.SelfID, p.beforeTeleportPos, new Orientation(0, 0));
|
||||
if (!p.level.name.CaselessEq(p.PreTeleportMap))
|
||||
PlayerActions.ChangeMap(p, p.PreTeleportMap);
|
||||
p.SendPos(Entities.SelfID, p.PreTeleportPos, new Orientation(0, 0));
|
||||
}
|
||||
|
||||
public override void Help(Player p) {
|
||||
|
@ -47,8 +47,8 @@ namespace MCGalaxy.Commands.Misc {
|
||||
Help(p); return;
|
||||
}
|
||||
|
||||
p.lastTeleportMap = p.level.name;
|
||||
p.beforeTeleportPos = p.Pos;
|
||||
p.PreTeleportMap = p.level.name;
|
||||
p.PreTeleportPos = p.Pos;
|
||||
Level lvl = bot != null ? bot.level : target.level;
|
||||
|
||||
if (p.level != lvl) PlayerActions.ChangeMap(p, lvl.name);
|
||||
@ -72,6 +72,7 @@ namespace MCGalaxy.Commands.Misc {
|
||||
if (!ParseCoord(p, args[1], p.Pos.Y - Entities.CharacterHeight, "Y", out y)) return;
|
||||
if (!ParseCoord(p, args[2], p.Pos.Z, "Z", out z)) return;
|
||||
|
||||
p.PreTeleportPos = p.Pos;
|
||||
PlayerActions.MoveCoords(p, x, y, z, p.Rot.RotY, p.Rot.HeadX);
|
||||
}
|
||||
|
||||
@ -105,7 +106,7 @@ namespace MCGalaxy.Commands.Misc {
|
||||
public override void Help(Player p) {
|
||||
Player.Message(p, "%T/TP [x y z]");
|
||||
Player.Message(p, "%HTeleports yourself to the given block coordinates.");
|
||||
Player.Message(p, "%H Use ~ before a coordinate to move relative to current position.");
|
||||
Player.Message(p, "%HUse ~ before a coordinate to move relative to current position");
|
||||
Player.Message(p, "%T/TP [player]");
|
||||
Player.Message(p, "%HTeleports yourself to that player.");
|
||||
Player.Message(p, "%T/TP bot [name]");
|
||||
|
@ -208,8 +208,8 @@ namespace MCGalaxy {
|
||||
public bool Loading = true; //True if player is loading a map.
|
||||
internal int UsingGoto = 0, GeneratingMap = 0, LoadingMuseum = 0, UsingDelay = 0;
|
||||
public Vec3U16 lastClick = Vec3U16.Zero;
|
||||
public Position beforeTeleportPos = default(Position);
|
||||
public string lastTeleportMap = "";
|
||||
public Position PreTeleportPos = default(Position);
|
||||
public string PreTeleportMap = "";
|
||||
public string summonedMap;
|
||||
public ushort[] pos = new ushort[3];
|
||||
public byte[] rot = new byte[2];
|
||||
|
Loading…
x
Reference in New Issue
Block a user