GIB TEMP anders gefixt.

This commit is contained in:
Enno Rehling 2004-06-13 17:10:00 +00:00
parent 2b36ba65e0
commit 5dee77b1b6
1 changed files with 15 additions and 21 deletions

View File

@ -1538,30 +1538,24 @@ getunitg(const region * r, const faction * f)
unit * unit *
getunit(const region * r, const faction * f) getunit(const region * r, const faction * f)
{ {
int n; int n;
unit *u2; unit *u2;
getunitpeasants = 0; getunitpeasants = 0;
n = read_unitid(f, r);
if (n == 0) {
getunitpeasants = 1;
return NULL;
}
if (n < 0) return 0;
n = read_unitid(f, r); for (u2 = r->units; u2; u2 = u2->next) {
if (u2->no == n) {
if (n == 0) { if ((u2->flags & UFL_ISNEW) || u2->number>0) return u2;
getunitpeasants = 1;
return NULL;
} }
}
if (n < 0) return 0; return 0;
return findunitr(r, n);
/* && u2->number>0 verhindert GIB TEMP u.ä.!
for (u2 = r->units; u2; u2 = u2->next) {
if (u2->no == n && u2->number>0) {
return u2;
}
}
*/
return 0;
} }
/* - String Listen --------------------------------------------- */ /* - String Listen --------------------------------------------- */