diff --git a/releases/3.2.0/source/mod/AvHBaseBuildable.cpp b/releases/3.2.0/source/mod/AvHBaseBuildable.cpp index 93bd8562..50ef204e 100644 --- a/releases/3.2.0/source/mod/AvHBaseBuildable.cpp +++ b/releases/3.2.0/source/mod/AvHBaseBuildable.cpp @@ -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) diff --git a/releases/3.2.0/source/mod/AvHMarineEquipment.cpp b/releases/3.2.0/source/mod/AvHMarineEquipment.cpp index 76df00b3..1b471391 100644 --- a/releases/3.2.0/source/mod/AvHMarineEquipment.cpp +++ b/releases/3.2.0/source/mod/AvHMarineEquipment.cpp @@ -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); }