mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 15:20:52 +01:00
Fix bot z position saving and sending
This commit is contained in:
parent
9b062bd760
commit
aff9e75fe1
@ -764,7 +764,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
bot.getRoomUnit().setPreviousLocationZ(topItem.getZ());
|
bot.getRoomUnit().setPreviousLocationZ(topItem.getZ());
|
||||||
bot.getRoomUnit().setRotation(RoomUserRotation.fromValue(topItem.getRotation()));
|
bot.getRoomUnit().setRotation(RoomUserRotation.fromValue(topItem.getRotation()));
|
||||||
} else {
|
} else {
|
||||||
bot.getRoomUnit().setZ(topItem.getZ() + topItem.getBaseItem().getHeight());
|
bot.getRoomUnit().setZ(topItem.getZ() + Item.getCurrentHeight(topItem));
|
||||||
|
|
||||||
if (topItem.getBaseItem().allowLay()) {
|
if (topItem.getBaseItem().allowLay()) {
|
||||||
bot.getRoomUnit().setStatus(RoomUnitStatus.LAY, (topItem.getZ() + topItem.getBaseItem().getHeight()) + "");
|
bot.getRoomUnit().setStatus(RoomUnitStatus.LAY, (topItem.getZ() + topItem.getBaseItem().getHeight()) + "");
|
||||||
@ -772,6 +772,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bot.getRoomUnit().setZ(bot.getRoomUnit().getCurrentLocation().getStackHeight());
|
bot.getRoomUnit().setZ(bot.getRoomUnit().getCurrentLocation().getStackHeight());
|
||||||
|
bot.getRoomUnit().setPreviousLocationZ(bot.getRoomUnit().getCurrentLocation().getStackHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
roomUnits.add(bot.getRoomUnit());
|
roomUnits.add(bot.getRoomUnit());
|
||||||
@ -1604,7 +1605,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
this.dance(unit, DanceType.NONE);
|
this.dance(unit, DanceType.NONE);
|
||||||
//int tileHeight = this.layout.getTile(topItem.getX(), topItem.getY()).z;
|
//int tileHeight = this.layout.getTile(topItem.getX(), topItem.getY()).z;
|
||||||
unit.setStatus(RoomUnitStatus.SIT, (Item.getCurrentHeight(topItem) * 1.0D) + "");
|
unit.setStatus(RoomUnitStatus.SIT, (Item.getCurrentHeight(topItem) * 1.0D) + "");
|
||||||
unit.setPreviousLocationZ(topItem.getZ());
|
|
||||||
unit.setZ(topItem.getZ());
|
unit.setZ(topItem.getZ());
|
||||||
unit.setRotation(RoomUserRotation.values()[topItem.getRotation()]);
|
unit.setRotation(RoomUserRotation.values()[topItem.getRotation()]);
|
||||||
unit.sitUpdate = false;
|
unit.sitUpdate = false;
|
||||||
|
@ -770,7 +770,7 @@ public class RoomManager {
|
|||||||
habbo.getClient().sendResponse(new RoomUserDanceComposer(bot.getRoomUnit()));
|
habbo.getClient().sendResponse(new RoomUserDanceComposer(bot.getRoomUnit()));
|
||||||
}
|
}
|
||||||
|
|
||||||
habbo.getClient().sendResponse(new RoomUserStatusComposer(bot.getRoomUnit()));
|
habbo.getClient().sendResponse(new RoomUserStatusComposer(bot.getRoomUnit(), bot.getRoomUnit().getZ()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,12 +14,18 @@ import java.util.Map;
|
|||||||
public class RoomUserStatusComposer extends MessageComposer {
|
public class RoomUserStatusComposer extends MessageComposer {
|
||||||
private Collection<Habbo> habbos;
|
private Collection<Habbo> habbos;
|
||||||
private THashSet<RoomUnit> roomUnits;
|
private THashSet<RoomUnit> roomUnits;
|
||||||
|
private double overrideZ = -1;
|
||||||
|
|
||||||
public RoomUserStatusComposer(RoomUnit roomUnit) {
|
public RoomUserStatusComposer(RoomUnit roomUnit) {
|
||||||
this.roomUnits = new THashSet<>();
|
this.roomUnits = new THashSet<>();
|
||||||
this.roomUnits.add(roomUnit);
|
this.roomUnits.add(roomUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RoomUserStatusComposer(RoomUnit roomUnit, double overrideZ) {
|
||||||
|
this(roomUnit);
|
||||||
|
this.overrideZ = overrideZ;
|
||||||
|
}
|
||||||
|
|
||||||
public RoomUserStatusComposer(THashSet<RoomUnit> roomUnits, boolean value) {
|
public RoomUserStatusComposer(THashSet<RoomUnit> roomUnits, boolean value) {
|
||||||
this.roomUnits = roomUnits;
|
this.roomUnits = roomUnits;
|
||||||
}
|
}
|
||||||
@ -37,7 +43,7 @@ public class RoomUserStatusComposer extends MessageComposer {
|
|||||||
this.response.appendInt(roomUnit.getId());
|
this.response.appendInt(roomUnit.getId());
|
||||||
this.response.appendInt(roomUnit.getPreviousLocation().x);
|
this.response.appendInt(roomUnit.getPreviousLocation().x);
|
||||||
this.response.appendInt(roomUnit.getPreviousLocation().y);
|
this.response.appendInt(roomUnit.getPreviousLocation().y);
|
||||||
this.response.appendString(roomUnit.getPreviousLocationZ() + "");
|
this.response.appendString((this.overrideZ != -1 ? this.overrideZ : roomUnit.getPreviousLocationZ()) + "");
|
||||||
|
|
||||||
|
|
||||||
this.response.appendInt(roomUnit.getHeadRotation().getValue());
|
this.response.appendInt(roomUnit.getHeadRotation().getValue());
|
||||||
|
Loading…
Reference in New Issue
Block a user