diff options
-rw-r--r-- | crawl-ref/source/output.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index d10f59bf13..5e13a43e1a 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -97,8 +97,11 @@ void print_stats(void) if (you.redraw_magic_points) { - - const int mp_percent = (you.magic_points * 100) / you.max_magic_points; + int mp_percent; + if ( you.max_magic_points ) + mp_percent = (you.magic_points * 100) / you.max_magic_points; + else + mp_percent = 100; for ( unsigned int i = 0; i < Options.mp_colour.size(); ++i ) { if ( i+1 == Options.mp_colour.size() || |