fix mac build with clang 7.3

This commit is contained in:
Enno Rehling 2016-08-31 09:26:48 +02:00
parent a47b48cfbf
commit fa729ba972
3 changed files with 11 additions and 2 deletions

View File

@ -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) {

View File

@ -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;
}

View File

@ -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));