o Chambers and structures now do not play any effects upon death caused by game reset to prevent client disconnects.

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@423 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
tankefugl 2006-04-26 23:51:53 +00:00
parent 0a516f8fc1
commit 6c3f031cf1
3 changed files with 28 additions and 12 deletions

View File

@ -683,26 +683,31 @@ AvHTeamNumber AvHBaseBuildable::GetTeamNumber() const
void AvHBaseBuildable::Killed(entvars_t* pevAttacker, int iGib)
{
bool theInReset = GetGameRules()->GetIsGameInReset();
AvHBaseBuildable::SetHasBeenKilled();
this->mKilled = true;
this->mInternalSetConstructionComplete = false;
// puzl: 980
// Less smoke for recycled buildings
this->TriggerDeathAudioVisuals(iGib == GIB_RECYCLED);
if(!this->GetIsOrganic())
if (!theInReset)
{
// More sparks for recycled buildings
int numSparks = ( iGib == GIB_RECYCLED ) ? 7 : 3;
for ( int i=0; i < numSparks; i++ ) {
Vector vecSrc = Vector( (float)RANDOM_FLOAT( pev->absmin.x, pev->absmax.x ), (float)RANDOM_FLOAT( pev->absmin.y, pev->absmax.y ), (float)0 );
vecSrc = vecSrc + Vector( (float)0, (float)0, (float)RANDOM_FLOAT( pev->origin.z, pev->absmax.z ) );
UTIL_Sparks(vecSrc);
// puzl: 980
// Less smoke for recycled buildings
this->TriggerDeathAudioVisuals(iGib == GIB_RECYCLED);
if(!this->GetIsOrganic())
{
// More sparks for recycled buildings
int numSparks = ( iGib == GIB_RECYCLED ) ? 7 : 3;
for ( int i=0; i < numSparks; i++ ) {
Vector vecSrc = Vector( (float)RANDOM_FLOAT( pev->absmin.x, pev->absmax.x ), (float)RANDOM_FLOAT( pev->absmin.y, pev->absmax.y ), (float)0 );
vecSrc = vecSrc + Vector( (float)0, (float)0, (float)RANDOM_FLOAT( pev->origin.z, pev->absmax.z ) );
UTIL_Sparks(vecSrc);
}
}
// :puzl
}
// :puzl
this->TriggerRemoveTech();
AvHSURemoveEntityFromHotgroupsAndSelection(this->entindex());

View File

@ -339,6 +339,8 @@ AvHGamerules::AvHGamerules() : mTeamA(TEAM_ONE), mTeamB(TEAM_TWO)
avh_drawinvisible.value = 1;
#endif
this->mGameInReset = false;
this->ResetGame();
}
@ -852,6 +854,8 @@ void AvHGamerules::DeathNotice(CBasePlayer* pVictim, entvars_t* pKiller, entvars
void AvHGamerules::DeleteAndResetEntities()
{
this->mGameInReset = true;
// Print reset message at console
char theResetString[128];
@ -954,6 +958,9 @@ void AvHGamerules::DeleteAndResetEntities()
sprintf(theResetString, "Game reset complete.\n");
ALERT(at_logged, theResetString);
this->mGameInReset = false;
}
BOOL AvHGamerules::FAllowMonsters( void )

View File

@ -286,6 +286,8 @@ public:
bool GetMapVoteStrings(StringList& outMapVoteList);
void RemovePlayerFromVotemap(int inPlayerIndex);
bool GetIsGameInReset() {return this->mGameInReset; };
protected:
void AutoAssignPlayer(AvHPlayer* inPlayer);
void PerformMapValidityCheck();
@ -390,6 +392,8 @@ private:
typedef map<int, float> EntityUnderAttackListType;
EntityUnderAttackListType mEntitiesUnderAttack;
bool mGameInReset;
AvHMiniMap mMiniMap;
AvHMapExtents mMapExtents;