o Parasite can't cause 'the enemy approaches' alert.

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@476 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2006-05-11 17:06:43 +00:00
parent 6cf91edff3
commit d460818621
3 changed files with 13 additions and 11 deletions

View File

@ -977,7 +977,7 @@ BOOL AvHGamerules::FPlayerCanRespawn( CBasePlayer *pPlayer )
return theCanRespawn;
}
bool AvHGamerules::CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBaseEntity* inReceiver, float* outScalar)
bool AvHGamerules::CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBaseEntity* inReceiver, float* outScalar, bool triggerHiveDefend)
{
bool theCanDoDamage = false;
@ -1072,13 +1072,15 @@ bool AvHGamerules::CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBas
*outScalar = theScalar;
}
if(!theTeamsAreDifferent && !AvHSUGetIsExternalClassName(STRING(inReceiver->pev->classname)) && theGameHasStarted )
{
AvHHive *theHive=(AvHHive *)dynamic_cast<const AvHHive *>(inReceiver);
if ( theHive != NULL ) {
theCanDoDamage=false;
if ( !this->GetIsEntityUnderAttack(theHive->entindex()) )
GetGameRules()->TriggerAlert((AvHTeamNumber)inAttacker->pev->team, ALERT_HIVE_DEFEND, theHive->entindex());
if ( triggerHiveDefend ) {
if(!theTeamsAreDifferent && !AvHSUGetIsExternalClassName(STRING(inReceiver->pev->classname)) && theGameHasStarted )
{
AvHHive *theHive=(AvHHive *)dynamic_cast<const AvHHive *>(inReceiver);
if ( theHive != NULL ) {
theCanDoDamage=false;
if ( !this->GetIsEntityUnderAttack(theHive->entindex()) )
GetGameRules()->TriggerAlert((AvHTeamNumber)inAttacker->pev->team, ALERT_HIVE_DEFEND, theHive->entindex());
}
}
}

View File

@ -186,7 +186,7 @@ public:
virtual BOOL FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker );
// TODO: Add splash damage parameter and outgoing float percentage damage? This way splash damage could do some damage in non-tourny mode?
virtual bool CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBaseEntity* inReceiver, float* outScalar = NULL);
virtual bool CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBaseEntity* inReceiver, float* outScalar = NULL, bool triggerHiveDefend = true);
//virtual edict_t* GetPlayerSpawnSpot( CBasePlayer *pPlayer );
virtual void PlayerThink( CBasePlayer *pPlayer );

View File

@ -149,8 +149,8 @@ void AvHParasiteGun::FireProjectiles(void)
if(theEntityHit)
{
float theScalar = 1.0f;
bool theCanDoDamageTo = GetGameRules()->CanEntityDoDamageTo(this->m_pPlayer, theEntityHit, &theScalar);
bool theCanDoDamageTo = GetGameRules()->CanEntityDoDamageTo(this->m_pPlayer, theEntityHit, &theScalar, false);
theScalar *= AvHPlayerUpgrade::GetAlienRangedDamageUpgrade(this->m_pPlayer->pev->iuser4);