- Fixed pc_gainexp resetting your exp to 0 rather than adding it in... -.-

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6828 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-05-29 20:20:42 +00:00
parent 38eeb73b96
commit d3832b5146
3 changed files with 4 additions and 7 deletions

View File

@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/05/29
* Fixed pc_gainexp resetting your exp to 0 rather than adding it in...
[Skotlex]
* Corrected aspd calculation code to avoid negative overflows. [Skotlex]
* Fixed battle_check_target check on BCT_ALL to check versus BL_CHAR
instead of BL_PC and BL_MOB [Skotlex]

View File

@ -1791,7 +1791,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
if(sd) {
if (sd->expaddrace[status->race])
bonus += sd->expaddrace[status->race];
bonus += sd->expaddrace[status->mode&MD_BOSS?10:11];
bonus += sd->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS];
}
if (battle_config.pk_mode &&
(int)(md->db->lv - tmpsd[i]->status.base_level) >= 20) //Needed due to unsigned checks

View File

@ -3843,10 +3843,8 @@ int pc_gainexp(struct map_session_data *sd,unsigned int base_exp,unsigned int jo
}
//Overflow checks... think we'll ever really need'em? [Skotlex]
if (base_exp > 0 && sd->status.base_exp > UINT_MAX - base_exp)
if (base_exp && sd->status.base_exp > UINT_MAX - base_exp)
sd->status.base_exp = UINT_MAX;
else if (sd->status.base_exp > base_exp)
sd->status.base_exp = 0;
else
sd->status.base_exp += base_exp;
@ -3854,11 +3852,8 @@ int pc_gainexp(struct map_session_data *sd,unsigned int base_exp,unsigned int jo
clif_updatestatus(sd,SP_BASEEXP);
//Overflow checks... think we'll ever really need'em? [Skotlex]
if (job_exp > 0 && sd->status.job_exp > UINT_MAX - job_exp)
sd->status.job_exp = UINT_MAX;
else if (sd->status.job_exp > job_exp)
sd->status.job_exp = 0;
else
sd->status.job_exp += job_exp;