diff options
author | Guilherme G. Menaldo <guilherme.menaldo@outlook.com> | 2019-02-24 17:05:43 -0300 |
---|---|---|
committer | Guilherme Menaldo <guilherme.menaldo@outlook.com> | 2019-04-20 15:45:56 -0300 |
commit | e88c941e4dc92d6028960f753cdf6ccd0e7a2fc7 (patch) | |
tree | 8d412c59ccb43aedd948af5e68376de881d5df35 | |
parent | d34df93e14582b1c2ad43763666d674b7e8440ca (diff) | |
download | hercules-e88c941e4dc92d6028960f753cdf6ccd0e7a2fc7.tar.gz hercules-e88c941e4dc92d6028960f753cdf6ccd0e7a2fc7.tar.bz2 hercules-e88c941e4dc92d6028960f753cdf6ccd0e7a2fc7.tar.xz hercules-e88c941e4dc92d6028960f753cdf6ccd0e7a2fc7.zip |
Moved mob drop data to its own structure
-rw-r--r-- | src/map/mob.c | 6 | ||||
-rw-r--r-- | src/map/mob.h | 13 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index a72e3bc42..8dac1ea43 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2667,11 +2667,7 @@ static int mob_dead(struct mob_data *md, struct block_list *src, int type) if (!(map->list[m].flag.nomvploot || type&1)) { /* pose them randomly in the list -- so on 100% drop servers it wont always drop the same item */ - struct { - int nameid; - int p; - struct optdrop_group *options; - } mdrop[MAX_MVP_DROP] = { { 0 } }; + struct mob_drop mdrop[MAX_MVP_DROP] = { { 0 } }; for (i = 0; i < MAX_MVP_DROP; i++) { int rpos; diff --git a/src/map/mob.h b/src/map/mob.h index f7dc82f3b..b63efd272 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -182,6 +182,15 @@ struct optdrop_group { struct optdrop_group_optslot optslot[MAX_ITEM_OPTIONS]; //< Details of the options that will go in each slot }; +/** + * Stores data related to a monster drop (normal or mvp drop) + */ +struct mob_drop { + int nameid; //< Item ID + int p; //< Drop chance + struct optdrop_group *options; //< Option Drop Group associated with this drop (NULL if none) +}; + struct mob_db { int mob_id; char sprite[NAME_LENGTH],name[NAME_LENGTH],jname[NAME_LENGTH]; @@ -190,8 +199,8 @@ struct mob_db { short range2,range3; short race2; // celest unsigned short lv; - struct { int nameid, p; struct optdrop_group *options; } dropitem[MAX_MOB_DROP]; - struct { int nameid,p; struct optdrop_group *options; } mvpitem[MAX_MVP_DROP]; + struct mob_drop dropitem[MAX_MOB_DROP]; + struct mob_drop mvpitem[MAX_MVP_DROP]; struct status_data status; struct view_data vd; unsigned int option; |