remove deprecated init_order_depr

This commit is contained in:
Enno Rehling 2020-08-13 16:50:29 +02:00
parent 2e44e2dd09
commit d4400bb583
21 changed files with 85 additions and 89 deletions

View File

@ -3750,7 +3750,7 @@ static bool start_battle(region * r, battle ** bp)
/* Ende Fehlerbehandlung Angreifer */
init_order_depr(ord);
init_order(ord, NULL);
/* attackierte Einheit ermitteln */
getunit(r, u->faction, &u2);

View File

@ -17,7 +17,7 @@ static int tolua_order_get_token(lua_State *L) {
order *ord = (order *)tolua_tousertype(L, 1, 0);
int n = (int)tolua_tonumber(L, 2, 0);
const char * str = 0;
init_order_depr(ord);
init_order(ord, NULL);
while (n-->0) {
str = getstrtoken();
if (!str) {

View File

@ -218,7 +218,7 @@ int give_control_cmd(unit * u, order * ord)
unit *u2;
const char *s;
init_order_depr(ord);
init_order(ord, NULL);
getunit(r, u->faction, &u2);
s = gettoken(token, sizeof(token));
@ -921,7 +921,7 @@ int make_cmd(unit * u, struct order *ord)
const struct locale *lang = u->faction->locale;
keyword_t kwd;
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_MAKE);
s = gettoken(token, sizeof(token));
@ -1228,7 +1228,7 @@ static void buy(unit * u, econ_request ** buyorders, struct order *ord)
/* Im Augenblick kann man nur 1 Produkt kaufen. expandbuying ist aber
* schon dafuer ausgeruestet, mehrere Produkte zu kaufen. */
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_BUY);
n = getint();
if (n <= 0) {
@ -1525,7 +1525,7 @@ static bool sell(unit * u, econ_request ** sellorders, struct order *ord)
/* sellorders sind KEIN array, weil fuer alle items DIE SELBE resource
* (das geld der region) aufgebraucht wird. */
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_SELL);
s = gettoken(token, sizeof(token));
@ -1811,7 +1811,7 @@ static void breed_cmd(unit * u, struct order *ord)
}
/* zuechte [<anzahl>] <parameter> */
(void)init_order_depr(ord);
(void)init_order(ord, NULL);
s = gettoken(token, sizeof(token));
m = s ? atoip(s) : 0;
@ -1878,7 +1878,7 @@ static void research_cmd(unit * u, struct order *ord)
region *r = u->region;
keyword_t kwd;
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_RESEARCH);
if (effskill(u, SK_HERBALISM, NULL) < 7) {
@ -1944,7 +1944,7 @@ static int entertain_cmd(unit * u, struct order *ord, econ_request **io_req)
static int entertainperlevel = 0;
keyword_t kwd;
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_ENTERTAIN);
if (!entertainbase) {
const char *str = config_get("entertain.base");
@ -2149,7 +2149,7 @@ void tax_cmd(unit * u, struct order *ord, econ_request ** taxorders)
taxperlevel = config_get_int("taxing.perlevel", 0);
}
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_TAX);
if (!humanoidrace(u_race(u)) && !is_monsters(u->faction)) {
@ -2217,7 +2217,7 @@ void loot_cmd(unit * u, struct order *ord, econ_request ** lootorders)
econ_request *o;
keyword_t kwd;
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_LOOT);
if (config_get_int("rules.enable_loot", 0) == 0 && !is_monsters(u->faction)) {

View File

@ -824,7 +824,7 @@ void give_cmd(unit * u, order * ord)
message *msg;
keyword_t kwd;
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_GIVE);
err = getunit(r, u->faction, &u2);
s = gettoken(token, sizeof(token));

View File

@ -164,7 +164,7 @@ static void perform_kick(void)
if (al && alliance_get_leader(al) == ta->u->faction) {
faction *f;
init_order_depr(ta->ord);
init_order(ta->ord, NULL);
skip_token();
f = getfaction();
if (f && f_get_alliance(f) == al) {
@ -185,7 +185,7 @@ static void perform_new(void)
int id;
faction *f = ta->u->faction;
init_order_depr(ta->ord);
init_order(ta->ord, NULL);
skip_token();
id = getid();
@ -220,7 +220,7 @@ static void perform_transfer(void)
if (al && alliance_get_leader(al) == ta->u->faction) {
faction *f;
init_order_depr(ta->ord);
init_order(ta->ord, NULL);
skip_token();
f = getfaction();
if (f && f_get_alliance(f) == al) {
@ -257,7 +257,7 @@ static void perform_join(void)
faction *fj = ta->u->faction;
int aid;
init_order_depr(ta->ord);
init_order(ta->ord, NULL);
skip_token();
aid = getid();
if (aid) {
@ -269,7 +269,7 @@ static void perform_join(void)
faction *fi = ti->u->faction;
if (fi && f_get_alliance(fi) == al) {
int fid;
init_order_depr(ti->ord);
init_order(ti->ord, NULL);
skip_token();
fid = getid();
if (fid == fj->no) {

View File

@ -159,7 +159,7 @@ int destroy_cmd(unit * u, struct order *ord)
return 52;
}
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
if (s && *s) {

View File

@ -95,7 +95,7 @@ static int do_command_i(const struct tnode *keys, struct unit *u, struct order *
void do_command(const struct tnode *keys, struct unit *u, struct order *ord)
{
init_order_depr(ord);
init_order(ord, NULL);
if (do_command_i(keys, u, ord) != E_TOK_SUCCESS) {
char cmd[ORDERSIZE];
get_command(ord, u->faction->locale, cmd, sizeof(cmd));

View File

@ -33,28 +33,28 @@ static void test_read_unitid(CuTest *tc) {
usetalias(u, atoi36("42"));
ord = create_order(K_GIVE, lang, "TEMP 42");
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, u->no, read_unitid(u->faction, u->region));
free_order(ord);
ord = create_order(K_GIVE, lang, "8");
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, 8, read_unitid(u->faction, u->region));
free_order(ord);
ord = create_order(K_GIVE, lang, "");
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, -1, read_unitid(u->faction, u->region));
free_order(ord);
ord = create_order(K_GIVE, lang, "TEMP");
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, -1, read_unitid(u->faction, u->region));
free_order(ord);
/* bug https://bugs.eressea.de/view.php?id=1685 */
ord = create_order(K_GIVE, lang, "##");
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, -1, read_unitid(u->faction, u->region));
free_order(ord);
@ -79,42 +79,42 @@ static void test_getunit(CuTest *tc) {
r = test_create_region(1, 0, t_plain);
ord = create_order(K_GIVE, lang, itoa36(u->no));
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, GET_UNIT, getunit(u->region, u->faction, &u2));
CuAssertPtrEquals(tc, u, u2);
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, GET_NOTFOUND, getunit(r, u->faction, &u2));
CuAssertPtrEquals(tc, NULL, u2);
free_order(ord);
ord = create_order(K_GIVE, lang, itoa36(u->no + 1));
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, GET_NOTFOUND, getunit(u->region, u->faction, &u2));
CuAssertPtrEquals(tc, NULL, u2);
free_order(ord);
ord = create_order(K_GIVE, lang, "0");
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, GET_PEASANTS, getunit(u->region, u->faction, &u2));
CuAssertPtrEquals(tc, NULL, u2);
free_order(ord);
/* bug https://bugs.eressea.de/view.php?id=1685 */
ord = create_order(K_GIVE, lang, "TEMP ##");
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, GET_NOTFOUND, getunit(u->region, u->faction, &u2));
CuAssertPtrEquals(tc, NULL, u2);
free_order(ord);
/* bug https://bugs.eressea.de/view.php?id=1685 */
ord = create_order(K_GIVE, lang, "##");
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, GET_NOTFOUND, getunit(u->region, u->faction, &u2));
CuAssertPtrEquals(tc, NULL, u2);
free_order(ord);
ord = create_order(K_GIVE, lang, "TEMP 42");
init_order_depr(ord);
init_order(ord, NULL);
CuAssertIntEquals(tc, GET_UNIT, getunit(u->region, u->faction, &u2));
CuAssertPtrEquals(tc, u, u2);
free_order(ord);

View File

@ -622,17 +622,13 @@ keyword_t init_order(const struct order *ord, const struct locale *lang)
}
}
keyword_t init_order_depr(const struct order *ord)
void reset_order(void)
{
if (ord) {
keyword_t kwd = ORD_KEYWORD(ord);
assert(kwd != K_STUDY && kwd != K_AUTOSTUDY && kwd != K_FORGET);
}
return init_order(ord, NULL);
(void)init_order(NULL, NULL);
}
void close_orders(void) {
if (parser_od) {
(void)init_order(NULL, NULL);
reset_order();
}
}

View File

@ -73,8 +73,8 @@ extern "C" {
char *write_order(const order * ord, const struct locale *lang,
char *buffer, size_t size);
int stream_order(struct stream *out, const struct order *ord, const struct locale *lang, bool escape);
keyword_t init_order_depr(const struct order *ord);
keyword_t init_order(const struct order *ord, const struct locale *lang);
void reset_order(void);
void close_orders(void);

View File

@ -30,7 +30,7 @@ static void test_create_order(CuTest *tc) {
CuAssertIntEquals(tc, K_MOVE, getkeyword(ord));
CuAssertStrEquals(tc, "move NORTH", get_command(ord, lang, cmd, sizeof(cmd)));
CuAssertIntEquals(tc, K_MOVE, init_order_depr(ord));
CuAssertIntEquals(tc, K_MOVE, init_order(ord, NULL));
CuAssertStrEquals(tc, "NORTH", getstrtoken());
free_order(ord);
test_teardown();
@ -50,7 +50,7 @@ static void test_parse_order(CuTest *tc) {
CuAssertIntEquals(tc, K_MOVE, getkeyword(ord));
CuAssertStrEquals(tc, "move NORTH", get_command(ord, lang, cmd, sizeof(cmd)));
CuAssertIntEquals(tc, K_MOVE, init_order_depr(ord));
CuAssertIntEquals(tc, K_MOVE, init_order(ord, NULL));
CuAssertStrEquals(tc, "NORTH", getstrtoken());
free_order(ord);
@ -109,7 +109,7 @@ static void test_parse_make(CuTest *tc) {
CuAssertIntEquals(tc, K_MAKE, getkeyword(ord));
CuAssertStrEquals(tc, "MAKE hurrdurr", get_command(ord, lang, cmd, sizeof(cmd)));
CuAssertIntEquals(tc, K_MAKE, init_order_depr(ord));
CuAssertIntEquals(tc, K_MAKE, init_order(ord, NULL));
CuAssertStrEquals(tc, "hurrdurr", getstrtoken());
free_order(ord);
test_teardown();

View File

@ -971,7 +971,7 @@ int quit_cmd(unit * u, struct order *ord)
const char *passwd;
keyword_t kwd;
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_QUIT);
passwd = gettoken(token, sizeof(token));
if (checkpasswd(f, (const char *)passwd)) {
@ -1188,7 +1188,7 @@ void do_enter(struct region *r, bool is_final_attempt)
unit *ulast = NULL;
const char * s;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
p = findparam_ex(s, u->faction->locale);
id = getid();
@ -1349,7 +1349,7 @@ int ally_cmd(unit * u, struct order *ord)
const char *s;
int sf_status;
init_order_depr(ord);
init_order(ord, NULL);
f = getfaction();
if (f == NULL || is_monsters(f)) {
@ -1505,7 +1505,7 @@ int prefix_cmd(unit * u, struct order *ord)
if (!in) return 0;
}
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
if (!s || !*s) {
@ -1544,7 +1544,7 @@ int display_cmd(unit * u, struct order *ord)
char *str;
region *r = u->region;
init_order_depr(ord);
init_order(ord, NULL);
str = gettoken(token, sizeof(token));
switch (findparam_ex(str, u->faction->locale)) {
@ -1982,7 +1982,7 @@ int mail_cmd(unit * u, struct order *ord)
const char *s;
int n, cont;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
/* Falls kein Parameter, ist das eine Einheitsnummer;
@ -2127,7 +2127,7 @@ int banner_cmd(unit * u, struct order *ord)
{
const char * s;
init_order_depr(ord);
init_order(ord, NULL);
s = getstrtoken();
if (!s || !s[0]) {
cmistake(u, ord, 125, MSG_EVENT);
@ -2144,7 +2144,7 @@ int email_cmd(unit * u, struct order *ord)
{
const char *s;
init_order_depr(ord);
init_order(ord, NULL);
s = getstrtoken();
if (!s || !s[0]) {
@ -2183,7 +2183,7 @@ int password_cmd(unit * u, struct order *ord)
char pwbuf[PASSWORD_MAXSIZE + 1];
const char *s;
init_order_depr(ord);
init_order(ord, NULL);
pwbuf[PASSWORD_MAXSIZE] = '\n';
s = gettoken(pwbuf, sizeof(pwbuf));
if (pwbuf[PASSWORD_MAXSIZE] == '\0') {
@ -2209,7 +2209,7 @@ int send_cmd(unit * u, struct order *ord)
const char *s;
int option;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
option = findoption(s, u->faction->locale);
@ -2377,7 +2377,7 @@ int group_cmd(unit * u, struct order *ord)
{
keyword_t kwd;
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_GROUP);
join_group(u, getstrtoken());
return 0;
@ -2387,7 +2387,7 @@ int origin_cmd(unit * u, struct order *ord)
{
int px, py;
init_order_depr(ord);
init_order(ord, NULL);
px = getint();
py = getint();
@ -2399,7 +2399,7 @@ int origin_cmd(unit * u, struct order *ord)
int guard_off_cmd(unit * u, struct order *ord)
{
assert(getkeyword(ord) == K_GUARD);
init_order_depr(ord);
init_order(ord, NULL);
if (getparam(u->faction->locale) == P_NOT) {
setguard(u, false);
@ -2413,7 +2413,7 @@ int reshow_cmd(unit * u, struct order *ord)
const char *s;
param_t p = NOPARAM;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(lbuf, sizeof(lbuf));
if (s && isparam(s, u->faction->locale, P_ANY)) {
@ -2430,7 +2430,7 @@ int status_cmd(unit * u, struct order *ord)
char token[128];
const char *s;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
switch (findparam(s, u->faction->locale)) {
case P_NOT:
@ -2478,7 +2478,7 @@ int combatspell_cmd(unit * u, struct order *ord)
int level = 0;
spell *sp = 0;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
/* KAMPFZAUBER [NICHT] loescht alle gesetzten Kampfzauber */
@ -2537,7 +2537,7 @@ int guard_on_cmd(unit * u, struct order *ord)
assert(u);
assert(u->faction);
init_order_depr(ord);
init_order(ord, NULL);
/* GUARD NOT is handled in goard_off_cmd earlier in the turn */
if (getparam(u->faction->locale) == P_NOT) {
@ -2625,7 +2625,7 @@ void restack_units(void)
int id;
unit *v;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
p = findparam(s, u->faction->locale);
id = getid();
@ -2942,7 +2942,7 @@ void maketemp_cmd(unit *u, order **olist)
unit *u2;
order **ordp, **oinsert;
#ifndef NDEBUG
keyword_t kwd = init_order_depr(makeord);
keyword_t kwd = init_order(makeord, NULL);
assert(kwd == K_MAKETEMP);
#endif
alias = getid();
@ -3236,7 +3236,7 @@ void defaultorders(void)
char lbuf[8192];
order *new_order = 0;
const char *s;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(lbuf, sizeof(lbuf));
if (s) {
new_order = parse_order(s, u->faction->locale);
@ -3370,7 +3370,7 @@ int use_cmd(unit * u, struct order *ord)
int n, err = ENOITEM;
const item_type *itype;
init_order_depr(ord);
init_order(ord, NULL);
t = gettoken(token, sizeof(token));
if (!t) {
@ -3424,7 +3424,7 @@ int pay_cmd(unit * u, struct order *ord)
param_t p;
int id;
init_order_depr(ord);
init_order(ord, NULL);
p = getparam(u->faction->locale);
id = getid();
if (p == P_NOT) {
@ -3477,7 +3477,7 @@ static int reserve_i(unit * u, struct order *ord, int flags)
const item_type *itype;
const char *s;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
count = s ? atoip(s) : 0;
para = findparam(s, u->faction->locale);
@ -3520,7 +3520,7 @@ int claim_cmd(unit * u, struct order *ord)
int n = 1;
const item_type *itype = 0;
init_order_depr(ord);
init_order(ord, NULL);
t = gettoken(token, sizeof(token));
if (t) {

View File

@ -2546,7 +2546,7 @@ static castorder *cast_cmd(unit * u, order * ord)
}
level = effskill(u, SK_MAGIC, NULL);
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
param = findparam(s, u->faction->locale);
/* fuer Syntax ' STUFE x REGION y z ' */

View File

@ -1131,7 +1131,7 @@ static bool transport(unit * ut, unit * u)
for (ord = ut->orders; ord; ord = ord->next) {
if (getkeyword(ord) == K_TRANSPORT) {
unit *u2;
init_order_depr(ord);
init_order(ord, NULL);
getunit(ut->region, ut->faction, &u2);
if (u2 == u) {
return true;
@ -1165,7 +1165,7 @@ static void init_transportation(void)
&& !fval(u, UFL_NOTMOVING) && !LongHunger(u)) {
unit *ut = 0;
init_order_depr(u->thisorder);
init_order(u->thisorder, NULL);
if (getunit(r, u->faction, &ut) != GET_UNIT) {
ADDMSG(&u->faction->msgs, msg_feedback(u, u->thisorder,
"feedback_unit_not_found", ""));
@ -1194,7 +1194,7 @@ static void init_transportation(void)
for (ord = u->orders; ord; ord = ord->next) {
if (getkeyword(ord) == K_TRANSPORT) {
init_order_depr(ord);
init_order(ord, NULL);
for (;;) {
unit *ut = 0;
@ -1205,7 +1205,7 @@ static void init_transportation(void)
can_move(ut) && !fval(ut, UFL_NOTMOVING) &&
!LongHunger(ut)) {
unit *u2;
init_order_depr(ut->thisorder);
init_order(ut->thisorder, NULL);
getunit(r, ut->faction, &u2);
if (u2 == u) {
w += weight(ut);
@ -2046,7 +2046,7 @@ static const region_list *travel_i(unit * u, const region_list * route_begin,
if (getkeyword(ord) != K_TRANSPORT)
continue;
init_order_depr(ord);
init_order(ord, NULL);
if (getunit(r, u->faction, &ut) == GET_UNIT) {
if (getkeyword(ut->thisorder) == K_DRIVE) {
if (ut->building && !can_leave(ut)) {
@ -2061,7 +2061,7 @@ static const region_list *travel_i(unit * u, const region_list * route_begin,
if (!fval(ut, UFL_NOTMOVING) && !LongHunger(ut)) {
unit *u2;
init_order_depr(ut->thisorder);
init_order(ut->thisorder, NULL);
getunit(u->region, ut->faction, &u2);
if (u2 == u) {
const region_list *route_to =
@ -2332,7 +2332,7 @@ static void move_followers(void)
if (getkeyword(ord) == K_FOLLOW) {
param_t p;
init_order_depr(ord);
init_order(ord, NULL);
p = getparam(u->faction->locale);
if (p != P_SHIP) {
if (p != P_UNIT) {
@ -2513,7 +2513,7 @@ void follow_unit(unit * u)
if (getkeyword(ord) == K_FOLLOW) {
int id;
param_t p;
init_order_depr(ord);
init_order(ord, NULL);
p = getparam(lang);
if (p == P_UNIT) {
id = read_unitid(u->faction, r);

View File

@ -549,7 +549,7 @@ static void test_follow_ship_msg(CuTest * tc) {
mt_create_va(mt_new("error18", NULL),
"unit:unit", "region:region", "command:order", MT_NEW_END);
init_order_depr(ord);
init_order(ord, NULL);
skip_token();
follow_ship(u, ord);

View File

@ -81,7 +81,7 @@ int *parse_ids(const order *ord) {
const char *s;
int *il = NULL;
init_order_depr(ord);
init_order(ord, NULL);
s = getstrtoken();
if (s != NULL && *s) {
il = intlist_init();

View File

@ -384,7 +384,7 @@ static void recruit_cmd(unit * u, struct order *ord, recruit_request ** recruito
int n;
message *msg;
init_order_depr(ord);
init_order(ord, NULL);
n = getint();
if (n <= 0) {
syntax_error(u, ord);

View File

@ -84,7 +84,7 @@ int renumber_cmd(unit * u, order * ord)
int i = 0;
faction *f = u->faction;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
switch (findparam_ex(s, u->faction->locale)) {

View File

@ -112,7 +112,7 @@ int spy_cmd(unit * u, struct order *ord)
double spychance, observechance;
region *r = u->region;
init_order_depr(ord);
init_order(ord, NULL);
getunit(r, u->faction, &target);
if (!target) {
@ -233,7 +233,7 @@ int setstealth_cmd(unit * u, struct order *ord)
char token[64];
const char *s;
init_order_depr(ord);
init_order(ord, NULL);
s = gettoken(token, sizeof(token));
/* Tarne ohne Parameter: Setzt maximale Tarnung */
@ -414,10 +414,10 @@ int sabotage_cmd(unit * u, struct order *ord)
assert(u);
assert(ord);
init_order_depr(ord);
init_order(ord, NULL);
s = getstrtoken();
p = findparam(s, u->faction->locale);
init_order_depr(NULL);
reset_order();
switch (p) {
case P_SHIP:

View File

@ -123,7 +123,7 @@ void steal_cmd(unit * u, struct order *ord, econ_request ** stealorders)
message * msg;
keyword_t kwd;
kwd = init_order_depr(ord);
kwd = init_order(ord, NULL);
assert(kwd == K_STEAL);
assert(skill_enabled(SK_PERCEPTION) && skill_enabled(SK_STEALTH));

View File

@ -258,7 +258,7 @@ int teach_cmd(unit * teacher, struct order *ord)
count = 0;
init_order_depr(ord);
init_order(ord, NULL);
#if TEACH_ALL
if (getparam(teacher->faction->locale) == P_ANY) {
@ -318,7 +318,7 @@ int teach_cmd(unit * teacher, struct order *ord)
order *new_order;
zOrder[0] = '\0';
init_order_depr(ord);
init_order(ord, NULL);
while (!parser_end()) {
skill_t sk;
@ -336,7 +336,7 @@ int teach_cmd(unit * teacher, struct order *ord)
const char *token;
/* Finde den string, der den Fehler verursacht hat */
parser_pushstate();
init_order_depr(ord);
init_order(ord, NULL);
for (j = 0; j != count - 1; ++j) {
/* skip over the first 'count' units */
@ -424,7 +424,7 @@ int teach_cmd(unit * teacher, struct order *ord)
if (academy_students > 0 && sk_academy!=NOSKILL) {
academy_teaching_bonus(teacher, sk_academy, academy_students);
}
init_order_depr(NULL);
reset_order();
return 0;
}
@ -768,7 +768,7 @@ int study_cmd(unit * u, order * ord)
show_potions(f, skill);
}
}
init_order(NULL, NULL);
reset_order();
return 0;
}