small change

This commit is contained in:
Enno Rehling 2008-01-09 22:00:17 +00:00
parent 73f354be90
commit 87b28ddd9c

View file

@ -489,25 +489,27 @@ attrib_type at_contact = {
void void
usetcontact(unit * u, const unit * u2) usetcontact(unit * u, const unit * u2)
{ {
attrib * a = a_find(u->attribs, &at_contact); attrib * a = a_find(u->attribs, &at_contact);
while (a && a->type==&at_contact && a->data.v!=u2) a = a->next; while (a && a->type==&at_contact && a->data.v!=u2) a = a->next;
if (a && a->type==&at_contact) return; if (a && a->type==&at_contact) return;
a_add(&u->attribs, a_new(&at_contact))->data.v = (void*)u2; a_add(&u->attribs, a_new(&at_contact))->data.v = (void*)u2;
} }
boolean boolean
ucontact(const unit * u, const unit * u2) ucontact(const unit * u, const unit * u2)
/* Prüft, ob u den Kontaktiere-Befehl zu u2 gesetzt hat. */ /* Prüft, ob u den Kontaktiere-Befehl zu u2 gesetzt hat. */
{ {
attrib *ru; attrib *ru;
if (u->faction==u2->faction) return true; if (u->faction==u2->faction) return true;
/* Explizites KONTAKTIERE */ /* Explizites KONTAKTIERE */
for (ru = a_find(u->attribs, &at_contact); ru && ru->type==&at_contact; ru = ru->next) for (ru = a_find(u->attribs, &at_contact); ru && ru->type==&at_contact; ru = ru->next) {
if (((unit*)ru->data.v) == u2) if (((unit*)ru->data.v) == u2) {
return true; return true;
}
return false; }
return false;
} }
/*** /***
@ -517,12 +519,12 @@ ucontact(const unit * u, const unit * u2)
void void
free_units(void) free_units(void)
{ {
while (udestroy) { while (udestroy) {
unit * u = udestroy; unit * u = udestroy;
udestroy = udestroy->next; udestroy = udestroy->next;
stripunit(u); stripunit(u);
free(u); free(u);
} }
} }