Cleaned up the mapflag system (#2943)

* Created setter and getter functions.
* Adjusted all calls to use these functions.
* Converted mapflags to C++ map container.
* Converted drop_list to vector.
* Converted skill_damage ERS into vector and increased limit from UINT8 to UINT16.
* Cleaned up several functions to be more dynamic to reduce redundancy that was all over the place.
* Renamed nosumstarmiracle to nosunmoonstarmiracle.
* Adjusted skill_damage mapflag to use proper defined constants.
* Refactored map index into a vector.
Thanks to @Lemongrass3110 for a lot of help and @secretdataz!
This commit is contained in:
Aleos
2018-07-18 20:00:33 -04:00
committed by GitHub
parent bbe552d1d3
commit a942853d55
29 changed files with 1306 additions and 1434 deletions

View File

@@ -1582,11 +1582,11 @@ bool itemdb_isNoEquip(struct item_data *id, uint16 m) {
if (!id->flag.no_equip)
return false;
if ((!map_flag_vs2(m) && id->flag.no_equip&1) || // Normal
(map[m].flag.pvp && id->flag.no_equip&2) || // PVP
(map_getmapflag(m, MF_PVP) && id->flag.no_equip&2) || // PVP
(map_flag_gvg2_no_te(m) && id->flag.no_equip&4) || // GVG
(map[m].flag.battleground && id->flag.no_equip&8) || // Battleground
(map_getmapflag(m, MF_BATTLEGROUND) && id->flag.no_equip&8) || // Battleground
(map_flag_gvg2_te(m) && id->flag.no_equip&16) || // WOE:TE
(map[m].flag.restricted && id->flag.no_equip&(8*map[m].zone)) // Zone restriction
(map_getmapflag(m, MF_RESTRICTED) && id->flag.no_equip&(8*map[m].zone)) // Zone restriction
)
return true;
return false;