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:
Enno Rehling 2007-08-17 07:06:33 +00:00
parent cae7e67fdf
commit 4e863e9059
4 changed files with 47 additions and 28 deletions

View file

@ -3139,6 +3139,7 @@ new_units (void)
const char * token;
char * name = NULL;
int alias;
ship * sh;
order ** newordersp;
if (!checkunitnumber(u->faction, 1)) {
@ -3173,12 +3174,9 @@ new_units (void)
fset(u2, UFL_ISNEW);
a_add(&u2->attribs, a_new(&at_alias))->data.i = alias;
sh = leftship(u);
if (sh) set_leftship(u2, sh);
setstatus(u2, u->status);
/*
g = getguard(u);
if (g) setguard(u2, g);
*/
ordp = &makeord->next;
newordersp = &u2->orders;

View file

@ -216,10 +216,10 @@ get_effect(const unit * u, const potion_type * effect)
int
change_effect (unit * u, const potion_type * effect, int delta)
{
if (delta!=0) {
attrib * a = a_find(u->attribs, &at_effect);
effect_data * data = NULL;
assert(delta!=0);
while (a && a->type==&at_effect) {
data = (effect_data *)a->data.v;
if (data->type==effect) {
@ -238,5 +238,7 @@ change_effect (unit * u, const potion_type * effect, int delta)
data = (effect_data*)a->data.v;
data->type = effect;
data->value = delta;
}
log_error(("change effect with delta==0 for unit %s\n", itoa36(u->no)));
return data->value;
}

View file

@ -1993,10 +1993,13 @@ travel(unit * u, region_list ** routep)
sh = leftship(u);
if (sh && sh->region!=u->region) sh = NULL;
}
if (sh && is_guarded(r, u, GUARD_LANDING)) {
cmistake(u, u->thisorder, 70, MSG_MOVE);
if (sh) {
unit * guard = is_guarded(r, u, GUARD_LANDING);
if (guard) {
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder, "region_guarded", "guard", guard));
return;
}
}
if (u->ship && u->race->flags & RCF_SWIM) {
cmistake(u, u->thisorder, 143, MSG_MOVE);
return;
@ -2457,7 +2460,13 @@ movement(void)
while (*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) {
case K_ROUTE:

View file

@ -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="en">"$unit($unit) in $region($region): '$order($command)' - This region is guarded by a non allied faction."</text>
</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">
<type>
<arg name="unit" type="unit"/>