elanthia-online / illthorn

Electron-based FE
18 stars 10 forks source link

Adds a fallback in case a spell isn't found in spells.json #104

Closed BryanSchuetz closed 4 years ago

BryanSchuetz commented 4 years ago

Master branch was throwing errors in game for me this morning...when spellDetail was left undefined because spell.name could not be found in spells.json.

So...this just checks to see if spellDetail is defined, and if not reverts to using spell.name.

ondreian commented 4 years ago

This is fine for now, but eventually we will want to use spells.json to create in-memory lookup tables at startup so that we can use Lens for more strict safety and turn these O(n) operations into O(1)