* Klärung NACH auf Schiffen. (vinyambar!)

* Trefferpunkteanpassung bei Bewegung (vinyambar!)
This commit is contained in:
Enno Rehling 2002-03-22 09:33:46 +00:00
parent 0cff724930
commit 2b08dd0120
3 changed files with 21 additions and 4 deletions

View File

@ -2018,11 +2018,13 @@ void
movement(void) movement(void)
{ {
region *r; region *r;
int ships;
/* Initialize the additional encumbrance by transported units */ /* Initialize the additional encumbrance by transported units */
init_drive(); init_drive();
for (r = regions; r; r = r->next) { /* move ships in last phase, others first */
for (ships=0;ships<=1;++ships) for (r = regions; r; r = r->next) {
unit ** up = &r->units; unit ** up = &r->units;
/* Bewegungen. /* Bewegungen.
* *
@ -2058,9 +2060,20 @@ movement(void)
set_string(&u->thisorder, ""); set_string(&u->thisorder, "");
up = &u->next; up = &u->next;
} else { } else {
move(r, u, true); boolean moved = true;
set_string(&u->thisorder, ""); if (ships) {
up = &r->units; if (u->ship && fval(u, FL_OWNER)) move(r, u, true);
else moved=false;
} else {
if (u->ship==NULL || !fval(u, FL_OWNER)) move(r, u, true);
else moved=false;
}
if (moved) {
set_string(&u->thisorder, "");
up = &r->units;
} else {
up = &u->next;
}
} }
break; break;
default: default:

View File

@ -1622,7 +1622,9 @@ readunit(FILE * F)
u->irace = new_race[(race_t)ri(F)]; u->irace = new_race[(race_t)ri(F)];
} else { } else {
rs(F, buf); rs(F, buf);
if (strcmp(buf, "giant turtle")==0) strcpy(buf, "giantturtle");
u->race = rc_find(buf); u->race = rc_find(buf);
assert(u->race);
rs(F, buf); rs(F, buf);
if (strlen(buf)) u->irace = rc_find(buf); if (strlen(buf)) u->irace = rc_find(buf);
else u->irace = u->race; else u->irace = u->race;

View File

@ -644,6 +644,7 @@ can_survive(const unit *u, const region *r)
void void
move_unit(unit * u, region * r, unit ** ulist) move_unit(unit * u, region * r, unit ** ulist)
{ {
int maxhp = unit_max_hp(u);
assert(u && r); assert(u && r);
if (u->region == r) return; if (u->region == r) return;
@ -660,6 +661,7 @@ move_unit(unit * u, region * r, unit ** ulist)
u->faction->first = 0; u->faction->first = 0;
u->faction->last = 0; u->faction->last = 0;
u->region = r; u->region = r;
u->hp = u->hp * unit_max_hp(u) / maxhp;
} }
/* ist mist, aber wegen nicht skalierender attirbute notwendig: */ /* ist mist, aber wegen nicht skalierender attirbute notwendig: */