From d4400bb583eb78c2ad755343289303e67b918fef Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 13 Aug 2020 16:50:29 +0200 Subject: [PATCH] remove deprecated init_order_depr --- src/battle.c | 2 +- src/bind_order.c | 2 +- src/economy.c | 18 +++++++-------- src/give.c | 2 +- src/kernel/alliance.c | 10 ++++----- src/kernel/build.c | 2 +- src/kernel/command.c | 2 +- src/kernel/config.test.c | 24 ++++++++++---------- src/kernel/order.c | 10 +++------ src/kernel/order.h | 2 +- src/kernel/order.test.c | 6 ++--- src/laws.c | 48 ++++++++++++++++++++-------------------- src/magic.c | 2 +- src/move.c | 16 +++++++------- src/move.test.c | 2 +- src/piracy.c | 2 +- src/recruit.c | 2 +- src/renumber.c | 2 +- src/spy.c | 8 +++---- src/steal.c | 2 +- src/study.c | 10 ++++----- 21 files changed, 85 insertions(+), 89 deletions(-) diff --git a/src/battle.c b/src/battle.c index 4cd8e41cd..efaefd19c 100644 --- a/src/battle.c +++ b/src/battle.c @@ -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); diff --git a/src/bind_order.c b/src/bind_order.c index dd38f4adb..b3260201b 100644 --- a/src/bind_order.c +++ b/src/bind_order.c @@ -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) { diff --git a/src/economy.c b/src/economy.c index 881614114..d7a1b9373 100644 --- a/src/economy.c +++ b/src/economy.c @@ -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 [] */ - (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)) { diff --git a/src/give.c b/src/give.c index 0338fa590..df1d64640 100644 --- a/src/give.c +++ b/src/give.c @@ -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)); diff --git a/src/kernel/alliance.c b/src/kernel/alliance.c index 17683a0f3..f71df27bd 100644 --- a/src/kernel/alliance.c +++ b/src/kernel/alliance.c @@ -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) { diff --git a/src/kernel/build.c b/src/kernel/build.c index 76cbe9f34..14f922f57 100644 --- a/src/kernel/build.c +++ b/src/kernel/build.c @@ -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) { diff --git a/src/kernel/command.c b/src/kernel/command.c index 51dab1f10..bf547e2d4 100644 --- a/src/kernel/command.c +++ b/src/kernel/command.c @@ -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)); diff --git a/src/kernel/config.test.c b/src/kernel/config.test.c index cc476c6c3..80813b6ba 100644 --- a/src/kernel/config.test.c +++ b/src/kernel/config.test.c @@ -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); diff --git a/src/kernel/order.c b/src/kernel/order.c index f3b30719e..d54747417 100644 --- a/src/kernel/order.c +++ b/src/kernel/order.c @@ -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(); } } diff --git a/src/kernel/order.h b/src/kernel/order.h index cd5f59ba7..0baa87ba6 100644 --- a/src/kernel/order.h +++ b/src/kernel/order.h @@ -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); diff --git a/src/kernel/order.test.c b/src/kernel/order.test.c index 1ce993a69..955695b43 100644 --- a/src/kernel/order.test.c +++ b/src/kernel/order.test.c @@ -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(); diff --git a/src/laws.c b/src/laws.c index 676f82b9d..db7c60a8b 100644 --- a/src/laws.c +++ b/src/laws.c @@ -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) { diff --git a/src/magic.c b/src/magic.c index c29da6acd..16fb401c4 100644 --- a/src/magic.c +++ b/src/magic.c @@ -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 ' */ diff --git a/src/move.c b/src/move.c index f0b38bb48..8517bf236 100644 --- a/src/move.c +++ b/src/move.c @@ -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); diff --git a/src/move.test.c b/src/move.test.c index 0e942251e..17a7ed4cc 100644 --- a/src/move.test.c +++ b/src/move.test.c @@ -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); diff --git a/src/piracy.c b/src/piracy.c index 77121aade..ae2ad4727 100644 --- a/src/piracy.c +++ b/src/piracy.c @@ -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(); diff --git a/src/recruit.c b/src/recruit.c index 4f4be25b7..2ad875114 100644 --- a/src/recruit.c +++ b/src/recruit.c @@ -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); diff --git a/src/renumber.c b/src/renumber.c index 820828339..ca39af93a 100644 --- a/src/renumber.c +++ b/src/renumber.c @@ -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)) { diff --git a/src/spy.c b/src/spy.c index 8fcfa31e2..8233f5eb2 100644 --- a/src/spy.c +++ b/src/spy.c @@ -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: diff --git a/src/steal.c b/src/steal.c index b93a283f0..1213ab43e 100644 --- a/src/steal.c +++ b/src/steal.c @@ -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)); diff --git a/src/study.c b/src/study.c index 802fc5fe1..bb2d4fe7a 100644 --- a/src/study.c +++ b/src/study.c @@ -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; }