- Code: Select all
//-----------------------------------------------------------------------------
// Purpose: On touch explode
//-----------------------------------------------------------------------------
void CGrenadeDynamite::BounceTouch( CBaseEntity *pOther )
{
if ( pOther = CWorld )
{
Detonate();
}
}
I get this:
- Code: Select all
1>c:\osd\src\game\server\grenade_dynamite.cpp(159) : error C2275: 'CWorld' : illegal use of this type as an expression
1> c:\osd\src\game\server\world.h(15) : see declaration of 'CWorld'
How can I fix this? Do I have to write something else or is the world not going to work in this case?
Also, an even better fix world be so that when it comes into contact with any entity it detonates. Maybe instead of
- Code: Select all
if ( pOther = CWorld )
it'd be something like
- Code: Select all
if ( pOther = CBaseEntity )
Or something like that. I know that it's not right but that's just to get the idea across. Thanks in advance.



