diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-18 18:12:27 -0700 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-18 18:12:27 -0700 |
commit | 0dc73bc54f7f6077f0699cc07556ca10a8433525 (patch) | |
tree | f966ceddb97fef90d2f3aee9cc16417fd38f5359 /crawl-ref/source/arena.cc | |
parent | 5d359c101cd3b8e0d41fffdf670e02bd0d7c3c50 (diff) | |
download | crawl-ref-0dc73bc54f7f6077f0699cc07556ca10a8433525.tar.gz crawl-ref-0dc73bc54f7f6077f0699cc07556ca10a8433525.zip |
arena.cc: Avoid divide-by-zero error
Diffstat (limited to 'crawl-ref/source/arena.cc')
-rw-r--r-- | crawl-ref/source/arena.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc index f3ff332ab9..1617f916d0 100644 --- a/crawl-ref/source/arena.cc +++ b/crawl-ref/source/arena.cc @@ -659,6 +659,14 @@ namespace arena if (a_spawners.size() == 0 || b_spawners.size() == 0) return; + if (faction_a.active_members == 0 || faction_b.active_members == 0) + { + mpr("ERROR: Both sides have spawners, but the active member " + "count of one side has been reduced to zero!", MSGCH_ERROR); + more(); + return; + } + for (unsigned int i = 0; i < a_spawners.size(); i++) { int idx = a_spawners[i]; |