summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-02 22:33:32 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-12-02 22:33:32 +0000
commitb4bcbd1a2dca417a61f70eb9d1524fa92b2e0aa9 (patch)
tree64e357255f2460a8c93fb46e315e606416f84583 /src/map/atcommand.c
parente6b8222bdb14b6e1e8b3cd12733ae1bce97a23fb (diff)
downloadhercules-b4bcbd1a2dca417a61f70eb9d1524fa92b2e0aa9.tar.gz
hercules-b4bcbd1a2dca417a61f70eb9d1524fa92b2e0aa9.tar.bz2
hercules-b4bcbd1a2dca417a61f70eb9d1524fa92b2e0aa9.tar.xz
hercules-b4bcbd1a2dca417a61f70eb9d1524fa92b2e0aa9.zip
* Various code tweaks and updates related to item types.
- Replaced item type literals with their appropriate constants. - Added itemdb_typename to replace the ugly "BUG!" filled array in @iteminfo (since r1741, follow up to r14550). - Made the item database parser verify item type for validity. - Added item type constants to const.txt for use in scripts (getiteminfo). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14551 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 6cf5d1c4e..117d6dc0a 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1663,15 +1663,15 @@ ACMD_FUNC(item2)
if (item_id > 500) {
loop = 1;
get_count = number;
- if (item_data->type == 4 || item_data->type == 5 ||
- item_data->type == 7 || item_data->type == 8) {
+ if (item_data->type == IT_WEAPON || item_data->type == IT_ARMOR ||
+ item_data->type == IT_PETEGG || item_data->type == IT_PETARMOR) {
loop = number;
get_count = 1;
- if (item_data->type == 7) {
+ if (item_data->type == IT_PETEGG) {
identify = 1;
refine = 0;
}
- if (item_data->type == 8)
+ if (item_data->type == IT_PETARMOR)
refine = 0;
if (refine > 10)
refine = 10;
@@ -7390,10 +7390,6 @@ ACMD_FUNC(homshuffle)
*------------------------------------------*/
ACMD_FUNC(iteminfo)
{
- char *itype[IT_MAX] = {"Potion/Food", "BUG!", "Usable", "Etc", "Weapon", "Protection", "Card", "Egg", "Pet Acessory", "BUG!", "Arrow",
- "BUG!", // No need, type 11 items are converted to type 2 upon loading [Skotlex]
- "BUG!", "BUG!", "BUG!", "BUG!", "BUG!", "BUG!", "Cash Usable"};
-
struct item_data *item_data, *item_array[MAX_SEARCH];
int i, count = 1;
@@ -7418,7 +7414,7 @@ ACMD_FUNC(iteminfo)
item_data = item_array[i];
sprintf(atcmd_output, "Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s",
item_data->name,item_data->jname,item_data->slot,item_data->nameid,
- item_data->type < IT_MAX ? itype[item_data->type] : "BUG!",
+ itemdb_typename(item_data->type),
(item_data->script==NULL)? "None" : "With script"
);
clif_displaymessage(fd, atcmd_output);