From 0dc73bc54f7f6077f0699cc07556ca10a8433525 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Sun, 18 Oct 2009 18:12:27 -0700 Subject: arena.cc: Avoid divide-by-zero error --- crawl-ref/source/arena.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crawl-ref/source/arena.cc') 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]; -- cgit v1.2.3-54-g00ecf