I'm a bit confused by this so... If I wanted to know what the player's current weapon is, how convoluted does it have to get?Graf Zahl wrote:You also need to cast 'target' to the proper type first if you want to access information from a child-class.
Would this be good enough?:
Code: Select all
if( target != NULL && target->player != NULL && target->player->ReadyWeapon != NULL )
{
if( static_cast<Actor>(target->player->ReadyWeapon).CheckClass("BFG9000") )
{
A_ChangeFlag("FRIGHTENED", true);
speed *= 2; //run away faster.
}
}