/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
#include <assert.h>
#include <stddef.h>
+#include <string.h>
#include "commodity.h"
#include "game.h"
#include "land.h"
static void lnd_oninit(void *);
static void nuk_oninit(void *);
static void nat_oninit(void *);
+static void contact_oninit(void *);
static void realm_oninit(void *);
static void game_oninit(void *);
static void pchr_oninit(void *);
{EF_NATION, "nat", "nation", "nation", nat_ca, EF_BAD,
UNMAPPED_CACHE(struct natstr, MAXNOC, EFF_TYPED | EFF_OWNER),
nat_oninit, NULL, NULL, NULL},
+ {EF_RELAT, "relat", NULL, "relat", relat_ca, EF_BAD,
+ UNMAPPED_CACHE(struct relatstr, MAXNOC, EFF_TYPED),
+ NULL, NULL, NULL, NULL},
+ {EF_CONTACT, "contact", NULL, "contact", contact_ca, EF_BAD,
+ UNMAPPED_CACHE(struct contactstr, MAXNOC, EFF_TYPED),
+ contact_oninit, NULL, NULL, NULL},
+ {EF_REJECT, "reject", NULL, "reject", reject_ca, EF_BAD,
+ UNMAPPED_CACHE(struct rejectstr, MAXNOC, EFF_TYPED),
+ NULL, NULL, NULL, NULL},
{EF_LOAN, "loan", NULL, "loan", loan_ca, EF_BAD,
UNMAPPED_CACHE(struct lonstr, -1, EFF_TYPED),
NULL, NULL, NULL, NULL},
np->nat_cnum = np->nat_uid;
}
+static void
+contact_oninit(void *ptr)
+{
+ struct contactstr *cp = ptr;
+
+ if (opt_HIDDEN)
+ cp->con_contact[cp->con_uid] = 1;
+ else
+ memset(cp->con_contact, 1, sizeof(cp->con_contact));
+}
+
static void
realm_oninit(void *ptr)
{