diff --git a/src/kernel/ship.c b/src/kernel/ship.c index 234a91631..79918806d 100644 --- a/src/kernel/ship.c +++ b/src/kernel/ship.c @@ -332,7 +332,7 @@ int shipspeed(const ship * sh, const unit * u) return 0; if (sh->attribs) { - if (curse_active(get_curse(sh->attribs, ct_find("stormwind")))) { + if (curse_active(get_curse(sh->attribs, &ct_stormwind))) { k *= 2; } if (curse_active(get_curse(sh->attribs, ct_find("nodrift")))) { diff --git a/src/kernel/ship.test.c b/src/kernel/ship.test.c index 541ddee9a..ea1474e56 100644 --- a/src/kernel/ship.test.c +++ b/src/kernel/ship.test.c @@ -432,8 +432,11 @@ static void test_shipspeed_stormwind(CuTest *tc) { register_shipcurse(); assert(sh && cap && crew); - create_curse(0, &sh->attribs, ct_find("stormwind"), 1, 1, 1, 0); + create_curse(0, &sh->attribs, &ct_stormwind, 1, 1, 1, 0); + CuAssertPtrNotNull(tc, sh->attribs); CuAssertIntEquals_Msg(tc, "stormwind doubles ship range", sh->type->range * 2, shipspeed(sh, cap)); + a_age(&sh->attribs, sh); + CuAssertPtrEquals(tc, NULL, sh->attribs); test_cleanup(); } diff --git a/src/spells.c b/src/spells.c index 7931be8b8..85db5d63d 100644 --- a/src/spells.c +++ b/src/spells.c @@ -2276,7 +2276,7 @@ static int sp_stormwinds(castorder * co) } /* Duration = 1, nur diese Runde */ - create_curse(mage, &sh->attribs, ct_find("stormwind"), power, 1, + create_curse(mage, &sh->attribs, &ct_stormwind, power, 1, zero_effect, 0); /* Da der Spruch nur diese Runde wirkt wird er nie im Report * erscheinen */ diff --git a/src/spells/shipcurse.c b/src/spells/shipcurse.c index 0295695a1..a6e52f3a3 100644 --- a/src/spells/shipcurse.c +++ b/src/spells/shipcurse.c @@ -72,8 +72,8 @@ static message *cinfo_shipnodrift(const void *obj, objtype_t typ, const curse * return msg_message("curseinfo::shipnodrift_0", "ship id", sh, c->no); } -static struct curse_type ct_stormwind = { "stormwind", -CURSETYP_NORM, CURSE_NOAGE, NO_MERGE, cinfo_ship +const struct curse_type ct_stormwind = { "stormwind", +CURSETYP_NORM, 0, NO_MERGE, cinfo_ship }; static struct curse_type ct_nodrift = { "nodrift", diff --git a/src/spells/shipcurse.h b/src/spells/shipcurse.h index a41f9edee..928b76771 100644 --- a/src/spells/shipcurse.h +++ b/src/spells/shipcurse.h @@ -23,6 +23,7 @@ extern "C" { struct curse; extern const struct curse_type ct_shipspeedup; + extern const struct curse_type ct_stormwind; struct message *cinfo_ship(const void *obj, objtype_t typ, const struct curse *c, int self);