forked from github/server
You can teach non-allied units - not giving feedback when student does not grant teacher a HELP GUARD Issue: 1448
This commit is contained in:
parent
bfd52e1b11
commit
ec5923adc3
1 changed files with 16 additions and 8 deletions
|
@ -357,6 +357,7 @@ teach_cmd(unit * u, struct order * ord)
|
||||||
|
|
||||||
while (!parser_end()) {
|
while (!parser_end()) {
|
||||||
unit * u2 = getunit(r, u->faction);
|
unit * u2 = getunit(r, u->faction);
|
||||||
|
boolean feedback;
|
||||||
++count;
|
++count;
|
||||||
|
|
||||||
/* Falls die Unit nicht gefunden wird, Fehler melden */
|
/* Falls die Unit nicht gefunden wird, Fehler melden */
|
||||||
|
@ -393,6 +394,8 @@ teach_cmd(unit * u, struct order * ord)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
feedback = u->faction==u2->faction || alliedunit(u2, u->faction, HELP_GUARD);
|
||||||
|
|
||||||
/* Neuen Befehl zusammenbauen. TEMP-Einheiten werden automatisch in
|
/* Neuen Befehl zusammenbauen. TEMP-Einheiten werden automatisch in
|
||||||
* ihre neuen Nummern übersetzt. */
|
* ihre neuen Nummern übersetzt. */
|
||||||
if (zOrder[0]) strcat(zOrder, " ");
|
if (zOrder[0]) strcat(zOrder, " ");
|
||||||
|
@ -419,17 +422,19 @@ teach_cmd(unit * u, struct order * ord)
|
||||||
|
|
||||||
/* u is teacher, u2 is student */
|
/* u is teacher, u2 is student */
|
||||||
if (eff_skill_study(u2, sk, r) > eff_skill_study(u, sk, r)-TEACHDIFFERENCE) {
|
if (eff_skill_study(u2, sk, r) > eff_skill_study(u, sk, r)-TEACHDIFFERENCE) {
|
||||||
ADDMSG(&u->faction->msgs,
|
if (feedback) {
|
||||||
msg_feedback(u, ord, "teach_asgood", "student", u2));
|
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "teach_asgood", "student", u2));
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (sk == SK_MAGIC) {
|
if (sk == SK_MAGIC) {
|
||||||
/* ist der Magier schon spezialisiert, so versteht er nur noch
|
/* ist der Magier schon spezialisiert, so versteht er nur noch
|
||||||
* Lehrer seines Gebietes */
|
* Lehrer seines Gebietes */
|
||||||
if (find_magetype(u2) != 0
|
if (find_magetype(u2) != 0 && find_magetype(u) != find_magetype(u2))
|
||||||
&& find_magetype(u) != find_magetype(u2))
|
|
||||||
{
|
{
|
||||||
|
if (feedback) {
|
||||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_different_magic", "target", u2));
|
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_different_magic", "target", u2));
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -691,12 +696,15 @@ learn_cmd(unit * u, order * ord)
|
||||||
while (teach->teachers[index] && index!=MAXTEACHERS) {
|
while (teach->teachers[index] && index!=MAXTEACHERS) {
|
||||||
unit * teacher = teach->teachers[index++];
|
unit * teacher = teach->teachers[index++];
|
||||||
if (teacher->faction != u->faction) {
|
if (teacher->faction != u->faction) {
|
||||||
ADDMSG(&u->faction->msgs, msg_message("teach_student",
|
boolean feedback = alliedunit(u, teacher->faction, HELP_GUARD);
|
||||||
"teacher student skill", teacher, u, sk));
|
if (feedback) {
|
||||||
ADDMSG(&teacher->faction->msgs, msg_message("teach_teacher",
|
ADDMSG(&teacher->faction->msgs, msg_message("teach_teacher",
|
||||||
"teacher student skill level", teacher, u, sk,
|
"teacher student skill level", teacher, u, sk,
|
||||||
effskill(u, sk)));
|
effskill(u, sk)));
|
||||||
}
|
}
|
||||||
|
ADDMSG(&u->faction->msgs, msg_message("teach_student",
|
||||||
|
"teacher student skill", teacher, u, sk));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
a_remove(&u->attribs, a);
|
a_remove(&u->attribs, a);
|
||||||
|
|
Loading…
Reference in a new issue