Browse Source

Serialization update

combat-2
MagicBot 8 months ago
parent
commit
e195d86fb6
  1. 23
      src/engine/net/client/msg/ItemProductionMsg.java

23
src/engine/net/client/msg/ItemProductionMsg.java

@ -11,15 +11,12 @@ package engine.net.client.msg;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.ForgeManager; import engine.gameManager.ForgeManager;
import engine.gameManager.PowersManager;
import engine.mbEnums; import engine.mbEnums;
import engine.mbEnums.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.net.*; import engine.net.*;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.Item; import engine.objects.Item;
import engine.objects.MobLoot;
import engine.objects.NPC; import engine.objects.NPC;
import engine.powers.EffectsBase;
import java.util.HashMap; import java.util.HashMap;
@ -237,25 +234,13 @@ public class ItemProductionMsg extends ClientNetMsg {
writer.putInt(0); writer.putInt(0);
writer.putInt(0); writer.putInt(0);
writer.putInt(1); writer.putInt(1);
MobLoot toRoll = MobLoot.getFromCache(this.itemUUID); Item toRoll = ForgeManager.inMemoryItemLookup.get(this.itemUUID);
writer.putInt(-1497023830); writer.putInt(-1497023830);
if (toRoll != null && toRoll.getPrefix() != null && !toRoll.getPrefix().isEmpty()) { this.pToken = toRoll.prefixToken;
EffectsBase eb = PowersManager.getEffectByIDString(toRoll.getPrefix()); this.sToken = toRoll.suffixToken;
if (eb == null)
this.pToken = 0;
else
this.pToken = eb.getToken();
}
if (toRoll != null && toRoll.getSuffix() != null && !toRoll.getSuffix().isEmpty()) { if (toRoll.isComplete()) {
EffectsBase eb = PowersManager.getEffectByIDString(toRoll.getSuffix());
if (eb == null)
this.sToken = 0;
else
this.sToken = eb.getToken();
}
if (toRoll.isRandom() == false || (toRoll != null && toRoll.isComplete())) {
writer.putInt(this.pToken); writer.putInt(this.pToken);
writer.putInt(this.sToken); writer.putInt(this.sToken);
} else { } else {

Loading…
Cancel
Save