You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
963 B
61 lines
963 B
8 years ago
|
#ifndef WHANDLE_H
|
||
|
#define WHANDLE_H
|
||
|
|
||
8 years ago
|
#ifndef CLIENT_DLL
|
||
8 years ago
|
|
||
|
class CBasePlayerItem;
|
||
|
|
||
|
class EHBasePlayerItem : public EHANDLE
|
||
|
{
|
||
|
public:
|
||
|
operator CBasePlayerItem *()
|
||
|
{
|
||
|
return (CBasePlayerItem *)GET_PRIVATE( Get() );
|
||
|
}
|
||
|
CBasePlayerItem *operator ->()
|
||
|
{
|
||
|
return (CBasePlayerItem *)GET_PRIVATE( Get() );
|
||
|
}
|
||
|
template <class T>
|
||
|
operator T()
|
||
|
{
|
||
|
return (T)GET_PRIVATE( Get() );
|
||
|
}
|
||
|
template <class T>
|
||
|
T *operator = ( T *pEntity )
|
||
|
{
|
||
|
edict_t *e = NULL;
|
||
|
if( pEntity )
|
||
|
e = pEntity->edict();
|
||
|
return (T*)CBaseEntity::Instance( Set ( e ) );
|
||
|
}
|
||
|
|
||
|
// handle = NULL correctly
|
||
|
int operator = ( int null1 )
|
||
|
{
|
||
|
//assert( !null1 );
|
||
|
Set(0);
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
bool operator !=(EHBasePlayerItem &other)
|
||
|
{
|
||
|
return Get() != other.Get();
|
||
|
}
|
||
6 years ago
|
#if 0
|
||
6 years ago
|
bool operator !=(my_nullptr_t &null1)
|
||
6 years ago
|
{
|
||
|
return Get() != (edict_t*)0;
|
||
|
}
|
||
6 years ago
|
#endif
|
||
6 years ago
|
bool operator !=(int null1)
|
||
|
{
|
||
|
return Get() != (edict_t*)null1;
|
||
|
}
|
||
8 years ago
|
};
|
||
8 years ago
|
#else
|
||
|
#define EHBasePlayerItem CBasePlayerItem*
|
||
|
#endif
|
||
|
|
||
6 years ago
|
#endif
|