bugfix-flightfix #18

Merged
MagicBot merged 3 commits from bugfix-flightfix into master 2 years ago
  1. 15
      src/engine/objects/AbstractCharacter.java
  2. 4
      src/engine/objects/PlayerCharacter.java

15
src/engine/objects/AbstractCharacter.java

@ -1600,11 +1600,26 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -1600,11 +1600,26 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
//Call to apply any new effects to player
public synchronized void applyBonuses() {
PlayerCharacter player;
//tell the player to applyBonuses because something has changed
//start running the bonus calculations
try{
runBonuses();
// Check if calculations affected flight.
if (this.getObjectType().equals(GameObjectType.PlayerCharacter)) {
player = (PlayerCharacter) this;
// Ground players who cannot fly but are currently flying
if (CanFly(player) == false &&
player.getMovementState().equals(MovementState.FLYING))
PlayerCharacter.GroundPlayer(player);
}
}catch(Exception e){
Logger.error("Error in run bonuses for object UUID " + this.getObjectUUID());
Logger.error(e);

4
src/engine/objects/PlayerCharacter.java

@ -4781,10 +4781,6 @@ public void dismissNecroPets() { @@ -4781,10 +4781,6 @@ public void dismissNecroPets() {
}finally{
this.updateLock.writeLock().unlock();
}
//temp removal
if(AbstractCharacter.CanFly(this) == false && this.altitude > 0)
GroundPlayer(this);
}
}
@Override

Loading…
Cancel
Save