diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-12-30 17:23:54 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-12-30 17:23:54 +0000 |
commit | 457f404245134d0a84d83d697111bf17fb68b0f4 (patch) | |
tree | 0ceaa9b19fba1c05ddb6e3e01c6efaf68879c3a4 /src/map/atcommand.c | |
parent | 10b223a4bfb9c60bb8bc86f18feb69b7313d854b (diff) | |
download | hercules-457f404245134d0a84d83d697111bf17fb68b0f4.tar.gz hercules-457f404245134d0a84d83d697111bf17fb68b0f4.tar.bz2 hercules-457f404245134d0a84d83d697111bf17fb68b0f4.tar.xz hercules-457f404245134d0a84d83d697111bf17fb68b0f4.zip |
* Fixed improper use of itemdb_search. It does not return NULL but a dummy item, if the item id is invalid.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14642 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 95b3dc33e..2747a8bfa 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6986,7 +6986,7 @@ ACMD_FUNC(mobinfo) strcpy(atcmd_output, " "); j = 0; for (i = 0; i < MAX_MOB_DROP; i++) { - if (mob->dropitem[i].nameid <= 0 || mob->dropitem[i].p < 1 || (item_data = itemdb_search(mob->dropitem[i].nameid)) == NULL) + if (mob->dropitem[i].nameid <= 0 || mob->dropitem[i].p < 1 || (item_data = itemdb_exists(mob->dropitem[i].nameid)) == NULL) continue; if (item_data->slot) sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, (float)mob->dropitem[i].p / 100); @@ -7009,7 +7009,7 @@ ACMD_FUNC(mobinfo) strcpy(atcmd_output, " MVP Items:"); j = 0; for (i = 0; i < 3; i++) { - if (mob->mvpitem[i].nameid <= 0 || (item_data = itemdb_search(mob->mvpitem[i].nameid)) == NULL) + if (mob->mvpitem[i].nameid <= 0 || (item_data = itemdb_exists(mob->mvpitem[i].nameid)) == NULL) continue; if (mob->mvpitem[i].p > 0) { j++; @@ -8323,7 +8323,7 @@ ACMD_FUNC(itemlist) const struct item* it = &items[i]; struct item_data* itd; - if( it->nameid == 0 || (itd = itemdb_search(it->nameid)) == NULL ) + if( it->nameid == 0 || (itd = itemdb_exists(it->nameid)) == NULL ) continue; counter += it->amount; @@ -8406,7 +8406,7 @@ ACMD_FUNC(itemlist) { struct item_data* card; - if( it->card[j] == 0 || (card = itemdb_search(it->card[j])) == NULL ) + if( it->card[j] == 0 || (card = itemdb_exists(it->card[j])) == NULL ) continue; counter2++; |