diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-06-23 20:40:46 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-06-23 21:07:32 -0700 |
commit | da6769f929be02a0b3b4d6c52b79922104cdd053 (patch) | |
tree | 37536156be568931d6751d65544d55ceb7c9464e /src/map/pc.cpp | |
parent | 1c1752f40aac20bf9a5e56817951a013c2219bed (diff) | |
download | tmwa-da6769f929be02a0b3b4d6c52b79922104cdd053.tar.gz tmwa-da6769f929be02a0b3b4d6c52b79922104cdd053.tar.bz2 tmwa-da6769f929be02a0b3b4d6c52b79922104cdd053.tar.xz tmwa-da6769f929be02a0b3b4d6c52b79922104cdd053.zip |
Use the generated char server protocol in the map server
Diffstat (limited to 'src/map/pc.cpp')
-rw-r--r-- | src/map/pc.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 33cb57f..e3a672e 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -40,10 +40,11 @@ #include "../io/read.hpp" #include "../net/timer.hpp" -#include "../net/vomit.hpp" #include "../mmo/utils.hpp" +#include "../proto2/char-map.hpp" + #include "atcommand.hpp" #include "battle.hpp" #include "chrif.hpp" @@ -2852,7 +2853,7 @@ int pc_attack(dumb_ptr<map_session_data> sd, BlockId target_id, int type) if (bl->bl_type == BL::NPC) { // monster npcs [Valaris] - npc_click(sd, wrap<BlockId>(RFIFOL(sd->sess, 2))); + npc_click(sd, target_id); return 0; } @@ -5176,15 +5177,14 @@ void pc_autosave(TimerData *, tick_t) ).detach(); } -int pc_read_gm_account(Session *s) +int pc_read_gm_account(Session *, const std::vector<Packet_Repeat<0x2b15>>& repeat) { gm_accountm.clear(); - // (RFIFOW(fd, 2) - 4) / 5 - for (int i = 4; i < RFIFOW(s, 2); i += 5) + for (const auto& i : repeat) { - AccountId account_id = wrap<AccountId>(RFIFOL(s, i)); - GmLevel level = GmLevel::from(static_cast<uint32_t>(RFIFOB(s, i + 4))); + AccountId account_id = i.account_id; + GmLevel level = i.gm_level; gm_accountm[account_id] = level; } return gm_accountm.size(); |