Skip to content

Commit

Permalink
Status change and crash fixes
Browse files Browse the repository at this point in the history
- Fixed a potential map server crash when attacking traps
- Fixed a problem that sometimes randomly a status change was removed on logout although it shouldn't
  * Special thanks to icxbb-xx for pointing these two issues out
- Sight Blaster will now always be removed on logout
- Implemented official formula for Gypsy's Kiss / Service For You (bugreport:9359)
  • Loading branch information
Playtester committed Oct 26, 2014
1 parent b88e953 commit 78908d7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/map/battle.c
Original file line number Diff line number Diff line change
Expand Up @@ -7146,8 +7146,9 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
case BL_SKILL:
{
TBL_SKILL *su = (TBL_SKILL*)target;

if( su && su->group && skill_get_inf2(su->group->skill_id)&INF2_TRAP && su->group->unit_id != UNT_USED_TRAPS) { //Only a few skills can target traps...
if( !su || !su->group)
return 0;
if( skill_get_inf2(su->group->skill_id)&INF2_TRAP && su->group->unit_id != UNT_USED_TRAPS) { //Only a few skills can target traps...
switch( battle_getcurrentskill(src) ) {
case RK_DRAGONBREATH:// it can only hit traps in pvp/gvg maps
case RK_DRAGONBREATH_WATER:
Expand Down
7 changes: 5 additions & 2 deletions src/map/chrif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,9 +1287,12 @@ int chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of the
continue;
if (sc->data[i]->timer != INVALID_TIMER) {
timer = get_timer(sc->data[i]->timer);
if (timer == NULL || timer->func != status_change_timer || DIFF_TICK(timer->tick,tick) < 0)
if (timer == NULL || timer->func != status_change_timer)
continue;
data.tick = DIFF_TICK(timer->tick,tick); //Duration that is left before ending.
if (DIFF_TICK(timer->tick,tick) > 0)
data.tick = DIFF_TICK(timer->tick,tick); //Duration that is left before ending.
else
data.tick = 0; //Negative tick does not necessarily mean that sc has expired
} else
data.tick = -1; //Infinite duration
data.type = i;
Expand Down
1 change: 1 addition & 0 deletions src/map/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,7 @@ int map_quit(struct map_session_data *sd) {
status_change_end(&sd->bl, SC_HEAT_BARREL, INVALID_TIMER);
status_change_end(&sd->bl, SC_P_ALTER, INVALID_TIMER);
status_change_end(&sd->bl, SC_E_CHAIN, INVALID_TIMER);
status_change_end(&sd->bl, SC_SIGHTBLASTER, INVALID_TIMER);
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -12027,12 +12027,12 @@ struct skill_unit_group *skill_unitsetting(struct block_list *src, uint16 skill_
}
break;
case DC_SERVICEFORYOU:
//val1: MaxSP percent increase
val1 = 15+skill_lv+(status->int_/10); //Bonus rate by Dancer's INT
//val2: SP cost reduction
val2 = 20+3*skill_lv;
if(sd) val2 += (pc_checkskill(sd,DC_DANCINGLESSON)+1)/2; //Bonus rate by DC_DANCINGLESSON
val2 += status->int_/10; //Bonus rate by Dancer's INT
val1 = 15+skill_lv+(status->int_/10); // MaxSP percent increase
val2 = 20+3*skill_lv+(status->int_/10); // SP cost reduction
if(sd){
val1 += pc_checkskill(sd,DC_DANCINGLESSON)/2;
val2 += pc_checkskill(sd,DC_DANCINGLESSON)/2;
}
break;
case BA_ASSASSINCROSS:
val1 = 100+(10*skill_lv)+status->agi; // ASPD increase
Expand Down

1 comment on commit 78908d7

@icxbb-xx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fixed : )

Please sign in to comment.