forked from MagicBane/Server
update location
This commit is contained in:
@@ -43,6 +43,7 @@ public class MobileFSM {
|
|||||||
}
|
}
|
||||||
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter && canCast(mob)) {
|
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter && canCast(mob)) {
|
||||||
if (MobCast(mob)) {
|
if (MobCast(mob)) {
|
||||||
|
mob.updateLocation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -62,6 +63,7 @@ public class MobileFSM {
|
|||||||
AttackMob(mob, targetMob);
|
AttackMob(mob, targetMob);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
mob.updateLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AttackPlayer(Mob mob, PlayerCharacter target) {
|
public static void AttackPlayer(Mob mob, PlayerCharacter target) {
|
||||||
@@ -384,15 +386,6 @@ public class MobileFSM {
|
|||||||
if (mob.combatTarget != null && mob.combatTarget.isAlive() == false) {
|
if (mob.combatTarget != null && mob.combatTarget.isAlive() == false) {
|
||||||
mob.setCombatTarget(null);
|
mob.setCombatTarget(null);
|
||||||
}
|
}
|
||||||
//mob.updateLocation();
|
|
||||||
//if(mob.getTimestamps().containsKey("MOVEMENTSYNC") == false){
|
|
||||||
// mob.getTimestamps().put("MOVEMENTSYNC",System.currentTimeMillis());
|
|
||||||
//}
|
|
||||||
//if(mob.getTimeStamp("MOVEMENTSYNC") < System.currentTimeMillis() + 1000){
|
|
||||||
// mob.getTimestamps().put("MOVEMENTSYNC",System.currentTimeMillis());
|
|
||||||
|
|
||||||
// mob.setLoc(mob.getMovementLoc());
|
|
||||||
//}
|
|
||||||
switch (mob.BehaviourType) {
|
switch (mob.BehaviourType) {
|
||||||
case GuardCaptain:
|
case GuardCaptain:
|
||||||
GuardCaptainLogic(mob);
|
GuardCaptainLogic(mob);
|
||||||
@@ -461,6 +454,7 @@ public class MobileFSM {
|
|||||||
private static void CheckMobMovement(Mob mob) {
|
private static void CheckMobMovement(Mob mob) {
|
||||||
if (!MovementUtilities.canMove(mob))
|
if (!MovementUtilities.canMove(mob))
|
||||||
return;
|
return;
|
||||||
|
mob.updateLocation();
|
||||||
switch (mob.BehaviourType) {
|
switch (mob.BehaviourType) {
|
||||||
case Pet1:
|
case Pet1:
|
||||||
if(mob.getOwner() == null){
|
if(mob.getOwner() == null){
|
||||||
@@ -604,6 +598,7 @@ public class MobileFSM {
|
|||||||
|
|
||||||
private static void chaseTarget(Mob mob) {
|
private static void chaseTarget(Mob mob) {
|
||||||
mob.updateMovementState();
|
mob.updateMovementState();
|
||||||
|
mob.updateLocation();
|
||||||
if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) {
|
if (CombatUtilities.inRange2D(mob, mob.getCombatTarget(), mob.getRange()) == false) {
|
||||||
if (mob.getRange() > 15) {
|
if (mob.getRange() > 15) {
|
||||||
mob.destination = mob.getCombatTarget().getLoc();
|
mob.destination = mob.getCombatTarget().getLoc();
|
||||||
|
|||||||
@@ -1377,6 +1377,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(e);
|
Logger.error(e);
|
||||||
}
|
}
|
||||||
|
this.updateLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void respawn() {
|
public void respawn() {
|
||||||
@@ -1406,6 +1407,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
//MovementManager.translocate(this, this.bindLoc, this.region);
|
//MovementManager.translocate(this, this.bindLoc, this.region);
|
||||||
if (!this.isSiege && !this.isPlayerGuard && contract == null)
|
if (!this.isSiege && !this.isPlayerGuard && contract == null)
|
||||||
loadInventory();
|
loadInventory();
|
||||||
|
this.updateLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void despawn() {
|
public void despawn() {
|
||||||
|
|||||||
Reference in New Issue
Block a user