forked from github/server
Bugfix givemen und warning bei Versuch des Mißbrauch
This commit is contained in:
parent
375a55b882
commit
ea9e58b018
|
@ -527,14 +527,17 @@ givemen(int n, unit * u, unit * u2, const char * cmd)
|
|||
error = 74;
|
||||
} else if (u2 && (fval(u2, UFL_LOCKED)|| is_cursed(u2->attribs, C_SLAVE, 0))) {
|
||||
error = 75;
|
||||
} else if (u2 != (unit *) NULL
|
||||
&& u2->faction != u->faction
|
||||
&& ucontact(u2, u) == 0) {
|
||||
} else if (u2 && u2->faction != u->faction && ucontact(u2, u) == 0) {
|
||||
error = 73;
|
||||
} else if (u2 && (has_skill(u, SK_MAGIC) || has_skill(u2, SK_MAGIC))) {
|
||||
error = 158;
|
||||
} else if (u2 && fval(u, UFL_WERE) != fval(u2, UFL_WERE)) {
|
||||
error = 312;
|
||||
} else if (u2 && u2->number!=0 && u2->race != u->race) {
|
||||
log_warning(("Partei %s versucht %s an %s zu übergeben.\n",
|
||||
itoa36(u->faction->no), u->race->_name[0],
|
||||
u2->race->_name[1]));
|
||||
error = 139;
|
||||
} else {
|
||||
if (n > u->number) n = u->number;
|
||||
if (n == 0) {
|
||||
|
@ -556,8 +559,8 @@ givemen(int n, unit * u, unit * u2, const char * cmd)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (u2 && (has_skill(u, SK_ALCHEMY) || has_skill(u2, SK_ALCHEMY))) {
|
||||
|
||||
if (u2 && (has_skill(u, SK_ALCHEMY) || has_skill(u2, SK_ALCHEMY))) {
|
||||
k = count_skill(u2->faction, SK_ALCHEMY);
|
||||
|
||||
/* Falls die Zieleinheit keine Alchemisten sind, werden sie nun
|
||||
|
@ -580,13 +583,11 @@ givemen(int n, unit * u, unit * u2, const char * cmd)
|
|||
}
|
||||
}
|
||||
|
||||
if (!error) {
|
||||
if (error==0) {
|
||||
if (u2 && u2->number == 0) {
|
||||
set_racename(&u2->attribs, get_racename(u->attribs));
|
||||
u2->race = u->race;
|
||||
u2->irace = u->irace;
|
||||
} else if (u2 && u2->race != u->race) {
|
||||
error = 139;
|
||||
} else if (u2) {
|
||||
/* Einheiten von Schiffen können nicht NACH in von
|
||||
* Nicht-alliierten bewachten Regionen ausführen */
|
||||
|
|
Loading…
Reference in New Issue