Temporary Command fixes to prevent you from triggering the commands while on a horse

This commit is contained in:
KrewsOrg 2019-05-04 03:06:12 +01:00
parent 37010f7ab3
commit 1a09c8af3e
4 changed files with 16 additions and 1 deletions

View File

@ -16,6 +16,11 @@ public class FastwalkCommand extends Command
{
if(gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null)
{
if(gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
if (gameClient.getHabbo().getHabboInfo().getRiding() != null) //TODO Make this an event plugin which fires that can be cancelled
return true;
}
Habbo habbo = gameClient.getHabbo();
if(params.length >= 2)

View File

@ -13,6 +13,7 @@ public class SitCommand extends Command
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception
{
if (gameClient.getHabbo().getHabboInfo().getRiding() == null) //TODO Make this an event plugin which fires that can be cancelled
gameClient.getHabbo().getHabboInfo().getCurrentRoom().makeSit(gameClient.getHabbo());
return true;
}

View File

@ -14,6 +14,7 @@ public class TeleportCommand extends Command
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception
{
if (gameClient.getHabbo().getHabboInfo().getRiding() == null) //TODO Make this an event plugin which fires that can be cancelled
if(gameClient.getHabbo().getRoomUnit().cmdTeleport)
{
gameClient.getHabbo().getRoomUnit().cmdTeleport = false;
@ -26,5 +27,6 @@ public class TeleportCommand extends Command
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_teleport.enabled"), RoomChatMessageBubbles.ALERT);
return true;
}
return true;
}
}

View File

@ -161,7 +161,14 @@ public class RoomUnit
if (this.path == null || this.path.isEmpty())
return true;
if (this.fastWalk && this.path.size() >= 3)
boolean canfastwalk = true;
Habbo habboT = room.getHabbo(this);
if(habboT != null) {
if(habboT.getHabboInfo().getRiding() != null)
canfastwalk = false;
}
if (canfastwalk && this.fastWalk && this.path.size() >= 3)
{
this.path.poll();
this.path.poll();