diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-10-05 22:15:20 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-10-10 14:37:49 -0700 |
commit | a44741c83773989430f5e3ac4a8a83c93b1341ff (patch) | |
tree | f235bfd95ae17d597fda2fedc1ea561358edf23a /src/map/pc.cpp | |
parent | e591d5b6d891516476aaf12808f4d3b3506e5f92 (diff) | |
download | tmwa-a44741c83773989430f5e3ac4a8a83c93b1341ff.tar.gz tmwa-a44741c83773989430f5e3ac4a8a83c93b1341ff.tar.bz2 tmwa-a44741c83773989430f5e3ac4a8a83c93b1341ff.tar.xz tmwa-a44741c83773989430f5e3ac4a8a83c93b1341ff.zip |
Enumify sex
It's amazing some of this code ever worked ...
Diffstat (limited to 'src/map/pc.cpp')
-rw-r--r-- | src/map/pc.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp index b622cc0..cf953aa 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -437,7 +437,7 @@ void pc_makesavestatus(dumb_ptr<map_session_data> sd) *------------------------------------------ */ int pc_setnewpc(dumb_ptr<map_session_data> sd, int account_id, int char_id, - int login_id1, tick_t client_tick, int sex) + int login_id1, tick_t client_tick, SEX sex) { nullpo_ret(sd); @@ -592,7 +592,7 @@ int pc_isequip(dumb_ptr<map_session_data> sd, int n) if (item == NULL) return 0; - if (item->sex != 2 && sd->status.sex != item->sex) + if (item->sex != SEX::SERVER && sd->status.sex != item->sex) return 0; if (item->elv > 0 && sd->status.base_level < item->elv) return 0; @@ -2228,7 +2228,7 @@ int pc_isUseitem(dumb_ptr<map_session_data> sd, int n) if (itemdb_type(nameid) != ItemType::USE) return 0; - if (item->sex != 2 && sd->status.sex != item->sex) + if (item->sex != SEX::SERVER && sd->status.sex != item->sex) return 0; if (item->elv > 0 && sd->status.base_level < item->elv) return 0; @@ -3615,7 +3615,7 @@ int pc_readparam(dumb_ptr<map_session_data> sd, SP type) val = sd->status.species; break; case SP::SEX: - val = sd->sex; + val = static_cast<uint8_t>(sd->sex); break; case SP::WEIGHT: val = sd->weight; @@ -3743,7 +3743,8 @@ int pc_setparam(dumb_ptr<map_session_data> sd, SP type, int val) } break; case SP::SEX: - sd->sex = val; + // this is a really bad idea + sd->sex = static_cast<SEX>(val); break; case SP::WEIGHT: sd->weight = val; |