Updated Firewall cast check (#3556)

* Firewall should check at cast begin if unit max count has been reached.
* Removed redundancy with the unit max count checks by merging into a single function.
Thanks to @mrjnumber1!
This commit is contained in:
Aleos
2019-04-04 18:57:17 -04:00
committed by GitHub
parent 1504507e71
commit 7c313a776a
3 changed files with 55 additions and 95 deletions

View File

@@ -1998,6 +1998,8 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui
if( sd ) {
if( skill_isNotOk(skill_id, sd) || !skill_check_condition_castbegin(sd, skill_id, skill_lv) )
return 0;
if (skill_id == MG_FIREWALL && !skill_pos_maxcount_check(src, skill_x, skill_y, skill_id, skill_lv, BL_PC, true))
return 0; // Special check for Firewall only
}
if( (skill_id >= SC_MANHOLE && skill_id <= SC_FEINTBOMB) && map_getcell(src->m, skill_x, skill_y, CELL_CHKMAELSTROM) ) {