Prevent pet training when rider on pet, if rider initiates training dismount

This commit is contained in:
Beny 2019-05-04 07:40:24 +01:00
parent eb0ed7cd2d
commit e5970cb993

View File

@ -8,6 +8,7 @@ import com.eu.habbo.habbohotel.permissions.PermissionSetting;
import com.eu.habbo.habbohotel.pets.Pet; import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.PetCommand; import com.eu.habbo.habbohotel.pets.PetCommand;
import com.eu.habbo.habbohotel.pets.PetVocalsType; import com.eu.habbo.habbohotel.pets.PetVocalsType;
import com.eu.habbo.habbohotel.pets.RideablePet;
import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserTypingComposer; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserTypingComposer;
import com.eu.habbo.plugin.events.users.UserCommandEvent; import com.eu.habbo.plugin.events.users.UserCommandEvent;
@ -267,6 +268,13 @@ public class CommandHandler
{ {
if (command.key.equalsIgnoreCase(s.toString())) if (command.key.equalsIgnoreCase(s.toString()))
{ {
if(pet instanceof RideablePet && ((RideablePet)pet).getRider() != null) {
if(((RideablePet) pet).getRider().getHabboInfo().getId() == gameClient.getHabbo().getHabboInfo().getId()) {
((RideablePet) pet).getRider().getHabboInfo().dismountPet();
}
break;
}
if (command.level <= pet.getLevel()) if (command.level <= pet.getLevel())
pet.handleCommand(command, gameClient.getHabbo(), args); pet.handleCommand(command, gameClient.getHabbo(), args);
else else