diff options
-rw-r--r-- | src/map/chrif.cpp | 4 | ||||
-rw-r--r-- | src/map/npc.cpp | 5 | ||||
-rw-r--r-- | src/net/packets.hpp | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 2998516..3e20c3f 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -1249,8 +1249,6 @@ void chrif_parse(Session *s) static void send_users_tochar(TimerData *, tick_t) { - int users = 0; - if (!char_session) return; @@ -1272,7 +1270,7 @@ void send_users_tochar(TimerData *, tick_t) repeat_ff.push_back(info); } } - head_ff.users = users; + head_ff.users = repeat_ff.size(); send_vpacket<0x2aff, 6, 4>(char_session, head_ff, repeat_ff); } diff --git a/src/map/npc.cpp b/src/map/npc.cpp index ef10d82..7b31729 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -1303,7 +1303,10 @@ int npc_parse_script(XString w1, XString w2, NpcName w3, ZString w4, } else { - if (!extract(w4, &npc_class)) + XString w4x = w4; + if (w4x.endswith(',')) + w4x = w4x.xrslice_h(1); + if (!extract(w4x, &npc_class)) abort(); nd->scr.xs = 0; nd->scr.ys = 0; diff --git a/src/net/packets.hpp b/src/net/packets.hpp index 2e00ad2..9cfb1da 100644 --- a/src/net/packets.hpp +++ b/src/net/packets.hpp @@ -485,7 +485,7 @@ RecvResult recv_vpacket(Session *s, Packet_Head<id>& head, AString& repeat) return RecvResult::Error; // reinterpret_cast is needed to correctly handle an empty vector const char *begin = sign_cast<const char *>(net_repeat.data()); - const char *end = begin + repeat.size(); + const char *end = begin + net_repeat.size(); end = std::find(begin, end, '\0'); repeat = XString(begin, end, nullptr); } |