From bdf5aa5b640db960b77d2698472d3ffbe090f27e Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Tue, 31 Mar 2020 21:54:15 +0100 Subject: [PATCH] Skip spells with missing glyph data and print a warning to the console instead, fixes #384 --- src/main/java/electroblob/wizardry/client/ClientProxy.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/electroblob/wizardry/client/ClientProxy.java b/src/main/java/electroblob/wizardry/client/ClientProxy.java index 7b4f2e6e..e97e0e62 100644 --- a/src/main/java/electroblob/wizardry/client/ClientProxy.java +++ b/src/main/java/electroblob/wizardry/client/ClientProxy.java @@ -553,6 +553,12 @@ public class ClientProxy extends CommonProxy { data.randomDescriptions = new HashMap<>(); for(Spell spell : Spell.getAllSpells()){ + + if(spell.networkID() > message.names.size()){ + Wizardry.logger.warn("Received no glyph data for spell {}, skipping", spell.getRegistryName()); + continue; + } + // -1 because the none spell isn't included // This is a case where we must use the network ID, not the metadata data.randomNames.put(spell, message.names.get(spell.networkID() - 1));