diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/pc.c | 9 | ||||
-rw-r--r-- | src/map/status.c | 5 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 82e650111..8ccccb46c 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -395,18 +395,17 @@ unsigned char pc_famerank(int char_id, int job) return 0; } -int pc_setrestartvalue(struct map_session_data *sd,int type) -{ +int pc_setrestartvalue(struct map_session_data *sd,int type) { struct status_data *status, *b_status; nullpo_ret(sd); b_status = &sd->base_status; status = &sd->battle_status; - if (type&1) - { //Normal resurrection + if (type&1) { //Normal resurrection status->hp = 1; //Otherwise status_heal may fail if dead. - status_heal(&sd->bl, b_status->hp, b_status->sp>status->sp?b_status->sp-status->sp:0, 1); + status_heal(&sd->bl, b_status->hp, 0, 1); + status_set_sp(&sd->bl, b_status->sp, 1); } else { //Just for saving on the char-server (with values as if respawned) sd->status.hp = b_status->hp; sd->status.sp = (status->sp < b_status->sp)?b_status->sp:status->sp; diff --git a/src/map/status.c b/src/map/status.c index 9f4692cd3..82a17965a 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2784,6 +2784,9 @@ int status_calc_pc_(struct map_session_data* sd, bool first) status->hp = 1; status->sp = status->max_sp * battle_config.restart_sp_rate /100; + + if( !status->sp ) /* the minimum for the respawn setting is SP:1 */ + status->sp = 1; } // ----- MISC CALCULATION ----- @@ -3077,7 +3080,7 @@ int status_calc_pc_(struct map_session_data* sd, bool first) } calculating = 0; - + return 0; } |