Changed an if block to test spellcasting.