From 7e72f0cee8867837be53cb2119b610b00e9bd587 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Mon, 18 Feb 2013 00:30:28 -0300 Subject: Improvements all over the place Committing on the behalf of mkbu95 who is unable to do it himself, he coded it all and sent me the diff. Thanks mkbu95! Signed-off-by: shennetsind --- src/map/atcommand.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 320ca83ff..ed42fdad4 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -920,7 +920,7 @@ ACMD_FUNC(option) if (!message || !*message || sscanf(message, "%d %d %d", ¶m1, ¶m2, ¶m3) < 1 || param1 < 0 || param2 < 0 || param3 < 0) {// failed to match the parameters so inform the user of the options - const char* text = NULL; + const char* text; // attempt to find the setting information for this command text = atcommand_help_string( command ); @@ -1230,8 +1230,6 @@ ACMD_FUNC(item2) int item_id, number = 0; int identify = 0, refine = 0, attr = 0; int c1 = 0, c2 = 0, c3 = 0, c4 = 0; - int flag = 0; - int loop, get_count, i; nullpo_retr(-1, sd); memset(item_name, '\0', sizeof(item_name)); @@ -1254,6 +1252,8 @@ ACMD_FUNC(item2) item_id = item_data->nameid; if (item_id > 500) { + int flag = 0; + int loop, get_count, i; loop = 1; get_count = number; if (item_data->type == IT_WEAPON || item_data->type == IT_ARMOR || @@ -2161,7 +2161,6 @@ ACMD_FUNC(produce) { char item_name[100]; int item_id, attribute = 0, star = 0; - int flag = 0; struct item_data *item_data; struct item tmp_item; nullpo_retr(-1, sd); @@ -2186,6 +2185,7 @@ ACMD_FUNC(produce) item_id = item_data->nameid; if (itemdb_isequip2(item_data)) { + int flag = 0; if (attribute < MIN_ATTRIBUTE || attribute > MAX_ATTRIBUTE) attribute = ATTRIBUTE_NORMAL; if (star < MIN_STAR || star > MAX_STAR) @@ -2822,7 +2822,7 @@ ACMD_FUNC(char_ban) memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); - if (!message || !*message || sscanf(message, "%s %23[^\n]", atcmd_output, atcmd_player_name) < 2) { + if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) { clif_displaymessage(fd, msg_txt(1022)); // Please enter ban time and a player name (usage: @charban/@ban/@banish/@charbanish