wdmisc_plugin/sdk_util.cpp
branchB-work
changeset 46 77537dee7ca6
parent 0 d15304fcb7a7
child 254 2f9a3c9df023
     1.1 --- a/wdmisc_plugin/sdk_util.cpp	Sat May 29 23:08:20 2004 +0000
     1.2 +++ b/wdmisc_plugin/sdk_util.cpp	Sat May 29 23:08:59 2004 +0000
     1.3 @@ -6,6 +6,7 @@
     1.4  // Selected portions of dlls/util.cpp from SDK 2.1.
     1.5  // Functions copied from there as needed...
     1.6  // And modified to avoid buffer overflows (argh).
     1.7 +// Also modified to remove dependency on CBaseEntity class.
     1.8  
     1.9  /***
    1.10  *
    1.11 @@ -31,7 +32,6 @@
    1.12  
    1.13  #include <extdll.h>
    1.14  #include "sdk_util.h"
    1.15 -#include <cbase.h>
    1.16  
    1.17  #include <string.h>			// for strncpy(), etc
    1.18  
    1.19 @@ -68,13 +68,13 @@
    1.20  }
    1.21  
    1.22  
    1.23 -void UTIL_HudMessage(CBaseEntity *pEntity, const hudtextparms_t &textparms, 
    1.24 +void META_UTIL_HudMessage(edict_t *pEntity, const hudtextparms_t &textparms, 
    1.25  		const char *pMessage)
    1.26  {
    1.27 -	if ( !pEntity )
    1.28 +	if ( FNullEnt(pEntity) || pEntity->free )
    1.29  		return;
    1.30  
    1.31 -	MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, ENT(pEntity->pev) );
    1.32 +	MESSAGE_BEGIN( MSG_ONE, SVC_TEMPENTITY, NULL, pEntity );
    1.33  		WRITE_BYTE( TE_TEXTMESSAGE );
    1.34  		WRITE_BYTE( textparms.channel & 0xFF );
    1.35