ike3 / mangosbot

This is a modification of MaNGOS (Zero, One, R2, Trinity) server which brings a number of bots online and available for any player. Also allows you to use your account/guild characters as bots.
http://ike3.github.io/mangosbot-docs/
GNU General Public License v2.0
185 stars 79 forks source link

[cmangos-one-ai] Windows crash with friends #94

Open LordPsyan opened 5 years ago

LordPsyan commented 5 years ago

Exception thrown: read access violation. player->m_social was nullptr.

I am not getting much info from my debugging session. Only thing I get is from SocialMgr.cpp line 191

PlayerSocialMap::iterator itr = player->GetSocial()->m_playerSocialMap.find(friend_lowguid);

I am guessing its from trying to get the friends list.

I do have to mention that using git submodule init/update won't work. what it pulls doesn't compile giving boost/asio.h not found errors, so I just pulled master branch from github and placed it in src/modules/Bots (did same with immersive. Should do same with tests, but I dont compile tests. it gives same error on revision pulled with submodule update.)

apock69 commented 5 years ago

I have been playing around with the code base for several months now and the only fix I found for this was to put:

If (!pFriend) return;

Right after line 191.

My c++ is knowledge is very old and I only understand about 1% about what is going on with this project code, so I'm not sure if this was correct but I haven't had a problem crashing on it since.