Browse Source

mine HP set to custom value after rebuild

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
7175f79bfe
  1. 5
      src/engine/objects/Building.java
  2. 2
      src/engine/workthreads/HourlyJobThread.java

5
src/engine/objects/Building.java

@ -1035,13 +1035,14 @@ public class Building extends AbstractWorldObject {
// *** Refactor: Can't we just use setRank() for this? // *** Refactor: Can't we just use setRank() for this?
public final void rebuildMine() { public final void rebuildMine(int maxHP) {
this.setRank(1); this.setRank(1);
this.meshUUID = this.getBlueprint().getMeshForRank(this.rank); this.meshUUID = this.getBlueprint().getMeshForRank(this.rank);
// New rank mean new max hitpoints. // New rank mean new max hitpoints.
this.healthMax = this.getBlueprint().getMaxHealth(this.rank); //this.healthMax = this.getBlueprint().getMaxHealth(this.rank);
this.healthMax = maxHP;
this.setCurrentHitPoints(this.healthMax); this.setCurrentHitPoints(this.healthMax);
this.getBounds().setBounds(this); this.getBounds().setBounds(this);
} }

2
src/engine/workthreads/HourlyJobThread.java

@ -164,7 +164,7 @@ public class HourlyJobThread implements Runnable {
mine.nationName = nation.getName(); mine.nationName = nation.getName();
mine.nationTag = nation.getGuildTag(); mine.nationTag = nation.getGuildTag();
mineBuilding.rebuildMine(); mineBuilding.rebuildMine(mine.capSize * 5000);
WorldGrid.updateObject(mineBuilding); WorldGrid.updateObject(mineBuilding);
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mine.lastClaimer.getName() + " has claimed the mine in " + mine.getParentZone().getParent().getName() + " for " + mine.getOwningGuild().getName() + ". The mine is no longer active."); ChatSystemMsg chatMsg = new ChatSystemMsg(null, mine.lastClaimer.getName() + " has claimed the mine in " + mine.getParentZone().getParent().getName() + " for " + mine.getOwningGuild().getName() + ". The mine is no longer active.");

Loading…
Cancel
Save