* 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)
{
region *r;
int ships;
/* Initialize the additional encumbrance by transported units */
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;
/* Bewegungen.
*
@ -2058,9 +2060,20 @@ movement(void)
set_string(&u->thisorder, "");
up = &u->next;
} else {
move(r, u, true);
set_string(&u->thisorder, "");
up = &r->units;
boolean moved = true;
if (ships) {
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;
default:

View File

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

View File

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