mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Fixed pet action ActionPlayFootball
This commit is contained in:
parent
ef84be59d0
commit
61d7b0e66d
@ -1,9 +1,12 @@
|
||||
package com.eu.habbo.habbohotel.pets.actions;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPushable;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.pets.PetAction;
|
||||
import com.eu.habbo.habbohotel.pets.PetVocalsType;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
|
||||
public class ActionPlayFootball extends PetAction {
|
||||
public ActionPlayFootball() {
|
||||
@ -12,6 +15,25 @@ public class ActionPlayFootball extends PetAction {
|
||||
|
||||
@Override
|
||||
public boolean apply(Pet pet, Habbo habbo, String[] data) {
|
||||
|
||||
Room room = pet.getRoom();
|
||||
|
||||
if(room == null || room.getLayout() == null)
|
||||
return false;
|
||||
|
||||
HabboItem foundBall = null;
|
||||
|
||||
for(HabboItem item : room.getFloorItems()) {
|
||||
if(item instanceof InteractionPushable) {
|
||||
foundBall = item;
|
||||
}
|
||||
}
|
||||
|
||||
if(foundBall == null)
|
||||
return false;
|
||||
|
||||
pet.getRoomUnit().setGoalLocation(room.getLayout().getTile(foundBall.getX(), foundBall.getY()));
|
||||
|
||||
if (pet.getHappyness() > 75)
|
||||
pet.say(pet.getPetData().randomVocal(PetVocalsType.PLAYFUL));
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user