summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-01 21:04:46 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-02-01 21:04:46 +0000
commit5de3852d0e203ad08e4bdd748a49f8dba2e028c2 (patch)
treee4a1fce223b40e891fc5395c749d47b4de1fcd41 /src/map/atcommand.c
parentca0aa0f7e55896730f6470a7dec81e6293b305ff (diff)
downloadhercules-5de3852d0e203ad08e4bdd748a49f8dba2e028c2.tar.gz
hercules-5de3852d0e203ad08e4bdd748a49f8dba2e028c2.tar.bz2
hercules-5de3852d0e203ad08e4bdd748a49f8dba2e028c2.tar.xz
hercules-5de3852d0e203ad08e4bdd748a49f8dba2e028c2.zip
- 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
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c20
1 files changed, 16 insertions, 4 deletions
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 <item name or ID> [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 <item name or ID> <quantity>");
clif_displaymessage(fd, " <Identify_flag> <refine> <attribut> <Card1> <Card2> <Card3> <Card4>).");
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 <equip name or equip ID> <element> <# 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 <item_name_or_ID> <quantity> <player>).");
return -1;
}