diff --git a/releases/3.2.0/source/mod/AvHHive.cpp b/releases/3.2.0/source/mod/AvHHive.cpp index 4ad4f975..3f6bda0c 100644 --- a/releases/3.2.0/source/mod/AvHHive.cpp +++ b/releases/3.2.0/source/mod/AvHHive.cpp @@ -914,7 +914,7 @@ void AvHHive::TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_T AvHPlayer* thePlayer = dynamic_cast(inActivator); - if(thePlayer && (thePlayer->pev->team == this->pev->team) && (thePlayer->GetUser3() != AVH_USER3_ALIEN_EMBRYO)) + if(thePlayer && (thePlayer->pev->team == this->pev->team) && (thePlayer->GetUser3() != AVH_USER3_ALIEN_EMBRYO) && thePlayer->GetCanUseHive() ) { vector theHives; vector theHivesUnderAttack; @@ -982,6 +982,7 @@ void AvHHive::TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_T if(AvHSUGetIsEnoughRoomForHull(theOriginToSpawn, AvHMUGetHull(false, thePlayer->pev->iuser3), thePlayer->edict())) { + thePlayer->SetTimeOfLastHiveUse(gpGlobals->time); thePlayer->SetPosition(theOriginToSpawn); thePlayer->pev->velocity = Vector(0, 0, 0); diff --git a/releases/3.2.0/source/mod/AvHPlayer.cpp b/releases/3.2.0/source/mod/AvHPlayer.cpp index af88ffbc..737710a4 100644 --- a/releases/3.2.0/source/mod/AvHPlayer.cpp +++ b/releases/3.2.0/source/mod/AvHPlayer.cpp @@ -1887,6 +1887,14 @@ bool AvHPlayer::GetCanReceiveResources() const return theCanReceiveResources; } +bool AvHPlayer::GetCanUseHive() const { + return (gpGlobals->time > this->mTimeOfLastHiveUse + 0.4f ); +} + +void AvHPlayer::SetTimeOfLastHiveUse(float time) { + this->mTimeOfLastHiveUse=time; +} + int AvHPlayer::GetEffectivePlayerClass() { AvHPlayerClass theEffectivePlayerClass = PLAYERCLASS_NONE; @@ -3410,7 +3418,9 @@ void AvHPlayer::Init() this->mTimeLastJoinTeam = -1; // tankefugl + this->mTimeOfLastHiveUse = -1; // alien upgrades + this->mTimeOfLastRegeneration = -1; this->mTimeOfLastPheromone = -1; this->mMaxGallopSpeed = 0; diff --git a/releases/3.2.0/source/mod/AvHPlayer.h b/releases/3.2.0/source/mod/AvHPlayer.h index 91f1d4b9..8f2a072b 100644 --- a/releases/3.2.0/source/mod/AvHPlayer.h +++ b/releases/3.2.0/source/mod/AvHPlayer.h @@ -233,6 +233,8 @@ public: void SetSkin(int inSkin); bool GetCanCommand(string& outErrorMessage); bool GetCanReceiveResources() const; + bool GetCanUseHive() const; + void SetTimeOfLastHiveUse(float time); void SetPlayMode(AvHPlayMode inPlayMode, bool inForceSpawn = false); bool GetHasBeenSpectator(void) const; @@ -625,6 +627,7 @@ private: // tankefugl // alien upgrades + float mTimeOfLastHiveUse; float mTimeOfLastRegeneration; float mTimeOfLastPheromone;