From 54ae00bb7d204fc69ee109ed6a4e07a0016714c8 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 25 Dec 2017 21:55:50 +0100 Subject: [PATCH] bug 2156: fix volcano reporting, maybe. --- src/volcano.c | 2 +- src/volcano.test.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/volcano.c b/src/volcano.c index fe4ce7dd3..d90ef47ee 100644 --- a/src/volcano.c +++ b/src/volcano.c @@ -225,7 +225,7 @@ volcano_destruction(region * volcano, region * r, const char *damage) if (!fval(u->faction, FFL_SELECT)) { fset(u->faction, FFL_SELECT); ADDMSG(&u->faction->msgs, msg_message("volcanooutbreaknn", - "region", r)); + "region", volcano)); } } if (u == *up) { diff --git a/src/volcano.test.c b/src/volcano.test.c index 3afa49651..693a029b4 100644 --- a/src/volcano.test.c +++ b/src/volcano.test.c @@ -43,6 +43,7 @@ static void test_volcano_outbreak(CuTest *tc) { test_setup(); mt_register(mt_new_va("volcanooutbreak", "regionv:region", "regionn:region", 0)); + mt_register(mt_new_va("volcanooutbreaknn", "region:region", 0)); mt_register(mt_new_va("volcano_dead", "unit:unit", "region:region", "dead:int", 0)); t_volcano = test_create_terrain("volcano", LAND_REGION); t_active = test_create_terrain("activevolcano", LAND_REGION); @@ -66,6 +67,9 @@ static void test_volcano_outbreak(CuTest *tc) { CuAssertPtrEquals(tc, r, m->parameters[0].v); CuAssertPtrEquals(tc, rn, m->parameters[1].v); + CuAssertPtrNotNull(tc, m = test_find_messagetype(f->msgs, "volcanooutbreaknn")); + CuAssertPtrEquals(tc, r, m->parameters[0].v); + CuAssertPtrNotNull(tc, m = test_find_messagetype_ex(f->msgs, "volcano_dead", NULL)); CuAssertPtrEquals(tc, u1, m->parameters[0].v); CuAssertPtrEquals(tc, r, m->parameters[1].v);