Browse Source

Revert method refactor.

master
MagicBot 2 years ago
parent
commit
1c228df4a8
  1. 4
      src/engine/net/client/msg/guild/GuildInfoMsg.java
  2. 20
      src/engine/objects/Guild.java

4
src/engine/net/client/msg/guild/GuildInfoMsg.java

@ -373,7 +373,7 @@ class GuildInfoMessageType5 extends GuildInfoMessageType {
if(pc != null && g != null && g.getObjectUUID() != 0) { if(pc != null && g != null && g.getObjectUUID() != 0) {
Guild n = g.getNation(); Guild n = g.getNation();
if(n == null) { if(n == null) {
n = Guild.getErrantGuild(); n = Guild.getErrantNation();
} }
writer.putInt(ago.getObjectType().ordinal()); writer.putInt(ago.getObjectType().ordinal());
@ -412,7 +412,7 @@ class GuildInfoMessageType5 extends GuildInfoMessageType {
writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); //Title writer.putInt(GuildStatusController.getTitle(pc.getGuildStatus())); //Title
writer.putInt(g.getCharter()); writer.putInt(g.getCharter());
if(g.getNation().equals(Guild.getErrantGuild())) if(g.getNation().equals(Guild.getErrantNation()))
writer.putString("Errant"); writer.putString("Errant");
else else
writer.putString("City"); writer.putString("City");

20
src/engine/objects/Guild.java

@ -81,6 +81,9 @@ public class Guild extends AbstractWorldObject {
private String hash; private String hash;
private boolean ownerIsNPC; private boolean ownerIsNPC;
private static Guild errantGuild;
private static Guild errantNation;
public LocalDateTime lastWooEditTime; public LocalDateTime lastWooEditTime;
public HashMap<Integer,GuildAlliances> guildAlliances = new HashMap<>(); public HashMap<Integer,GuildAlliances> guildAlliances = new HashMap<>();
@ -407,7 +410,7 @@ public class Guild extends AbstractWorldObject {
*/ */
public boolean isErrant() { public boolean isErrant() {
return this.getObjectUUID() == Guild.errant.getObjectUUID(); return this.getObjectUUID() == Guild.errantGuild.getObjectUUID();
} }
@ -721,14 +724,19 @@ Guild.serializeForClientMsg(guild,writer, null, false);
} }
private static Guild errant;
public static Guild getErrantGuild() { public static Guild getErrantGuild() {
if (Guild.errant == null) if (Guild.errantGuild == null)
Guild.errant = new Guild("None", null, 10, "Despot Rule", GuildTag.ERRANT, 0); Guild.errantGuild = new Guild( "None", Guild.getErrantNation(), 0,
"Anarchy", GuildTag.ERRANT, 0);
return Guild.errantGuild;
}
return Guild.errant; public static Guild getErrantNation() {
if (Guild.errantNation == null)
Guild.errantNation = new Guild("None", null, 10, "Despot Rule", GuildTag.ERRANT, 0);
return Guild.errantNation;
} }
public static Guild getGuild(final int objectUUID) { public static Guild getGuild(final int objectUUID) {

Loading…
Cancel
Save