… | |
… | |
126 | level = lerp (level, (int)spell->level, 100, 1, 100); |
126 | level = lerp (level, (int)spell->level, 100, 1, 100); |
127 | |
127 | |
128 | /* Always make this at least 1. If this is zero, we get divide by zero |
128 | /* Always make this at least 1. If this is zero, we get divide by zero |
129 | * errors in various places. |
129 | * errors in various places. |
130 | */ |
130 | */ |
131 | return max (level, 1); |
131 | return clamp (level, 1, settings.max_level); |
132 | } |
132 | } |
133 | |
133 | |
134 | /* The following function scales the spellpoint cost of |
134 | /* The following function scales the spellpoint cost of |
135 | * a spell by it's increased effectiveness. Some of the |
135 | * a spell by it's increased effectiveness. Some of the |
136 | * lower level spells become incredibly vicious at high |
136 | * lower level spells become incredibly vicious at high |