diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-01 15:18:15 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-09-01 15:18:15 +0000 |
commit | f15995cea6ac172a676b17fc91fb0940f97ae87f (patch) | |
tree | 4e5485c84d5b25a107221bec906a8b00eaa7077f /src/map/mob.c | |
parent | d3adab9f6f417979f9f7a5915930604d0add5c64 (diff) | |
download | hercules-f15995cea6ac172a676b17fc91fb0940f97ae87f.tar.gz hercules-f15995cea6ac172a676b17fc91fb0940f97ae87f.tar.bz2 hercules-f15995cea6ac172a676b17fc91fb0940f97ae87f.tar.xz hercules-f15995cea6ac172a676b17fc91fb0940f97ae87f.zip |
- Added defines status_base_matk_(max/min) for code readability
- Expanded status_calc_misc so it may also calculate the batk of characters as well as their regen data (if they have it)
- Fixed a memory leak when using charsave_method:1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8576 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index 5be35b97f..636d94ff0 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3122,7 +3122,9 @@ static int mob_readdb(void) char *filename[]={ "mob_db.txt","mob_db2.txt" }; struct status_data *status; int class_, i, fi, k; - + struct mob_data data; + memset(&data, 0, sizeof(struct mob_data)); + data.bl.type = BL_MOB; for(fi=0;fi<2;fi++){ sprintf(line, "%s/%s", db_path, filename[fi]); fp=fopen(line,"r"); @@ -3256,8 +3258,9 @@ static int mob_readdb(void) if(battle_config.monster_damage_delay_rate != 100) status->dmotion = status->dmotion*battle_config.monster_damage_delay_rate/100; - status_calc_misc(status, BL_MOB, mob_db_data[class_]->lv); - + data.level = mob_db_data[class_]->lv; + memcpy(&data.status, status, sizeof(struct status_data)); + status_calc_misc(&data.bl, status, mob_db_data[class_]->lv); // MVP EXP Bonus, Chance: MEXP,ExpPer mob_db_data[class_]->mexp=atoi(str[30])*battle_config.mvp_exp_rate/100; mob_db_data[class_]->mexpper=atoi(str[31]); @@ -3830,6 +3833,9 @@ static int mob_read_sqldb(void) long unsigned int ln = 0; struct status_data *status; char *mob_db_name[] = { mob_db_db, mob_db2_db }; + struct mob_data data; + memset(&data, 0, sizeof(struct mob_data)); + data.bl.type = BL_MOB; //For easier handling of converting. [Skotlex] #define TO_INT(a) (sql_row[a]==NULL?0:atoi(sql_row[a])) @@ -3933,7 +3939,9 @@ static int mob_read_sqldb(void) if(battle_config.monster_damage_delay_rate != 100) status->dmotion = status->dmotion*battle_config.monster_damage_delay_rate/100; - status_calc_misc(status, BL_MOB, mob_db_data[class_]->lv); + data.level = mob_db_data[class_]->lv; + memcpy(&data.status, status, sizeof(struct status_data)); + status_calc_misc(&data.bl, status, mob_db_data[class_]->lv); // MVP EXP Bonus, Chance: MEXP,ExpPer mob_db_data[class_]->mexp = TO_INT(30) * battle_config.mvp_exp_rate / 100; |