Reset entvars on create bot (#538)

* Reset entvars on create bot
This commit is contained in:
Vaqtincha 2020-05-27 06:32:15 +05:00 committed by GitHub
parent 6c80744146
commit 0dd9b97c37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,6 +60,15 @@ T *CreateBot(const BotProfile *profile)
else else
{ {
T *pBot = nullptr; T *pBot = nullptr;
#ifdef REGAMEDLL_FIXES
auto name = pentBot->v.netname;
Q_memset(&pentBot->v, 0, sizeof(pentBot->v)); // Reset entvars data
pentBot->v.netname = name;
pentBot->v.flags = FL_FAKECLIENT | FL_CLIENT;
pentBot->v.pContainingEntity = pentBot;
#endif
FREE_PRIVATE(pentBot); FREE_PRIVATE(pentBot);
pBot = GetClassPtr<TWrap>((T *)VARS(pentBot)); pBot = GetClassPtr<TWrap>((T *)VARS(pentBot));
pBot->Initialize(profile); pBot->Initialize(profile);