- removing unused DELAYED_OFFENSE define

- fixed duplicate units in CR
- fixed ship/building/unit display in neighbor-regions
This commit is contained in:
Enno Rehling 2008-06-16 08:58:56 +00:00
parent e72748a61f
commit 615d948021
3 changed files with 34 additions and 59 deletions

View File

@ -629,12 +629,7 @@ xml_region(report_context * ctx, seen_region * sr)
child = xmlNewNode(xct->ns_atl, BAD_CAST "terrain"); child = xmlNewNode(xct->ns_atl, BAD_CAST "terrain");
xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", (const xmlChar *)terrain_name(r)); xmlNewNsProp(child, xct->ns_atl, BAD_CAST "ref", (const xmlChar *)terrain_name(r));
for (u=r->units;u;u=u->next) { if (sr->mode>see_neighbour) {
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 */ /* report all units. they are pre-sorted in an efficient manner */
u = r->units; u = r->units;
while (b) { while (b) {
@ -673,6 +668,7 @@ xml_region(report_context * ctx, seen_region * sr)
sh = sh->next; sh = sh->next;
} }
} }
}
return node; return node;
} }

View File

@ -67,7 +67,6 @@
#include <sys/stat.h> #include <sys/stat.h>
static FILE *bdebug; 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_BONUS 1 /* when undefined, we have a tactics round. else this is the bonus tactics give */
#define TACTICS_RANDOM /* undefine this to deactivate */ #define TACTICS_RANDOM /* undefine this to deactivate */
@ -3579,18 +3578,6 @@ flee(const troop dt)
kill_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 static boolean
init_battle(region * r, battle **bp) init_battle(region * r, battle **bp)
{ {
@ -3631,11 +3618,6 @@ init_battle(region * r, battle **bp)
/** /**
** Fehlerbehandlung Angreifer ** 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)) { if (LongHunger(u)) {
cmistake(u, ord, 225, MSG_BATTLE); cmistake(u, ord, 225, MSG_BATTLE);
continue; continue;

View File

@ -848,9 +848,6 @@ move_unit(unit * u, region * r, unit ** ulist)
if (u->region!=NULL) maxhp = unit_max_hp(u); if (u->region!=NULL) maxhp = unit_max_hp(u);
if (!ulist) ulist = (&r->units); if (!ulist) ulist = (&r->units);
if (u->region) { if (u->region) {
#ifdef DELAYED_OFFENSE
set_moved(&u->attribs);
#endif
setguard(u, GUARD_NONE); setguard(u, GUARD_NONE);
fset(u, UFL_MOVED); fset(u, UFL_MOVED);
if (u->ship || u->building) leave(u->region, u); if (u->ship || u->building) leave(u->region, u);