Runegates and portals now loaded from database.

This commit is contained in:
2023-02-15 12:12:30 -05:00
parent 9fa83fc359
commit 2c0a46e652
12 changed files with 163 additions and 341 deletions
+4 -10
View File
@@ -2183,23 +2183,17 @@ boolean updateCity = false;
Building rg = null;
Vector3fImmutable rgLoc;
for (Runegate runegate : Runegate.getRunegates()) {
for (Runegate runegate : Runegate._runegates.values()) {
if ((runegate.getGateType() == RunegateType.OBLIV) ||
(runegate.getGateType() == RunegateType.CHAOS))
continue;
for (Runegate thisGate : Runegate.getRunegates()) {
rgLoc = thisGate.getGateType().getGateBuilding().getLoc();
rgLoc = runegate.gateBuilding.getLoc();
float distanceSquaredToRunegate = player.getLoc().distanceSquared2D(rgLoc);
if (distanceSquaredToRunegate < sqr(dist))
rg = thisGate.getGateType().getGateBuilding();
rg = runegate.gateBuilding;
}
}
//nearest runegate found. teleport characterTarget
if (rg != null) {
@@ -10,7 +10,6 @@
package engine.net.client.msg;
import engine.Enum;
import engine.Enum.RunegateType;
import engine.gameManager.DbManager;
import engine.net.AbstractConnection;
import engine.net.ByteBufferReader;
@@ -128,11 +127,10 @@ public class WorldObjectMsg extends ClientNetMsg {
if (this.updateRunegates) {
writer.put((byte) 0);
writer.putInt(RunegateType.values().length);
writer.putInt(Runegate._runegates.values().size());
for(RunegateType gateType : engine.Enum.RunegateType.values()) {
Runegate.getRunegates()[gateType.ordinal()]._serializeForEnterWorld(writer);
for(Runegate runegate : Runegate._runegates.values()) {
runegate._serializeForEnterWorld(writer);
}
} else
writer.put((byte) 1);
@@ -210,11 +208,10 @@ public class WorldObjectMsg extends ClientNetMsg {
// Serialize runegates
temp.putInt(RunegateType.values().length);
temp.putInt(Runegate._runegates.values().size());
for(RunegateType gateType : engine.Enum.RunegateType.values()) {
Runegate.getRunegates()[gateType.ordinal()]._serializeForEnterWorld(temp);
for(Runegate runegate : Runegate._runegates.values()) {
runegate._serializeForEnterWorld(temp);
}
ArrayList<Mine> mineList = new ArrayList<>();