diff --git a/src/items/xerewards.test.c b/src/items/xerewards.test.c index dc9aa2621..d135b27fb 100644 --- a/src/items/xerewards.test.c +++ b/src/items/xerewards.test.c @@ -25,7 +25,7 @@ static void test_manacrystal(CuTest *tc) { CuAssertIntEquals(tc, -1, use_manacrystal(u, itype, 1, NULL)); CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "error295")); test_clear_messages(u->faction); - create_mage(u, M_GRAY); + create_mage(u, M_GWYRRD); set_level(u, SK_MAGIC, 5); CuAssertIntEquals(tc, 0, get_spellpoints(u)); CuAssertIntEquals(tc, 1, use_manacrystal(u, itype, 1, NULL)); diff --git a/src/magic.c b/src/magic.c index 0e7061301..debd8e0da 100644 --- a/src/magic.c +++ b/src/magic.c @@ -126,7 +126,7 @@ int mage_change_spellpoints(sc_mage *m, int delta) { if (m) { int val = m->spellpoints + delta; - return m->spellpoints = (val > 0) ? val : m->spellpoints; + return m->spellpoints = (val >= 0) ? val : m->spellpoints; } return 0; } diff --git a/src/magic.test.c b/src/magic.test.c index 7355527e7..9979caf6d 100644 --- a/src/magic.test.c +++ b/src/magic.test.c @@ -182,7 +182,7 @@ void test_getspell_unit(CuTest * tc) r = test_create_region(0, 0, NULL); f = test_create_faction(NULL); u = test_create_unit(f, r); - create_mage(u, M_GRAY); + create_mage(u, M_GWYRRD); enable_skill(SK_MAGIC, true); set_level(u, SK_MAGIC, 1); @@ -451,7 +451,7 @@ static void test_max_spellpoints(CuTest *tc) { CuAssertIntEquals(tc, 1, max_spellpoints(u->region, u)); rc->maxaura = 200; CuAssertIntEquals(tc, 2, max_spellpoints(u->region, u)); - create_mage(u, M_GRAY); + create_mage(u, M_GWYRRD); set_level(u, SK_MAGIC, 1); CuAssertIntEquals(tc, 3, max_spellpoints(u->region, u)); set_level(u, SK_MAGIC, 2); diff --git a/src/triggers/shock.test.c b/src/triggers/shock.test.c index 4bbd4de88..952febfd0 100644 --- a/src/triggers/shock.test.c +++ b/src/triggers/shock.test.c @@ -23,7 +23,7 @@ static void test_shock(CuTest *tc) { test_setup(); shock_setup(); u = test_create_unit(test_create_faction(NULL), test_create_region(0, 0, NULL)); - create_mage(u, M_GRAY); + create_mage(u, M_GWYRRD); set_level(u, SK_MAGIC, 5); set_spellpoints(u, 10); u->hp = 10; @@ -44,7 +44,7 @@ static void test_shock_low(CuTest *tc) { test_setup(); shock_setup(); u = test_create_unit(test_create_faction(NULL), test_create_region(0, 0, NULL)); - create_mage(u, M_GRAY); + create_mage(u, M_GWYRRD); set_level(u, SK_MAGIC, 5); set_spellpoints(u, 1); u->hp = 1;