Improve monster spell range code