Skip spells with missing glyph data and print a warning to the console instead, fixes #384

This commit is contained in:
Electroblob77
2020-03-31 21:54:15 +01:00
parent a384a57622
commit bdf5aa5b64
@@ -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));