From 5c4b97dfc3cd1d8e7bb4743cdfd9b5ba1860b737 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 12 Jul 2009 09:09:53 +0000 Subject: [PATCH] reduced volcano chance --- src/common/gamecode/randenc.c | 2 +- src/common/kernel/save.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/gamecode/randenc.c b/src/common/gamecode/randenc.c index 4f958ce1f..af0c91dbc 100644 --- a/src/common/gamecode/randenc.c +++ b/src/common/gamecode/randenc.c @@ -1235,7 +1235,7 @@ randomevents(void) if (rng_int()%100 < 12) { ADDMSG(&r->msgs, msg_message("volcanostopsmoke", "region", r)); rsetterrain(r, T_VOLCANO); - } else if (rng_int()%100 < 8) { + } else if (r->age>20 && rng_int()%100 < 8) { volcano_outbreak(r); } } diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index 9e38dbf61..e7027ac40 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -659,6 +659,7 @@ read_unit(struct storage * store) char rname[32]; n = store->r_id(store); + if (n<=0) return NULL; u = findunit(n); if (u==NULL) { u = calloc(sizeof(unit), 1); @@ -731,7 +732,7 @@ read_unit(struct storage * store) set_number(u, 0); } - if (count_unit(u)) u->faction->no_units++; + if (count_unit(u) && u->faction) u->faction->no_units++; set_number(u, number);