Hey all, I'm not familiar with pointers...wondering if you can give me a
push in the right direction:
if ( pKiller->IsNPC() )
{
// CAI_BaseNPC *pNPC = (CAI_BaseNPC*)pKiller;
CAI_BaseNPC *pNPC = dynamic_cast<CHL2MP_Player*>(pKiller);
if ( pNPC->LikesMaster() )
pKiller = pNPC->GetMasterPlayer();
}
I'm getting these errors:
hl2mp_gamerules.cpp
..\shared\hl2mp\hl2mp_gamerules.cpp(452) : error C2440: 'initializing' :
cannot convert from 'CHL2MP_Player *' to 'CAI_BaseNPC *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
..\shared\hl2mp\hl2mp_gamerules.cpp(454) : error C2440: '=' : cannot
convert from 'CBasePlayer *' to 'CHL2MP_Player *'
Cast from base to derived requires dynamic_cast or static_cast
The idea is that if my monster likes me and kills another player or
monster...it will make the killer the owner of said monster...meaning I
killed the player.
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders