/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* ---
*
* orig.c: Move your origin
- *
+ *
* Known contributors to this file:
* Shelley Louie, 1988
* Markus Armbruster, 2006
char *p;
coord x, y;
char buf[1024];
- natid cnum;
+ int cnum;
struct natstr *np;
p = getstarg(player->argp[1], "New origin (sector or country) : ", buf);
- if (!p)
+ if (!p || !*p)
return RET_SYN;
if (!isalpha(*p) && strchr(p, ',')) {
/* sector */
cnum = natarg(p, NULL);
if (!(np = getnatp(cnum)))
return RET_SYN;
- if (!player->god && player->cnum != cnum
- && getrel(np, player->cnum) != ALLIED) {
+ if (!player->god && relations_with(cnum, player->cnum) != ALLIED) {
pr("Country %s is not allied with you!\n", np->nat_cnam);
return RET_FAIL;
}