From da6769f929be02a0b3b4d6c52b79922104cdd053 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 23 Jun 2014 20:40:46 -0700 Subject: Use the generated char server protocol in the map server --- src/map/pc.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/map/pc.cpp') 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 sd, BlockId target_id, int type) if (bl->bl_type == BL::NPC) { // monster npcs [Valaris] - npc_click(sd, wrap(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>& 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(RFIFOL(s, i)); - GmLevel level = GmLevel::from(static_cast(RFIFOB(s, i + 4))); + AccountId account_id = i.account_id; + GmLevel level = i.gm_level; gm_accountm[account_id] = level; } return gm_accountm.size(); -- cgit v1.2.3-70-g09d2