forked from github/server
Bugfixes uebertragen aus Hauptbranch:
http://eressea.upb.de/mantis/view.php?id=1251 "Komische Fehlermeldung bei abtreibendem Schiff" http://eressea.upb.de/mantis/view.php?id=1256 "Feinde können Schiff verlassen und sich bewegen in bewachter Region" http://eressea.upb.de/mantis/view.php?id=1252 Klarere Fehlermeldung bei Bewachung/Bewegung http://eressea.upb.de/mantis/view.php?id=1248 "schaffenstrunk und gehirnschmalz ohne wirkung"
This commit is contained in:
parent
cae7e67fdf
commit
4e863e9059
4 changed files with 47 additions and 28 deletions
|
@ -3139,6 +3139,7 @@ new_units (void)
|
||||||
const char * token;
|
const char * token;
|
||||||
char * name = NULL;
|
char * name = NULL;
|
||||||
int alias;
|
int alias;
|
||||||
|
ship * sh;
|
||||||
order ** newordersp;
|
order ** newordersp;
|
||||||
|
|
||||||
if (!checkunitnumber(u->faction, 1)) {
|
if (!checkunitnumber(u->faction, 1)) {
|
||||||
|
@ -3173,12 +3174,9 @@ new_units (void)
|
||||||
fset(u2, UFL_ISNEW);
|
fset(u2, UFL_ISNEW);
|
||||||
|
|
||||||
a_add(&u2->attribs, a_new(&at_alias))->data.i = alias;
|
a_add(&u2->attribs, a_new(&at_alias))->data.i = alias;
|
||||||
|
sh = leftship(u);
|
||||||
|
if (sh) set_leftship(u2, sh);
|
||||||
setstatus(u2, u->status);
|
setstatus(u2, u->status);
|
||||||
/*
|
|
||||||
g = getguard(u);
|
|
||||||
if (g) setguard(u2, g);
|
|
||||||
*/
|
|
||||||
|
|
||||||
ordp = &makeord->next;
|
ordp = &makeord->next;
|
||||||
newordersp = &u2->orders;
|
newordersp = &u2->orders;
|
||||||
|
|
|
@ -216,27 +216,29 @@ get_effect(const unit * u, const potion_type * effect)
|
||||||
int
|
int
|
||||||
change_effect (unit * u, const potion_type * effect, int delta)
|
change_effect (unit * u, const potion_type * effect, int delta)
|
||||||
{
|
{
|
||||||
attrib * a = a_find(u->attribs, &at_effect);
|
if (delta!=0) {
|
||||||
effect_data * data = NULL;
|
attrib * a = a_find(u->attribs, &at_effect);
|
||||||
|
effect_data * data = NULL;
|
||||||
|
|
||||||
assert(delta!=0);
|
while (a && a->type==&at_effect) {
|
||||||
while (a && a->type==&at_effect) {
|
data = (effect_data *)a->data.v;
|
||||||
data = (effect_data *)a->data.v;
|
if (data->type==effect) {
|
||||||
if (data->type==effect) {
|
if (data->value+delta==0) {
|
||||||
if (data->value+delta==0) {
|
a_remove(&u->attribs, a);
|
||||||
a_remove(&u->attribs, a);
|
return 0;
|
||||||
return 0;
|
} else {
|
||||||
} else {
|
data->value += delta;
|
||||||
data->value += delta;
|
return data->value;
|
||||||
return data->value;
|
}
|
||||||
}
|
}
|
||||||
}
|
a = a->next;
|
||||||
a = a->next;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
a = a_add(&u->attribs, a_new(&at_effect));
|
a = a_add(&u->attribs, a_new(&at_effect));
|
||||||
data = (effect_data*)a->data.v;
|
data = (effect_data*)a->data.v;
|
||||||
data->type = effect;
|
data->type = effect;
|
||||||
data->value = delta;
|
data->value = delta;
|
||||||
|
}
|
||||||
|
log_error(("change effect with delta==0 for unit %s\n", itoa36(u->no)));
|
||||||
return data->value;
|
return data->value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1993,9 +1993,12 @@ travel(unit * u, region_list ** routep)
|
||||||
sh = leftship(u);
|
sh = leftship(u);
|
||||||
if (sh && sh->region!=u->region) sh = NULL;
|
if (sh && sh->region!=u->region) sh = NULL;
|
||||||
}
|
}
|
||||||
if (sh && is_guarded(r, u, GUARD_LANDING)) {
|
if (sh) {
|
||||||
cmistake(u, u->thisorder, 70, MSG_MOVE);
|
unit * guard = is_guarded(r, u, GUARD_LANDING);
|
||||||
return;
|
if (guard) {
|
||||||
|
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "region_guarded", "guard", guard));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (u->ship && u->race->flags & RCF_SWIM) {
|
if (u->ship && u->race->flags & RCF_SWIM) {
|
||||||
cmistake(u, u->thisorder, 143, MSG_MOVE);
|
cmistake(u, u->thisorder, 143, MSG_MOVE);
|
||||||
|
@ -2457,7 +2460,13 @@ movement(void)
|
||||||
|
|
||||||
while (*up) {
|
while (*up) {
|
||||||
unit *u = *up;
|
unit *u = *up;
|
||||||
keyword_t kword = get_keyword(u->thisorder);
|
keyword_t kword;
|
||||||
|
|
||||||
|
if (u->ship && fval(u->ship, SF_DRIFTED)) {
|
||||||
|
up = &u->next;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
kword = get_keyword(u->thisorder);
|
||||||
|
|
||||||
switch (kword) {
|
switch (kword) {
|
||||||
case K_ROUTE:
|
case K_ROUTE:
|
||||||
|
|
|
@ -6131,6 +6131,16 @@
|
||||||
<text locale="fr">"$unit($unit) in $region($region): '$order($command)' - This region is guarded by a non allied faction."</text>
|
<text locale="fr">"$unit($unit) in $region($region): '$order($command)' - This region is guarded by a non allied faction."</text>
|
||||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - This region is guarded by a non allied faction."</text>
|
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - This region is guarded by a non allied faction."</text>
|
||||||
</message>
|
</message>
|
||||||
|
<message name="region_guarded" section="errors">
|
||||||
|
<type>
|
||||||
|
<arg name="unit" type="unit"/>
|
||||||
|
<arg name="region" type="region"/>
|
||||||
|
<arg name="command" type="order"/>
|
||||||
|
<arg name="guard" type="unit"/>
|
||||||
|
</type>
|
||||||
|
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Die Region wird von $unit($guard), einer nichtalliierten Einheit, bewacht."</text>
|
||||||
|
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - This region is guarded by $unit($guard), a non-allied unit."</text>
|
||||||
|
</message>
|
||||||
<message name="error67" section="errors">
|
<message name="error67" section="errors">
|
||||||
<type>
|
<type>
|
||||||
<arg name="unit" type="unit"/>
|
<arg name="unit" type="unit"/>
|
||||||
|
|
Loading…
Reference in a new issue