summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-03-30 10:18:25 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-03-30 10:18:25 +0000
commitc19903f2726d0132323bb66237c2e88dc7aa0f62 (patch)
treecf37df56479db35187cac293edd776ec1eeb8193 /src/map/atcommand.c
parentbd856899e58039684d6220c6f17dd9a9fec4a7a2 (diff)
downloadhercules-c19903f2726d0132323bb66237c2e88dc7aa0f62.tar.gz
hercules-c19903f2726d0132323bb66237c2e88dc7aa0f62.tar.bz2
hercules-c19903f2726d0132323bb66237c2e88dc7aa0f62.tar.xz
hercules-c19903f2726d0132323bb66237c2e88dc7aa0f62.zip
Fixed atcommand_param() using a hardcoded @ symbol, which broke on charcommands and changed atcommand_symbol (bugreport:2918).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13642 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 1ed4f0701..591a8ca8e 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -2936,7 +2936,7 @@ int atcommand_zeny(const int fd, struct map_session_data* sd, const char* comman
int atcommand_param(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
int i, value = 0, new_value, max;
- const char* param[] = { "@str", "@agi", "@vit", "@int", "@dex", "@luk", NULL };
+ const char* param[] = { "str", "agi", "vit", "int", "dex", "luk" };
short* status[6];
//we don't use direct initialization because it isn't part of the c standard.
nullpo_retr(-1, sd);
@@ -2949,11 +2949,9 @@ int atcommand_param(const int fd, struct map_session_data* sd, const char* comma
return -1;
}
- for (i = 0; param[i] != NULL; i++)
- if (strcmpi(command, param[i]) == 0)
- break;
+ ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 );
- if (param[i] == NULL || i > MAX_STATUS_TYPE) { // normally impossible...
+ if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible...
sprintf(atcmd_output, "Please, enter a valid value (usage: @str,@agi,@vit,@int,@dex,@luk <+/-adjustment>).");
clif_displaymessage(fd, atcmd_output);
return -1;