Mantis: 0001128

o Fixed a bug where observatory actions ( e.g. scan ) were selectable during research.

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@499 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2006-05-21 13:38:58 +00:00
parent 25fafb261e
commit f3bdf5244a
2 changed files with 11 additions and 2 deletions

View file

@ -678,7 +678,10 @@ int AvHBaseBuildable::GetTakeDamageAnimation() const
AvHTeamNumber AvHBaseBuildable::GetTeamNumber() const
{
return (AvHTeamNumber)this->pev->team;
AvHTeamNumber ret=TEAM_IND;
if ( this->pev )
ret=(AvHTeamNumber)this->pev->team;
return ret;
}
void AvHBaseBuildable::Killed(entvars_t* pevAttacker, int iGib)

View file

@ -1528,8 +1528,14 @@ void AvHMarineBaseBuildable::SetEnergy(float inEnergy)
this->mEnergy = max(min(inEnergy, kMarineStructureMaxEnergy), 0.0f);
float theNormValue = this->mEnergy/kMarineStructureMaxEnergy;
bool theIsResearching=false;
if(this->pev && this->GetIsBuilt())
const AvHTeam* theTeam = GetGameRules()->GetTeam(AvHTeamNumber(this->GetTeamNumber()));
if ( theTeam ) {
theIsResearching=theTeam->GetResearchManager().GetIsResearching(this->entindex());
}
if(this->pev && this->GetIsBuilt() && (!theIsResearching))
{
AvHSHUSetEnergyState(this->pev->iuser3, this->pev->fuser1, theNormValue);
}