Browse Source

Rotation conforms with bootstrap version.

master
MagicBot 1 year ago
parent
commit
c4cc6bb92d
  1. 11
      src/engine/net/client/handlers/MinionTrainingMsgHandler.java
  2. 4
      src/engine/objects/AbstractCharacter.java
  3. 2
      src/engine/objects/AbstractWorldObject.java

11
src/engine/net/client/handlers/MinionTrainingMsgHandler.java

@ -160,19 +160,18 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
Building building = BuildingManager.getBuilding(((MinionTrainingMessage) baseMsg).getBuildingID()); Building building = BuildingManager.getBuilding(((MinionTrainingMessage) baseMsg).getBuildingID());
int slot = ((NPC) siegeMob.npcOwner).getSiegeMinionMap().get(siegeMob); int slot = ((NPC) siegeMob.npcOwner).getSiegeMinionMap().get(siegeMob);
Vector3fImmutable slotLocation;
siegeMob.building = building; siegeMob.building = building;
siegeMob.parentZone = zone; siegeMob.parentZone = zone;
BuildingLocation buildingLocation = BuildingManager._slotLocations.get(building.meshUUID).get(slot); BuildingLocation slotLocation = BuildingManager._slotLocations.get(building.meshUUID).get(slot);
slotLocation = building.getLoc().add(buildingLocation.getLocation()); siegeMob.bindLoc = building.getLoc().add(slotLocation.getLocation());
// Rotate slot position by the building rotation // Rotate slot position by the building rotation
slotLocation = Vector3fImmutable.rotateAroundPoint(building.getLoc(), slotLocation, building.getBounds().getQuaternion().angleY); siegeMob.bindLoc = Vector3fImmutable.rotateAroundPoint(building.getLoc(), siegeMob.bindLoc, building.getBounds().getQuaternion().angleY);
siegeMob.setEndLoc(new Vector3fImmutable(slotLocation));
siegeMob.setBindLoc(slotLocation); siegeMob.loc = new Vector3fImmutable(siegeMob.bindLoc);
siegeMob.endLoc = new Vector3fImmutable(siegeMob.bindLoc);
zone.zoneMobSet.add(siegeMob); zone.zoneMobSet.add(siegeMob);
siegeMob.setLoc(siegeMob.getBindLoc()); siegeMob.setLoc(siegeMob.getBindLoc());

4
src/engine/objects/AbstractCharacter.java

@ -60,7 +60,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
protected short statSpiCurrent; protected short statSpiCurrent;
protected short unusedStatPoints; protected short unusedStatPoints;
protected int exp; protected int exp;
protected Vector3fImmutable bindLoc; public Vector3fImmutable bindLoc;
protected Vector3fImmutable faceDir; protected Vector3fImmutable faceDir;
protected Guild guild; protected Guild guild;
protected byte runningTrains; protected byte runningTrains;
@ -71,7 +71,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
protected boolean walkMode; protected boolean walkMode;
protected boolean combat = false; protected boolean combat = false;
protected Vector3fImmutable startLoc = Vector3fImmutable.ZERO; protected Vector3fImmutable startLoc = Vector3fImmutable.ZERO;
protected Vector3fImmutable endLoc = Vector3fImmutable.ZERO; public Vector3fImmutable endLoc = Vector3fImmutable.ZERO;
protected boolean itemCasting = false; protected boolean itemCasting = false;
// nextEndLoc is used to store the next end location when someone is clicking // nextEndLoc is used to store the next end location when someone is clicking
// around the ground while other timers like changeAltitude are still // around the ground while other timers like changeAltitude are still

2
src/engine/objects/AbstractWorldObject.java

@ -48,7 +48,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
public Regions region; public Regions region;
public Regions landingRegion = null; public Regions landingRegion = null;
public Vector3fImmutable lastLoc = Vector3fImmutable.ZERO; public Vector3fImmutable lastLoc = Vector3fImmutable.ZERO;
protected Vector3fImmutable loc = new Vector3fImmutable(0.0f, 0.0f, 0.0f); public Vector3fImmutable loc = new Vector3fImmutable(0.0f, 0.0f, 0.0f);
protected AtomicFloat health = new AtomicFloat(); protected AtomicFloat health = new AtomicFloat();
protected boolean load = true; protected boolean load = true;
protected GridObjectType gridObjectType; protected GridObjectType gridObjectType;

Loading…
Cancel
Save