relations: New enum relations
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
f88365e762
commit
0b05f11d28
9 changed files with 32 additions and 25 deletions
|
@ -192,7 +192,7 @@ sneak_ashore(struct combat off[], struct emp_qelem *olist,
|
|||
struct emp_qelem *qp;
|
||||
struct ulist *llp;
|
||||
struct lndstr *lp;
|
||||
int rel;
|
||||
enum relations rel;
|
||||
|
||||
pr("Trying to sneak on shore...\n");
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ int
|
|||
decl(void)
|
||||
{
|
||||
struct natstr nat;
|
||||
int rel;
|
||||
enum relations rel;
|
||||
int who;
|
||||
struct nstr_item ni;
|
||||
char *p;
|
||||
|
|
|
@ -57,7 +57,7 @@ int
|
|||
spy(void)
|
||||
{
|
||||
natid own;
|
||||
int relat;
|
||||
enum relations relat;
|
||||
coord x, y;
|
||||
coord nx, ny;
|
||||
int military;
|
||||
|
@ -252,7 +252,7 @@ prplanes(int x, int y)
|
|||
static char *
|
||||
player_relstr(natid them)
|
||||
{
|
||||
int rel = relations_with(player->cnum, them);
|
||||
enum relations rel = relations_with(player->cnum, them);
|
||||
|
||||
if (rel == ALLIED)
|
||||
return "Allied";
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include "tel.h"
|
||||
|
||||
char *relates[] = {
|
||||
/* must follow nation relation defines in nat.h */
|
||||
/* must match enum relations */
|
||||
"At War", "Hostile", "Neutral", "Friendly", "Allied"
|
||||
};
|
||||
|
||||
|
@ -73,7 +73,7 @@ natstate(struct natstr *np)
|
|||
}
|
||||
|
||||
/* This returns the relations that np has with them */
|
||||
int
|
||||
enum relations
|
||||
getrel(struct natstr *np, natid them)
|
||||
{
|
||||
return np->nat_relate[them];
|
||||
|
@ -83,7 +83,7 @@ getrel(struct natstr *np, natid them)
|
|||
* Return relations @us has with @them.
|
||||
* Countries are considered allied to themselves.
|
||||
*/
|
||||
int
|
||||
enum relations
|
||||
relations_with(natid us, natid them)
|
||||
{
|
||||
return us == them ? ALLIED : getrel(getnatp(us), them);
|
||||
|
|
|
@ -65,7 +65,7 @@ static void ac_doflak(struct emp_qelem *, struct sctstr *);
|
|||
static void ac_landflak(struct emp_qelem *, coord, coord);
|
||||
static void ac_shipflak(struct emp_qelem *, coord, coord);
|
||||
static void ac_fireflak(struct emp_qelem *, natid, int);
|
||||
static void getilists(struct emp_qelem *, unsigned char *, natid);
|
||||
static void getilists(struct emp_qelem *, enum relations[], natid);
|
||||
static int do_evade(struct emp_qelem *, struct emp_qelem *);
|
||||
|
||||
void
|
||||
|
@ -76,7 +76,7 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
|
|||
int dir;
|
||||
unsigned char gotships[MAXNOC];
|
||||
unsigned char gotlands[MAXNOC];
|
||||
unsigned char rel[MAXNOC];
|
||||
enum relations rel[MAXNOC];
|
||||
int overfly[MAXNOC];
|
||||
int flags;
|
||||
struct emp_qelem ilist[MAXNOC];
|
||||
|
@ -741,7 +741,7 @@ ac_flak_dam(int guns, int def, int pl_flags)
|
|||
* Get planes available for interception duties.
|
||||
*/
|
||||
static void
|
||||
getilists(struct emp_qelem *list, unsigned char *rel, natid intruder)
|
||||
getilists(struct emp_qelem *list, enum relations rel[], natid intruder)
|
||||
{
|
||||
natid cn;
|
||||
struct plchrstr *pcp;
|
||||
|
|
|
@ -987,7 +987,7 @@ lnd_mar_dir(struct emp_qelem *list, int dir, natid actor)
|
|||
coord newx;
|
||||
coord newy;
|
||||
int move;
|
||||
int rel;
|
||||
enum relations rel;
|
||||
int oldown;
|
||||
|
||||
if (CANT_HAPPEN(QEMPTY(list)))
|
||||
|
|
|
@ -179,7 +179,8 @@ int
|
|||
unit_interdict(coord x, coord y, natid victim, char *s, int hardtarget,
|
||||
int mission)
|
||||
{
|
||||
int cn, rel, newdam, osubs;
|
||||
int cn, newdam, osubs;
|
||||
enum relations rel;
|
||||
int dam = -1;
|
||||
unsigned char plane_act[MAXNOC], other_act[MAXNOC];
|
||||
struct genlist mi[MAXNOC];
|
||||
|
|
|
@ -41,10 +41,10 @@
|
|||
#include "update.h"
|
||||
|
||||
void
|
||||
setrel(natid us, natid them, int rel)
|
||||
setrel(natid us, natid them, enum relations rel)
|
||||
{
|
||||
struct natstr *mynp = getnatp(us);
|
||||
int oldrel;
|
||||
enum relations oldrel;
|
||||
char *whichway;
|
||||
int n_up = 0;
|
||||
int n_down = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue