diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/battle.c | 2 | ||||
-rw-r--r-- | src/map/clif.c | 4 | ||||
-rw-r--r-- | src/map/mob.c | 3 | ||||
-rw-r--r-- | src/map/pc.c | 20 | ||||
-rw-r--r-- | src/map/status.c | 4 |
5 files changed, 20 insertions, 13 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 9a9343d31..b6dba1939 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -871,7 +871,7 @@ static struct Damage battle_calc_weapon_attack( if( (sd && sd->state.arrow_atk) || (!sd && ((skill_num && skill_get_ammotype(skill_num)) || sstatus->rhw.range>3)) - ) { + ) { wd.flag=(wd.flag&~BF_RANGEMASK)|BF_LONG; flag.arrow = 1; } diff --git a/src/map/clif.c b/src/map/clif.c index ddf14927d..17eb4714c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8211,8 +8211,8 @@ void clif_parse_WantToConnection(int fd, TBL_PC* sd) WFIFOSET(fd,packet_len(0x6a)); clif_setwaitclose(fd); return; - - } else if( (old_sd=map_id2sd(account_id)) != NULL ){ + } + if( (old_sd=map_id2sd(account_id)) != NULL ){ // if same account already connected, we disconnect the 2 sessions //Check for characters with no connection (includes those that are using autotrade) [durf],[Skotlex] if (old_sd->state.finalsave || !old_sd->state.auth) diff --git a/src/map/mob.c b/src/map/mob.c index 5031fc5fa..1f3bf4cf7 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1101,7 +1101,8 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap) (md->ud.walktimer != -1 && !(battle_config.mob_ai&0x1) && !check_distance_bl(&md->bl, tbl, md->min_chase)) || ( tbl->type == BL_PC && !(mode&MD_BOSS) && - ((TBL_PC*)tbl)->state.gangsterparadise + (((TBL_PC*)tbl)->state.gangsterparadise || + ((TBL_PC*)tbl)->invincible_timer != INVALID_TIMER) )) { //Unlock current target. if (tbl && tbl->m != md->bl.m && battle_config.mob_ai&0x40) { //Chase to a nearby warp [Skotlex] diff --git a/src/map/pc.c b/src/map/pc.c index a8f16af13..6b2ac287a 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -125,7 +125,7 @@ static int pc_invincible_timer(int tid,unsigned int tick,int id,int data) { int pc_setinvincibletimer(struct map_session_data *sd,int val) { nullpo_retr(0, sd); - if(sd->invincible_timer != -1) + if(sd->invincible_timer != INVALID_TIMER) delete_timer(sd->invincible_timer,pc_invincible_timer); sd->invincible_timer = add_timer(gettick()+val,pc_invincible_timer,sd->bl.id,0); return 0; @@ -134,9 +134,9 @@ int pc_setinvincibletimer(struct map_session_data *sd,int val) { int pc_delinvincibletimer(struct map_session_data *sd) { nullpo_retr(0, sd); - if(sd->invincible_timer != -1) { + if(sd->invincible_timer != INVALID_TIMER) { delete_timer(sd->invincible_timer,pc_invincible_timer); - sd->invincible_timer = -1; + sd->invincible_timer = INVALID_TIMER; skill_unit_move(&sd->bl,gettick(),1); } return 0; @@ -581,6 +581,14 @@ int pc_authok(struct map_session_data *sd, int login_id2, time_t connect_until_t clif_authfail_fd(sd->fd, 0); return 1; } + + if (map_id2sd(st->account_id) != NULL) + { //Somehow a second connection has managed to go through the double-connection + //check in clif_parse_WantToConnection! [Skotlex] + clif_authfail_fd(sd->fd, 0); + return 1; + } + memcpy(&sd->status, st, sizeof(*st)); //Set the map-server used job id. [Skotlex] @@ -1037,8 +1045,6 @@ static void pc_check_skilltree(struct map_session_data *sd, int skill) { continue; if (sd->status.job_level < skill_tree[c][i].joblv) continue; - else if (pc_checkskill(sd, NV_BASIC) < 9 && id != NV_BASIC && !(skill_get_inf2(id)&INF2_QUEST_SKILL)) - continue; // Do not unlock normal skills when Basic Skills is not maxed out (can happen because of skill reset) if(skill_get_inf2(id)&INF2_SPIRIT_SKILL) //Spirit skills cannot be learned @@ -1076,7 +1082,7 @@ int pc_calc_skilltree_normalize_job(struct map_session_data *sd) { return c; //Only Normalize non-first classes (and non-super novice) skill_point = pc_calc_skillpoint(sd); - if(skill_point < 9) + if(pc_checkskill(sd, NV_BASIC) < 9) //Consider Novice Tree when you dont have NV_BASIC maxed. c = MAPID_NOVICE; else if (sd->status.skill_point >= (int)sd->status.job_level && ((sd->change_level > 0 && skill_point < sd->change_level+8) || skill_point < 58)) { @@ -6308,7 +6314,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos) if(pos == EQP_ACC) { //Accesories should only go in one of the two, pos = req_pos&EQP_ACC; if (pos == EQP_ACC) //User specified both slots.. - pos = sd->equip_index[EQI_ACC_L] >= 0 ? EQP_ACC_R : EQP_ACC_L; + pos = sd->equip_index[EQI_ACC_R] >= 0 ? EQP_ACC_L : EQP_ACC_R; } if(pos == EQP_ARMS && id->equip == EQP_HAND_R) diff --git a/src/map/status.c b/src/map/status.c index 5683a6218..b8572c0bf 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3676,8 +3676,8 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha speed = speed * 100/sc->data[SC_DEFENDER].val3; if(sc->data[SC_GOSPEL].timer!=-1 && sc->data[SC_GOSPEL].val4 == BCT_ENEMY) speed = speed * 100/75; - if(sc->data[SC_JOINTBEAT].timer!=-1) { - speed = speed * ( 100 + if(sc->data[SC_JOINTBEAT].timer!=-1 && sc->data[SC_JOINTBEAT].val2&(BREAK_ANKLE|BREAK_KNEE)) { + speed = speed * 100/(100 - ( sc->data[SC_JOINTBEAT].val2&BREAK_ANKLE ? 50 : 0 ) - ( sc->data[SC_JOINTBEAT].val2&BREAK_KNEE ? 30 : 0 )); } |