"Hero units cannot be merged with other hero units"
- fixed condition in give.c
also:
- indentation fixes
This commit is contained in:
Enno Rehling 2008-01-27 11:57:54 +00:00
parent adab7ea8f6
commit f168a45b2a
5 changed files with 96 additions and 91 deletions

View file

@ -147,17 +147,19 @@ give_men(int n, unit * u, unit * u2, struct order * ord)
} else if (u == u2) {
error = 10;
} else if (!u2 && u->race == new_race[RC_SNOTLING]) {
/* Snotlings können nicht an Bauern übergeben werden. */
/* snotlings may not be given to the peasants. */
error = 307;
#ifdef HEROES
} else if (fval(u, UFL_HERO) || (u2 && fval(u2, UFL_HERO))) {
} else if (u2 && (fval(u, UFL_HERO) != fval(u2, UFL_HERO))) {
/* heroes may not be given to non-heroes and vice versa*/
error = 75;
#endif
} else if ((u && unit_has_cursed_item(u)) || (u2 && unit_has_cursed_item(u2))) {
} else if (unit_has_cursed_item(u) || (u2 && unit_has_cursed_item(u2))) {
error = 78;
} else if (fval(u, UFL_LOCKED) || is_cursed(u->attribs, C_SLAVE, 0)) {
error = 74;
} else if (u2 && fval(u, UFL_HUNGER)) {
/* hungry people cannot be given away */
error = 73;
} else if (u2 && (fval(u2, UFL_LOCKED)|| is_cursed(u2->attribs, C_SLAVE, 0))) {
error = 75;
@ -165,8 +167,10 @@ give_men(int n, unit * u, unit * u2, struct order * ord)
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "feedback_no_contact", "target", u2));
error = -1;
} else if (u2 && (has_skill(u, SK_MAGIC) || has_skill(u2, SK_MAGIC))) {
/* cannot give units to and from magicians */
error = 158;
} else if (u2 && fval(u, UFL_WERE) != fval(u2, UFL_WERE)) {
} else if (u2 && (fval(u, UFL_WERE) != fval(u2, UFL_WERE))) {
/* werewolves can't be given to non-werewolves and vice-versa */
error = 312;
} else if (u2 && u2->number!=0 && u2->race != u->race) {
log_warning(("faction %s attempts to give %s to faction %s.\n",

View file

@ -939,7 +939,7 @@ restart_cmd(unit * u, struct order * ord)
if (!checkpasswd(u->faction, (const char *)s_pass, false)) {
cmistake(u, ord, 86, MSG_EVENT);
log_warning(("NEUSTART mit falschem Passwort für Partei %s: %s\n",
log_warning(("RESTART with wrong password, faction %s, pass %s\n",
factionid(u->faction), s_pass));
return 0;
}

View file

@ -70,7 +70,10 @@
static FILE *bdebug;
#undef DELAYED_OFFENSE /* non-guarding factions cannot attack after moving */
#define TACTICS_RANDOM 5 /* define this as 1 to deactivate */
#define TACTICS_BONUS 1 /* when undefined, we have a tactics round. else this is the bonus tactics give */
#define TACTICS_RANDOM /* undefine this to deactivate */
#define TACTICS_MODIFIER 1 /* modifier for generals in the fromt/rear */
#define CATAPULT_INITIAL_RELOAD 4 /* erster schuss in runde 1 + rng_int() % INITIAL */
#define CATAPULT_STRUCTURAL_DAMAGE
@ -97,9 +100,6 @@ boolean battledebug = true;
/* globals */
static int obs_count = 0;
#define TACTICS_MALUS 1
#undef MAGIC_TURNS
#define MINSPELLRANGE 1
#define MAXSPELLRANGE 7
@ -3102,11 +3102,11 @@ make_fighter(battle * b, unit * u, side * s1, boolean attack)
/* Schauen, wie gut wir in Taktik sind. */
if (t > 0 && u->race == new_race[RC_INSECT])
t -= 1 - (int) log10(fig->side->size[SUM_ROW]);
#ifdef TACTICS_MODIFIER
if (t > 0 && statusrow(fig->status) == FIGHT_ROW)
t += 1;
#ifdef TACTICS_MALUS
t += TACTICS_MODIFIER;
if (t > 0 && statusrow(fig->status) > BEHIND_ROW) {
t -= TACTICS_MALUS;
t -= TACTICS_MODIFIER;
}
#endif
#ifdef TACTICS_RANDOM

View file

@ -859,7 +859,7 @@ transfermen(unit * u, unit * u2, int n)
set_number(u2, u2->number + n);
hp -= u->hp;
u2->hp += hp;
/* TODO: Das ist schnarchlahm! und gehört ncht hierhin */
/* TODO: Das ist schnarchlahm! und gehört nicht hierhin */
a = a_find(u2->attribs, &at_effect);
while (a && a->type==&at_effect) {
attrib * an = a->next;
@ -869,14 +869,15 @@ transfermen(unit * u, unit * u2, int n)
a = an;
}
}
else if (r->land)
if(u->race != new_race[RC_DAEMON]) {
else if (r->land) {
if ((u->race->ec_flags & ECF_REC_UNLIMITED)==0) {
if(u->race != new_race[RC_URUK]) {
rsetpeasants(r, rpeasants(r) + n);
} else {
rsetpeasants(r, rpeasants(r) + n/2);
}
}
}
}
struct building *