Browse Source

Fidality borking mobs in buildings unborked.

master
MagicBot 2 years ago
parent
commit
2befa063ef
  1. 3
      src/engine/devcmd/cmds/InfoCmd.java
  2. 12
      src/engine/net/client/ClientMessagePump.java
  3. 23
      src/engine/objects/Mob.java

3
src/engine/devcmd/cmds/InfoCmd.java

@ -455,8 +455,7 @@ public class InfoCmd extends AbstractDevCmd {
output += newline; output += newline;
output += "Speed : " + targetMob.getSpeed(); output += "Speed : " + targetMob.getSpeed();
output += newline;
output += "Fidelity ID: " + targetMob.getFidalityID();
output += newline; output += newline;
output += "EquipSet: " + targetMob.getEquipmentSetID(); output += "EquipSet: " + targetMob.getEquipmentSetID();
output += newline; output += newline;

12
src/engine/net/client/ClientMessagePump.java

@ -1130,7 +1130,7 @@ public class ClientMessagePump implements NetMsgHandler {
//Take equipment off mob //Take equipment off mob
if (tar.getObjectType() == GameObjectType.Mob && itemRet != null){ if (tar.getObjectType() == GameObjectType.Mob && itemRet != null){
Mob mobTarget = (Mob)tar; Mob mobTarget = (Mob)tar;
if (mobTarget.getFidalityID() != 0){
if (item != null && item.getObjectType() == GameObjectType.MobLoot){ if (item != null && item.getObjectType() == GameObjectType.MobLoot){
int fidelityEquipID = ((MobLoot)item).getFidelityEquipID(); int fidelityEquipID = ((MobLoot)item).getFidelityEquipID();
@ -1148,20 +1148,10 @@ public class ClientMessagePump implements NetMsgHandler {
} }
} }
} }
} }
} }
} }
} }
}
else {
}
} }
else if (targetType == GameObjectType.Corpse.ordinal()) { else if (targetType == GameObjectType.Corpse.ordinal()) {
corpse = Corpse.getCorpse(targetID); corpse = Corpse.getCorpse(targetID);

23
src/engine/objects/Mob.java

@ -1222,6 +1222,8 @@ public class Mob extends AbstractIntelligenceAgent {
return this.parentZone; return this.parentZone;
} }
public void setParentZone(Zone zone) { public void setParentZone(Zone zone) {
if (this.parentZone == null){ if (this.parentZone == null){
@ -1229,10 +1231,23 @@ public class Mob extends AbstractIntelligenceAgent {
this.parentZone = zone; this.parentZone = zone;
} }
this.bindLoc = Mob.GetSpawnRadiusLocation(this); if (this.building != null) {
this.lastBindLoc = bindLoc;
this.setLoc(bindLoc); Vector3fImmutable localLoc = new Vector3fImmutable(this.statLat,this.statAlt,this.statLon);
this.stopMovement(bindLoc); Vector3fImmutable buildingWorldLoc = ZoneManager.convertLocalToWorld(this.building, localLoc);
this.setBindLoc(buildingWorldLoc);
this.setLoc(buildingWorldLoc);
this.stopMovement(buildingWorldLoc);
return;
}
Vector3fImmutable localLoc = new Vector3fImmutable(this.statLat + zone.absX, this.statAlt + zone.absY, this.statLon + zone.absZ);
Vector3fImmutable spawnRadiusLoc = Vector3fImmutable.getRandomPointInCircle(localLoc, this.spawnRadius);
this.setBindLoc(spawnRadiusLoc);
this.setLoc(spawnRadiusLoc);
this.stopMovement(spawnRadiusLoc);
} }
public int getParentZoneID() { public int getParentZoneID() {

Loading…
Cancel
Save