extern s_char *natstate(struct natstr *np);
extern int getrel(struct natstr *np, natid them);
extern int getrejects(natid them, struct natstr *np);
-extern unsigned char getcontact(struct natstr *np, natid them);
+extern int getcontact(struct natstr *np, natid them);
extern void putrel(struct natstr *np, natid them, int relate);
extern void putreject(struct natstr *np, natid them, int how, int what);
-extern void putcontact(struct natstr *np, natid them,
- unsigned char contact);
+extern void putcontact(struct natstr *np, natid them, int contact);
extern void agecontact(struct natstr *np);
/* nation flags */
* Dave Pare, 1989
*/
+#include "prototypes.h"
#include "misc.h"
#include "nat.h"
#include "file.h"
}
}
-unsigned char
+int
getcontact(struct natstr *np, natid them)
{
return np->nat_contact[them];
}
void
-putcontact(struct natstr *np, natid them, unsigned char contact)
+putcontact(struct natstr *np, natid them, int contact)
{
+ if (CANT_HAPPEN(contact < 0))
+ contact = 0;
+ if (CANT_HAPPEN(contact > 255))
+ contact = 255;
+
if (np->nat_contact[them] < contact)
np->nat_contact[them] = contact;
}