From 23a07175e5b6758b624e159ef18552dfa6301d82 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 10 Apr 2023 13:27:27 -0400 Subject: [PATCH] Single map color stored as hex string. --- src/engine/objects/Realm.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/engine/objects/Realm.java b/src/engine/objects/Realm.java index b2f7e22b..26b5a2d0 100644 --- a/src/engine/objects/Realm.java +++ b/src/engine/objects/Realm.java @@ -74,11 +74,11 @@ public class Realm { */ public Realm(ResultSet rs) throws SQLException, UnknownHostException { - this.mapColor = new Color(rs.getInt("mapColor")); - this.mapR = rs.getFloat("mapR"); - this.mapG = rs.getFloat("mapG"); - this.mapB = rs.getFloat("mapB"); - this.mapA = rs.getFloat("mapA"); + this.mapColor = new Color(Integer.parseInt(rs.getString("realmColor"), 16)); + this.mapR = (float) (mapColor.getRed() * 0.00392156863); + this.mapG = (float) (mapColor.getGreen() * 0.00392156863); + this.mapB = (float) (mapColor.getBlue() * 0.00392156863); + this.mapA = 1; this.canBeClaimed = rs.getBoolean("canBeClaimed"); this.canPlaceCities = rs.getBoolean("canPlaceCities"); this.numCities = rs.getInt("numCities");