diff --git a/src/common/gamecode/xmlreport.c b/src/common/gamecode/xmlreport.c index a796a5d04..89da806c1 100644 --- a/src/common/gamecode/xmlreport.c +++ b/src/common/gamecode/xmlreport.c @@ -629,48 +629,44 @@ xml_region(report_context * ctx, seen_region * sr) child = xmlNewNode(xct->ns_atl, BAD_CAST "terrain"); xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", (const xmlChar *)terrain_name(r)); - for (u=r->units;u;u=u->next) { - if (u->building || u->ship || (stealthmod>INT_MIN && cansee(ctx->f, r, u, stealthmod))) { - xmlAddChild(node, xml_unit(ctx, u, sr->mode)); - } - } - - /* report all units. they are pre-sorted in an efficient manner */ - u = r->units; - while (b) { - while (b && (!u || u->building!=b)) { - xmlAddChild(node, xml_building(ctx, sr, b, NULL)); - b = b->next; - } - if (b) { - child = xmlAddChild(node, xml_building(ctx, sr, b, u)); - while (u && u->building==b) { - xmlAddChild(child, xml_unit(ctx, u, sr->mode)); - u = u->next; + if (sr->mode>see_neighbour) { + /* report all units. they are pre-sorted in an efficient manner */ + u = r->units; + while (b) { + while (b && (!u || u->building!=b)) { + xmlAddChild(node, xml_building(ctx, sr, b, NULL)); + b = b->next; } - b = b->next; - } - } - while (u && !u->ship) { - if (stealthmod>INT_MIN) { - if (u->faction == ctx->f || cansee(ctx->f, r, u, stealthmod)) { - xmlAddChild(node, xml_unit(ctx, u, sr->mode)); + if (b) { + child = xmlAddChild(node, xml_building(ctx, sr, b, u)); + while (u && u->building==b) { + xmlAddChild(child, xml_unit(ctx, u, sr->mode)); + u = u->next; + } + b = b->next; } } - u = u->next; - } - while (sh) { - while (sh && (!u || u->ship!=sh)) { - xmlAddChild(node, xml_ship(ctx, sr, sh, NULL)); - sh = sh->next; - } - if (sh) { - child = xmlAddChild(node, xml_ship(ctx, sr, sh, u)); - while (u && u->ship==sh) { - xmlAddChild(child, xml_unit(ctx, u, sr->mode)); - u = u->next; + while (u && !u->ship) { + if (stealthmod>INT_MIN) { + if (u->faction == ctx->f || cansee(ctx->f, r, u, stealthmod)) { + xmlAddChild(node, xml_unit(ctx, u, sr->mode)); + } + } + u = u->next; + } + while (sh) { + while (sh && (!u || u->ship!=sh)) { + xmlAddChild(node, xml_ship(ctx, sr, sh, NULL)); + sh = sh->next; + } + if (sh) { + child = xmlAddChild(node, xml_ship(ctx, sr, sh, u)); + while (u && u->ship==sh) { + xmlAddChild(child, xml_unit(ctx, u, sr->mode)); + u = u->next; + } + sh = sh->next; } - sh = sh->next; } } return node; diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index a4a03cde5..4817fa8e6 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -67,7 +67,6 @@ #include static FILE *bdebug; -#undef DELAYED_OFFENSE /* non-guarding factions cannot attack after moving */ #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 */ @@ -3579,18 +3578,6 @@ flee(const troop dt) kill_troop(dt); } -#ifdef DELAYED_OFFENSE -static boolean -guarded_by(region * r, faction * f) -{ - unit * u; - for (u=r->units;u;u=u->next) { - if (u->faction == f && getguard(u)) return true; - } - return false; -} -#endif - static boolean init_battle(region * r, battle **bp) { @@ -3631,11 +3618,6 @@ init_battle(region * r, battle **bp) /** ** Fehlerbehandlung Angreifer **/ -#ifdef DELAYED_OFFENSE - if (get_moved(&u->attribs) && !guarded_by(r, u->faction)) { - ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "no_attack_after_advance", "")); - } -#endif if (LongHunger(u)) { cmistake(u, ord, 225, MSG_BATTLE); continue; diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index a9f105302..2ff0efba7 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -848,9 +848,6 @@ move_unit(unit * u, region * r, unit ** ulist) if (u->region!=NULL) maxhp = unit_max_hp(u); if (!ulist) ulist = (&r->units); if (u->region) { -#ifdef DELAYED_OFFENSE - set_moved(&u->attribs); -#endif setguard(u, GUARD_NONE); fset(u, UFL_MOVED); if (u->ship || u->building) leave(u->region, u);