summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-27 11:06:55 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-27 11:06:55 +0000
commitaf99be9bd11d716e0b8ef8eab4a36c9b9925e4c8 (patch)
tree45c74210524f6069f3cb6750744cb59af5031c30 /src/map/mob.c
parent8dedf18e168afd90230af1997edb593431b36e03 (diff)
downloadhercules-af99be9bd11d716e0b8ef8eab4a36c9b9925e4c8.tar.gz
hercules-af99be9bd11d716e0b8ef8eab4a36c9b9925e4c8.tar.bz2
hercules-af99be9bd11d716e0b8ef8eab4a36c9b9925e4c8.tar.xz
hercules-af99be9bd11d716e0b8ef8eab4a36c9b9925e4c8.zip
Cleaning up the itemdb reload mess (see r12635, r12643, r12650, r12661, r12662, r12663)
* the player data inventory-itemdb index is now refreshed using pc_setinventorydata() * mobdb will no longer initialize with nonexistent items, and mobs will no longer drop them in case of a reload * the clif_buylist() function once again hides invalid npc shop items * it is no longer possible to purchase nonexistent items from a npc shop * npc shop loading will not abort if there is a nonexistent item entry, it will just skip over it git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12665 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 2288227b4..a7fc4a783 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2310,12 +2310,15 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
{
if (md->db->dropitem[i].nameid <= 0)
continue;
+ if (!itemdb_exists(md->db->dropitem[i].nameid))
+ continue;
drop_rate = md->db->dropitem[i].p;
if (drop_rate <= 0) {
if (battle_config.drop_rate0item)
continue;
drop_rate = 1;
}
+
// change drops depending on monsters size [Valaris]
if(md->special_state.size==1 && drop_rate >= 2)
drop_rate/=2;
@@ -2456,6 +2459,8 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if(md->db->mvpitem[i].nameid <= 0)
continue;
+ if(!itemdb_exists(md->db->mvpitem[i].nameid))
+ continue;
temp = md->db->mvpitem[i].p;
if(temp <= 0 && !battle_config.drop_rate0item)