From 5de3852d0e203ad08e4bdd748a49f8dba2e028c2 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 1 Feb 2007 21:04:46 +0000 Subject: - Item search is now a bit smarter. When no item is found with the same 'aegis name', then the 'normal' name is used instead. - Updated the @/# commands that take an item name so that you can use quotes when specifying item names with spaces in them. For example, @item "poring card" 1 will work now. Note that only the commands that work on ONE item have been updated, those that do an item list need to be updated as well. - Removed some garbage from the item_data structure. - Improved a bit the description of the mvp item get time config settings. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9767 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 0c4809b3a..d11b898e8 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -2549,7 +2549,10 @@ int atcommand_item(const int fd, struct map_session_data* sd, const char* comman memset(item_name, '\0', sizeof(item_name)); - if (!message || !*message || sscanf(message, "%99s %d", item_name, &number) < 1) { + if (!message || !*message || ( + sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 && + sscanf(message, "%99s %d", item_name, &number) < 1 + )) { clif_displaymessage(fd, "Please, enter an item name/id (usage: @item [quantity])."); return -1; } @@ -2608,7 +2611,10 @@ int atcommand_item2(const int fd, struct map_session_data* sd, const char* comma memset(item_name, '\0', sizeof(item_name)); - if (!message || !*message || sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9) { + if (!message || !*message || ( + sscanf(message, "\"%99[^\"]\" %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 && + sscanf(message, "%99s %d %d %d %d %d %d %d %d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 + )) { clif_displaymessage(fd, "Please, enter all informations (usage: @item2 "); clif_displaymessage(fd, " )."); return -1; @@ -3752,7 +3758,10 @@ int atcommand_produce(const int fd, struct map_session_data* sd, const char* com memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(item_name, '\0', sizeof(item_name)); - if (!message || !*message || sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1) { + if (!message || !*message || ( + sscanf(message, "\"%99[^\"]\" %d %d", item_name, &attribute, &star) < 1 && + sscanf(message, "%99s %d %d", item_name, &attribute, &star) < 1 + )) { clif_displaymessage(fd, "Please, enter at least an item name/id (usage: @produce <# of very's>)."); return -1; } @@ -6125,7 +6134,10 @@ int atcommand_chardelitem(const int fd, struct map_session_data* sd, const char* memset(item_name, '\0', sizeof(item_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); - if (!message || !*message || sscanf(message, "%s %d %99[^\n]", item_name, &number, atcmd_player_name) < 3 || number < 1) { + if (!message || !*message || ( + sscanf(message, "\"%99[^\"]\" %d %99[^\n]", item_name, &number, atcmd_player_name) < 3 && + sscanf(message, "%s %d %99[^\n]", item_name, &number, atcmd_player_name) < 3 + ) || number < 1) { clif_displaymessage(fd, "Please, enter an item name/id, a quantity and a player name (usage: @chardelitem )."); return -1; } -- cgit v1.2.3-70-g09d2