summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-21 16:36:06 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-21 16:36:06 +0000
commitf951761cb5e72c8ce65d6465af413f0dc2730e72 (patch)
treec9774d4da9607dce1f8f4551ce6fbaa26260a2e3 /src
parent99ebdaf8e77e81e43d39825163837d6f4b2bc07a (diff)
downloadhercules-f951761cb5e72c8ce65d6465af413f0dc2730e72.tar.gz
hercules-f951761cb5e72c8ce65d6465af413f0dc2730e72.tar.bz2
hercules-f951761cb5e72c8ce65d6465af413f0dc2730e72.tar.xz
hercules-f951761cb5e72c8ce65d6465af413f0dc2730e72.zip
updates
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@700 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char_sql/char.c2
-rw-r--r--src/map/map.c13
-rw-r--r--src/map/pc.c44
3 files changed, 27 insertions, 32 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 47dba6f85..446801b8e 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -3334,7 +3334,7 @@ int do_init(int argc, char **argv){
#undef mysql_query
int debug_mysql_query(char *file, int line, void *mysql, const char *q) {
-// printf("sql: %s:%d# %s\n", file, line, q);
+ // printf("sql: %s:%d# %s\n", file, line, q);
return mysql_query((MYSQL *) mysql, q);
}
diff --git a/src/map/map.c b/src/map/map.c
index 134250cdb..a6317234f 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1023,21 +1023,16 @@ int map_quit(struct map_session_data *sd) {
if(pc_isdead(sd))
pc_setrestartvalue(sd,2);
+
pc_makesavestatus(sd);
- //クロ?ンスキルで?えたスキルは消す
- for(i=0;i<MAX_SKILL;i++){
- if(sd->status.skill[i].flag == 13){
- sd->status.skill[i].id=0;
- sd->status.skill[i].lv=0;
- sd->status.skill[i].flag=0;
- }
- }
chrif_save(sd);
storage_storage_save(sd);
//double connect bug fix by Valaris
- if(sd->alive_timer)
+ if(sd->alive_timer) {
delete_timer(sd->alive_timer,pc_alive_timer);
+ sd->alive_timer = NULL;
+ }
if( sd->npc_stackbuf && sd->npc_stackbuf != NULL)
free( sd->npc_stackbuf );
diff --git a/src/map/pc.c b/src/map/pc.c
index 306360ed5..c10eef425 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -381,6 +381,7 @@ static int pc_walktoxy_sub(struct map_session_data *);
*/
int pc_makesavestatus(struct map_session_data *sd)
{
+ int i;
nullpo_retr(0, sd);
// 秒フ色は色?弊害が多いので保存?象にはしない
@@ -409,6 +410,18 @@ int pc_makesavestatus(struct map_session_data *sd)
//マナ?ポイントがプラスだった場合0に
if(battle_config.muting_players && sd->status.manner > 0)
sd->status.manner = 0;
+
+ // Make sure all the skills are in the correct condition
+ // before persisting to the backend.. [MouseJstr]
+ for(i=0;i<MAX_SKILL;i++){
+ if(sd->status.skill[i].flag == 13){
+ sd->status.skill[i].id=0;
+ sd->status.skill[i].lv=0;
+ sd->status.skill[i].flag=0;
+ } else if ((sd->status.skill[i].lv != 0) && (sd->status.skill[i].id == 0))
+ sd->status.skill[i].id = i;
+ }
+
return 0;
}
@@ -984,7 +997,8 @@ int pc_calc_skilltree(struct map_session_data *sd)
c = pc_calc_skilltree_normalize_job(c, sd);
for(i=0;i<MAX_SKILL;i++){
- if (sd->status.skill[i].flag != 13) sd->status.skill[i].id=0;
+ if (sd->status.skill[i].flag != 13)
+ sd->status.skill[i].id=0;
if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){ // cardスキルなら、
sd->status.skill[i].lv=(sd->status.skill[i].flag==1)?0:sd->status.skill[i].flag-2; // 本?のlvに
sd->status.skill[i].flag=0; // flagは0にしておく
@@ -1018,6 +1032,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
pc_checkskill(sd,skill_tree[s][c][i].need[j].id) <
skill_tree[s][c][i].need[j].lv)
f=0;
+ break;
}
}
if(f && sd->status.skill[id].id==0 ){
@@ -1025,24 +1040,6 @@ int pc_calc_skilltree(struct map_session_data *sd)
flag=1;
}
}
- for(i=0;(id=skill_tree[s][s_class.job][i].id)>0;i++){
- int j,f=1;
- if(!skill_get_inf2(id))
- continue;
- if(!battle_config.skillfree) {
- for(j=0;j<5;j++) {
- if( skill_tree[s][s_class.job][i].need[j].id &&
- pc_checkskill(sd,skill_tree[s][s_class.job][i].need[j].id) <
- skill_tree[s][s_class.job][i].need[j].lv)
- f=0;
- }
- }
- if(f && sd->status.skill[id].id==0 ){
- sd->status.skill[id].id=id;
- flag=1;
- }
- }
-
} while(flag);
}
// if(battle_config.etc_log)
@@ -1087,6 +1084,7 @@ int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd) {
case 17:
c = 6;
break;
+#if 0
case 4008:
case 4014:
case 4015:
@@ -1141,6 +1139,7 @@ int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd) {
case 4043:
c = 4029;
break;
+#endif
}
}
}
@@ -5475,7 +5474,8 @@ int pc_resetskill(struct map_session_data* sd)
nullpo_retr(0, sd);
for(i=1;i<MAX_SKILL;i++){
- if( (skill = pc_checkskill(sd,i)) > 0) {
+ skill = ( i >= 10000 ) ? pc_checkskill(sd,i) : sd->status.skill[i].lv;
+ if( skill > 0) {
if(!(skill_get_inf2(i)&0x01) || battle_config.quest_skill_learn) {
if(!sd->status.skill[i].flag)
sd->status.skill_point += skill;
@@ -5487,9 +5487,9 @@ int pc_resetskill(struct map_session_data* sd)
else if(battle_config.quest_skill_reset)
sd->status.skill[i].lv = 0;
sd->status.skill[i].flag = 0;
- }
- else
+ } else {
sd->status.skill[i].lv = 0;
+ }
}
clif_updatestatus(sd,SP_SKILLPOINT);
clif_skillinfoblock(sd);