diff --git a/src/engine/objects/Mine.java b/src/engine/objects/Mine.java index f201d010..b54af98b 100644 --- a/src/engine/objects/Mine.java +++ b/src/engine/objects/Mine.java @@ -29,6 +29,7 @@ import engine.gameManager.*; import engine.net.ByteBufferWriter; import engine.net.client.msg.ErrorPopupMsg; import engine.server.MBServerStatics; +import engine.server.world.WorldServer; import engine.session.SessionID; import org.pmw.tinylog.Logger; @@ -40,8 +41,7 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.concurrent.ConcurrentHashMap; -import static engine.gameManager.DbManager.MineQueries; -import static engine.gameManager.DbManager.getObject; +import static engine.gameManager.DbManager.*; import static engine.math.FastMath.sqr; public class Mine extends AbstractGameObject { @@ -511,6 +511,10 @@ try{ this.owningGuild = null; Mine.setLastChange(System.currentTimeMillis()); + // Update database + + DbManager.MineQueries.CHANGE_OWNER(this, 0); + // remove hirelings Building building = (Building) getObject(Enum.GameObjectType.Building, this.buildingID);