Fixes to new message dispatcher.

This commit is contained in:
joint 2019-08-12 16:58:00 +03:00 committed by jeefo
commit ac733404e1
2 changed files with 10 additions and 2 deletions

View file

@ -377,6 +377,7 @@ MessageDispatcher::MessageDispatcher () {
m_wanted[name] = id;
m_handlers[id] = handler;
};
reset ();
// we want to handle next messages
pushWanted ("TextMsg", NetMsg::TextMsg, &MessageDispatcher::netMsgTextMsg);
@ -454,7 +455,7 @@ void MessageDispatcher::registerMessage (const String &name, int32 id) {
}
void MessageDispatcher::start (edict_t *ent, int32 dest, int32 type) {
m_current = NetMsg::None;
reset ();
// search if we need to handle this message
for (const auto &msg : m_maps) {
@ -475,7 +476,7 @@ void MessageDispatcher::start (edict_t *ent, int32 dest, int32 type) {
}
// message for bot bot?
if (ent && (ent->v.flags & FL_FAKECLIENT)) {
if (ent && (ent->v.flags & FL_FAKECLIENT) && !(ent->v.flags & FL_DORMANT)) {
m_bot = bots[ent];
if (!m_bot) {