diff --git a/amxmodx/CMisc.h b/amxmodx/CMisc.h index d55c439b..b4b28ccc 100755 --- a/amxmodx/CMisc.h +++ b/amxmodx/CMisc.h @@ -110,8 +110,7 @@ public: bool Connect(const char* connectname,const char* ipaddress); inline bool IsBot(){ - const char* auth= (*g_engfuncs.pfnGetPlayerAuthId)(pEdict); - return ( auth && !strcmp( auth , "BOT" ) ); + return ((pEdict->v.flags & FL_FAKECLIENT)?true:false); } inline bool IsAlive(){ diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index e3503607..578b67e8 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -628,6 +628,8 @@ const char *MNF_GetAmxScriptName(int id) while (iter && id--) ++iter; + if ((*iter) == NULL) + return NULL; return (*iter).getName(); }