summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorcodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-02 09:19:02 +0000
committercodemaster <codemaster@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-02 09:19:02 +0000
commit3fd46a04bd232cc9cfa49b161744ef0713b53fbb (patch)
tree5324d828e73ca3153310c63c3c2c6bdd34c7dac1 /src/map/pc.c
parentb8349f39d66be3df5d81e9ac2a0ff5b4a1dcdd88 (diff)
downloadhercules-3fd46a04bd232cc9cfa49b161744ef0713b53fbb.tar.gz
hercules-3fd46a04bd232cc9cfa49b161744ef0713b53fbb.tar.bz2
hercules-3fd46a04bd232cc9cfa49b161744ef0713b53fbb.tar.xz
hercules-3fd46a04bd232cc9cfa49b161744ef0713b53fbb.zip
* Made it so players that are at the max level do not receive EXP. This makes it so a player at the max level (ie - 99) cannot join a party and feed all of his or her EXP to the other party members [Codemaster]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5422 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c54
1 files changed, 34 insertions, 20 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 18b943965..7d4a75e0c 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4628,30 +4628,44 @@ 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)
- sd->status.base_exp = UINT_MAX;
- else if (base_exp < 0 && sd->status.base_exp > base_exp)
- sd->status.base_exp = 0;
- else
- sd->status.base_exp += base_exp;
-
- while(pc_checkbaselevelup(sd)) ;
- clif_updatestatus(sd,SP_BASEEXP);
+ // Do not give the player any EXP if they are at the highest level
+ // Prevents them from sharing excess EXP in a party
+ if(pc_maxbaselv(sd) > sd->status.base_level)
+ {
+ //Overflow checks... think we'll ever really need'em? [Skotlex]
+ if (base_exp > 0 && sd->status.base_exp > UINT_MAX - base_exp)
+ sd->status.base_exp = UINT_MAX;
+ else if (base_exp < 0 && sd->status.base_exp > base_exp)
+ sd->status.base_exp = 0;
+ else
+ sd->status.base_exp += base_exp;
- //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 (job_exp < 0 && sd->status.job_exp > job_exp)
- sd->status.job_exp = 0;
- else
- sd->status.job_exp += job_exp;
+ while(pc_checkbaselevelup(sd)) ;
+
+ clif_updatestatus(sd,SP_BASEEXP);
+ } else {
+ base_exp = 0;
+ }
+
+ // Do not give the player any EXP if they are at the highest level
+ // Prevents them from sharing excess EXP in a party
+ if(pc_maxjoblv(sd) > sd->status.job_level)
+ {
+ //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 (job_exp < 0 && sd->status.job_exp > job_exp)
+ sd->status.job_exp = 0;
+ else
+ sd->status.job_exp += job_exp;
- while(pc_checkjoblevelup(sd)) ;
+ while(pc_checkjoblevelup(sd)) ;
- clif_updatestatus(sd,SP_JOBEXP);
+ clif_updatestatus(sd,SP_JOBEXP);
+ } else {
+ job_exp = 0;
+ }
if(sd->state.showexp){
sprintf(output,