diff --git a/src/kernel/race.c b/src/kernel/race.c index be9f2ab68..2c22f6c09 100644 --- a/src/kernel/race.c +++ b/src/kernel/race.c @@ -155,7 +155,7 @@ static race *rc_find_i(const char *name) const char *rname = name; race *rc = races; - while (rc && !strcmp(rname, rc->_name) == 0) { + while (rc && strcmp(rname, rc->_name) != 0) { rc = rc->next; } if (!rc && strcmp(name, "uruk") == 0) { diff --git a/src/kernel/race.test.c b/src/kernel/race.test.c index aa37093d4..e8bbfcf29 100644 --- a/src/kernel/race.test.c +++ b/src/kernel/race.test.c @@ -41,11 +41,20 @@ static void test_rc_defaults(CuTest *tc) { test_cleanup(); } +static void test_rc_find(CuTest *tc) { + race *rc; + test_cleanup(); + rc = test_create_race("hungryhippos"); + CuAssertPtrEquals(tc, rc, (void *)rc_find("hungryhippos")); + test_cleanup(); +} + CuSuite *get_race_suite(void) { CuSuite *suite = CuSuiteNew(); SUITE_ADD_TEST(suite, test_rc_name); SUITE_ADD_TEST(suite, test_rc_defaults); + SUITE_ADD_TEST(suite, test_rc_find); return suite; } diff --git a/src/spells.c b/src/spells.c index 1da440df2..e455f7395 100644 --- a/src/spells.c +++ b/src/spells.c @@ -5354,7 +5354,7 @@ int sp_leaveastral(castorder * co) u = pa->param[n]->data.u; if (!ucontact(u, mage)) { - if (power > 10 && !pa->param[n]->flag == TARGET_RESISTS + if (power > 10 && !(pa->param[n]->flag == TARGET_RESISTS) && can_survive(u, rt)) { ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "feedback_no_contact_no_resist", "target", u)); diff --git a/tolua b/tolua index e53fe09e5..32cc6a3e7 160000 --- a/tolua +++ b/tolua @@ -1 +1 @@ -Subproject commit e53fe09e5789083698d2efb1fd36250efa700c34 +Subproject commit 32cc6a3e78238278bc5b1fb8566526558e5afdda