summaryrefslogtreecommitdiff
path: root/src/map/charsave.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-18 02:04:25 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-18 02:04:25 +0000
commit9f8f222a8dc995e03cb51ac827e790c5926b312d (patch)
tree65cf1b78893a3b9769d91b545b587466e24ed30e /src/map/charsave.c
parent6f51acd64405e1f081e1a54a5c3f5c3b5431bc70 (diff)
downloadhercules-9f8f222a8dc995e03cb51ac827e790c5926b312d.tar.gz
hercules-9f8f222a8dc995e03cb51ac827e790c5926b312d.tar.bz2
hercules-9f8f222a8dc995e03cb51ac827e790c5926b312d.tar.xz
hercules-9f8f222a8dc995e03cb51ac827e790c5926b312d.zip
- Vaporize will no fail when the homun is dead.
- Corrected thhe double free issue that occurs when a homun dies and has no intimacy left. - Fixed the charsave_method:1 saving/loading exp as signed ints rather than unsigned. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8335 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/charsave.c')
-rw-r--r--src/map/charsave.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/map/charsave.c b/src/map/charsave.c
index 0c55164cb..1be249e5a 100644
--- a/src/map/charsave.c
+++ b/src/map/charsave.c
@@ -24,6 +24,7 @@ struct mmo_charstatus *charsave_loadchar(int charid){
int i,j, friends;
struct mmo_charstatus *c;
char *str_p;
+ double exp;
friends = 0;
c = (struct mmo_charstatus *)aCalloc(1,sizeof(struct mmo_charstatus));
@@ -62,8 +63,10 @@ struct mmo_charstatus *charsave_loadchar(int charid){
c->class_ = atoi(charsql_row[4]);
c->base_level = atoi(charsql_row[5]);
c->job_level = atoi(charsql_row[6]);
- c->base_exp = atoi(charsql_row[7]);
- c->job_exp = atoi(charsql_row[8]);
+ exp = atof(charsql_row[7]);
+ c->base_exp = (unsigned int)cap_value(exp,0,UINT_MAX);
+ exp = atof(charsql_row[8]);
+ c->job_exp = (unsigned int)cap_value(exp,0,UINT_MAX);
c->zeny = atoi(charsql_row[9]);
c->str = atoi(charsql_row[10]);
c->agi = atoi(charsql_row[11]);
@@ -276,7 +279,7 @@ int charsave_savechar(int charid, struct mmo_charstatus *c){
// char tmp_str2[512];
//First save the 'char'
sprintf(tmp_sql ,"UPDATE `char` SET `class`='%d', `base_level`='%d', `job_level`='%d',"
- "`base_exp`='%d', `job_exp`='%d', `zeny`='%d',"
+ "`base_exp`='%u', `job_exp`='%u', `zeny`='%d',"
"`max_hp`='%d',`hp`='%d',`max_sp`='%d',`sp`='%d',`status_point`='%d',`skill_point`='%d',"
"`str`='%d',`agi`='%d',`vit`='%d',`int`='%d',`dex`='%d',`luk`='%d',"
"`option`='%d',`karma`='%d',`manner`='%d',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',"