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,6 +1072,7 @@ bool AvHGamerules::CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBas
*outScalar = theScalar;
}
if ( triggerHiveDefend ) {
if(!theTeamsAreDifferent && !AvHSUGetIsExternalClassName(STRING(inReceiver->pev->classname)) && theGameHasStarted )
{
AvHHive *theHive=(AvHHive *)dynamic_cast<const AvHHive *>(inReceiver);
@ -1081,6 +1082,7 @@ bool AvHGamerules::CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBas
GetGameRules()->TriggerAlert((AvHTeamNumber)inAttacker->pev->team, ALERT_HIVE_DEFEND, theHive->entindex());
}
}
}
}
return theCanDoDamage;

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

@ -150,7 +150,7 @@ void AvHParasiteGun::FireProjectiles(void)
{
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);