/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2014, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
*
* Known contributors to this file:
* Dave Pare, 1989
- * Markus Armbruster, 2009
+ * Markus Armbruster, 2009-2011
*/
#include <config.h>
str = getstring(prompt, buf);
if (!str)
return 0;
- }
+ } else
+ make_stale_if_command_arg(str);
if (*str == 0) {
- /* empty string passed by player */
return 0;
}
if (type == EF_NATION && isalpha(*str)) {
default:
return 0;
}
- if (!player->condarg)
- return 1;
- n = nstr_comp(np->cond, sizeof(np->cond) / sizeof(*np->cond), type,
- player->condarg);
- np->ncond = n >= 0 ? n : 0;
- return n >= 0;
+ return snxtitem_use_condarg(np);
}
void
np->sel = NS_CARGO;
np->next = unit_cargo_first(carrier_type, carrier_uid, type);
}
+
+int
+snxtitem_use_condarg(struct nstr_item *np)
+{
+ int n;
+
+ if (!player->condarg)
+ return 1;
+ n = nstr_comp(np->cond, sizeof(np->cond) / sizeof(*np->cond),
+ np->type, player->condarg);
+ if (n < 0)
+ return 0;
+ np->ncond = n;
+ return 1;
+}