mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-31 12:22:36 +01:00
Fix InteractionGymEquipment
This commit is contained in:
parent
b97aeca766
commit
9d54879dd3
@ -7,6 +7,8 @@ import com.eu.habbo.habbohotel.items.ICycleable;
|
|||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
import com.eu.habbo.habbohotel.rooms.*;
|
import com.eu.habbo.habbohotel.rooms.*;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
|
import com.eu.habbo.habbohotel.users.HabboGender;
|
||||||
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@ -55,13 +57,40 @@ public class InteractionGymEquipment extends InteractionEffectTile implements IC
|
|||||||
@Override
|
@Override
|
||||||
public void onWalkOff(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
public void onWalkOff(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||||
super.onWalkOff(roomUnit, room, objects);
|
super.onWalkOff(roomUnit, room, objects);
|
||||||
room.giveEffect(roomUnit, 0, -1);
|
|
||||||
|
|
||||||
if (this.forceRotation()) {
|
if (room == null) return;
|
||||||
roomUnit.canRotate = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.reset(room);
|
this.reset(room);
|
||||||
|
|
||||||
|
if (roomUnit != null) {
|
||||||
|
Habbo habbo = room.getHabbo(roomUnit);
|
||||||
|
HabboItem topItem = room.getTopItemAt(roomUnit.getCurrentLocation().x, roomUnit.getCurrentLocation().y);
|
||||||
|
int nextEffectM = 0;
|
||||||
|
int nextEffectF = 0;
|
||||||
|
int nextEffectDuration = -1;
|
||||||
|
|
||||||
|
if (topItem != null) {
|
||||||
|
nextEffectM = topItem.getBaseItem().getEffectM();
|
||||||
|
nextEffectF = topItem.getBaseItem().getEffectF();
|
||||||
|
} else if (roomUnit.getPreviousEffectId() > 0) {
|
||||||
|
nextEffectF = roomUnit.getPreviousEffectId();
|
||||||
|
nextEffectM = roomUnit.getPreviousEffectId();
|
||||||
|
nextEffectDuration = roomUnit.getPreviousEffectEndTimestamp();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.forceRotation()) {
|
||||||
|
roomUnit.canRotate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (habbo.getHabboInfo().getGender().equals(HabboGender.M)) {
|
||||||
|
room.giveEffect(habbo, nextEffectM, nextEffectDuration, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (habbo.getHabboInfo().getGender().equals(HabboGender.F)) {
|
||||||
|
room.giveEffect(habbo, nextEffectF, nextEffectDuration, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String achievementName() {
|
public String achievementName() {
|
||||||
|
@ -4162,12 +4162,12 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void giveEffect(Habbo habbo, int effectId, int duration, boolean ignoreChecks) {
|
public void giveEffect(Habbo habbo, int effectId, int duration, boolean ignoreChecks) {
|
||||||
if (this.currentHabbos.containsKey(habbo.getHabboInfo().getId())) {
|
if (habbo != null && habbo.getRoomUnit() != null && this.currentHabbos.containsKey(habbo.getHabboInfo().getId())) {
|
||||||
this.giveEffect(habbo.getRoomUnit(), effectId, duration, ignoreChecks);
|
this.giveEffect(habbo.getRoomUnit(), effectId, duration, ignoreChecks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void giveEffect(Habbo habbo, int effectId, int duration) {
|
public void giveEffect(Habbo habbo, int effectId, int duration) {
|
||||||
if (this.currentHabbos.containsKey(habbo.getHabboInfo().getId())) {
|
if (habbo != null && habbo.getRoomUnit() != null && this.currentHabbos.containsKey(habbo.getHabboInfo().getId())) {
|
||||||
this.giveEffect(habbo.getRoomUnit(), effectId, duration, false);
|
this.giveEffect(habbo.getRoomUnit(), effectId, duration, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user