Make setcont() update the nation only when it actually changes the
contact value. For added benefit, map all non-zero values to one when
option LOSE_CONTACT is disabled.
This saves I/O, in particular xdump bandwidth.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
if (CANT_HAPPEN(contact > 255))
contact = 255;
- if (np->nat_contact[them] < contact)
+ if (!opt_LOSE_CONTACT)
+ contact = !!contact;
+ if (np->nat_contact[them] < contact) {
np->nat_contact[them] = contact;
- putnat(np);
+ putnat(np);
+ }
}
void