diff --git a/src/map/battle.c b/src/map/battle.c index cea0f2cf23..956052bc0b 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3210,13 +3210,16 @@ static struct Damage battle_calc_multi_attack(struct Damage wd, struct block_lis || ( sd->bonus.double_rate > 0 && sd->weapontype1 != W_FIST ) //Will fail bare-handed || ( sc && sc->data[SC_KAGEMUSYA] && sd->weapontype1 != W_FIST )) // Need confirmation { //Success chance is not added, the higher one is used [Skotlex] - if( rnd()%100 < ( 5*skill_lv > sd->bonus.double_rate ? 5*skill_lv : sc && sc->data[SC_KAGEMUSYA]?sc->data[SC_KAGEMUSYA]->val1*3:sd->bonus.double_rate ) ) { + int max_rate = max(5*skill_lv,sd->bonus.double_rate); + if(sc && sc->data[SC_KAGEMUSYA]) max_rate= max(max_rate,sc->data[SC_KAGEMUSYA]->val1*3); + + if( rnd()%100 < max_rate ) { wd.div_ = skill_get_num(TF_DOUBLE,skill_lv?skill_lv:1); wd.type = DMG_MULTI_HIT; } } else if( ((sd->weapontype1 == W_REVOLVER && (skill_lv = pc_checkskill(sd,GS_CHAINACTION)) > 0) //Normal Chain Action effect - || (sd && sc && sc->count && sc->data[SC_E_CHAIN] && (skill_lv = sc->data[SC_E_CHAIN]->val2) > 0)) //Chain Action of ETERNAL_CHAIN + || (sc && sc->count && sc->data[SC_E_CHAIN] && (skill_lv = sc->data[SC_E_CHAIN]->val2) > 0)) //Chain Action of ETERNAL_CHAIN && rnd()%100 < 5*skill_lv ) //Success rate { wd.div_ = skill_get_num(GS_CHAINACTION,skill_lv); diff --git a/src/map/battleground.h b/src/map/battleground.h index dc2ab0d889..c2b74a534f 100644 --- a/src/map/battleground.h +++ b/src/map/battleground.h @@ -7,7 +7,7 @@ #include "../common/mmo.h" // struct party #include "guild.h" -#define MAX_BG_MEMBERS 20 +#define MAX_BG_MEMBERS 30 struct battleground_member_data { unsigned short x, y; diff --git a/src/map/npc.c b/src/map/npc.c index cdb81fbed2..0a4822fddb 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3991,9 +3991,8 @@ static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, con map[m].flag.restricted = 1; map[m].zone |= 1<<(state+1); } else { // Could not be read, no value defined - map[m].flag.restricted = 0; - map[m].zone = 0; - ShowWarning("npc_parse_mapflag: You did not set a zone value for the restricted mapflag! Removing flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer)); + //we don't remove has other restricted may be set on the map + ShowWarning("npc_parse_mapflag: You did not set a zone value for the restricted mapflag! Skipped flag from %s (file '%s', line '%d').\n", map[m].name, filepath, strline(buffer,start-buffer)); } } else { map[m].flag.restricted=0; diff --git a/src/map/script.c b/src/map/script.c index 1654bbf49e..1d108a966b 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -18345,7 +18345,7 @@ BUILDIN_FUNC(waitingroom2bg) struct chat_data *cd; const char *map_name, *ev = "", *dev = ""; int x, y, mapindex = 0, bg_id; - unsigned char i; + unsigned char i,c=0; if( script_hasdata(st,7) ) nd = npc_name2id(script_getstr(st,7)); @@ -18380,15 +18380,18 @@ BUILDIN_FUNC(waitingroom2bg) return SCRIPT_CMD_SUCCESS; } + for (i = 0; i < cd->users; i++) { // Only add those who are in the chat room struct map_session_data *sd; - if( (sd = cd->usersd[i]) != NULL && bg_team_join(bg_id, sd) ) + if( (sd = cd->usersd[i]) != NULL && bg_team_join(bg_id, sd) ){ mapreg_setreg(reference_uid(add_str("$@arenamembers"), i), sd->bl.id); - else - mapreg_setreg(reference_uid(add_str("$@arenamembers"), i), 0); + ++c; + } + //else + // mapreg_setreg(reference_uid(add_str("$@arenamembers"), i), 0); } - mapreg_setreg(add_str("$@arenamembersnum"), i); + mapreg_setreg(add_str("$@arenamembersnum"), c); script_pushint(st,bg_id); return SCRIPT_CMD_SUCCESS; } diff --git a/src/map/status.c b/src/map/status.c index f4a4aeb4ab..169e3ba109 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -13212,6 +13212,7 @@ static bool status_readdb_attrfix(const char *basedir,bool silent) for (j = 0, p = line; j < ELE_ALL && p; j++) { while (*p == 32) //skipping space (32=' ') p++; + //TODO seem unsafe to continue without check attr_fix_table[lv-1][i][j] = atoi(p); if (battle_config.attr_recover == 0 && attr_fix_table[lv-1][i][j] < 0) attr_fix_table[lv-1][i][j] = 0;