mirror of
https://github.com/ENSL/NS.git
synced 2024-11-10 15:21:54 +00:00
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:
parent
0a516f8fc1
commit
6c3f031cf1
3 changed files with 28 additions and 12 deletions
|
@ -683,26 +683,31 @@ AvHTeamNumber AvHBaseBuildable::GetTeamNumber() const
|
||||||
|
|
||||||
void AvHBaseBuildable::Killed(entvars_t* pevAttacker, int iGib)
|
void AvHBaseBuildable::Killed(entvars_t* pevAttacker, int iGib)
|
||||||
{
|
{
|
||||||
|
bool theInReset = GetGameRules()->GetIsGameInReset();
|
||||||
|
|
||||||
AvHBaseBuildable::SetHasBeenKilled();
|
AvHBaseBuildable::SetHasBeenKilled();
|
||||||
|
|
||||||
this->mKilled = true;
|
this->mKilled = true;
|
||||||
this->mInternalSetConstructionComplete = false;
|
this->mInternalSetConstructionComplete = false;
|
||||||
|
|
||||||
// puzl: 980
|
if (!theInReset)
|
||||||
// Less smoke for recycled buildings
|
|
||||||
this->TriggerDeathAudioVisuals(iGib == GIB_RECYCLED);
|
|
||||||
|
|
||||||
if(!this->GetIsOrganic())
|
|
||||||
{
|
{
|
||||||
// More sparks for recycled buildings
|
// puzl: 980
|
||||||
int numSparks = ( iGib == GIB_RECYCLED ) ? 7 : 3;
|
// Less smoke for recycled buildings
|
||||||
for ( int i=0; i < numSparks; i++ ) {
|
this->TriggerDeathAudioVisuals(iGib == GIB_RECYCLED);
|
||||||
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 ) );
|
if(!this->GetIsOrganic())
|
||||||
UTIL_Sparks(vecSrc);
|
{
|
||||||
|
// 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();
|
this->TriggerRemoveTech();
|
||||||
|
|
||||||
AvHSURemoveEntityFromHotgroupsAndSelection(this->entindex());
|
AvHSURemoveEntityFromHotgroupsAndSelection(this->entindex());
|
||||||
|
|
|
@ -339,6 +339,8 @@ AvHGamerules::AvHGamerules() : mTeamA(TEAM_ONE), mTeamB(TEAM_TWO)
|
||||||
avh_drawinvisible.value = 1;
|
avh_drawinvisible.value = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
this->mGameInReset = false;
|
||||||
|
|
||||||
this->ResetGame();
|
this->ResetGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -852,6 +854,8 @@ void AvHGamerules::DeathNotice(CBasePlayer* pVictim, entvars_t* pKiller, entvars
|
||||||
|
|
||||||
void AvHGamerules::DeleteAndResetEntities()
|
void AvHGamerules::DeleteAndResetEntities()
|
||||||
{
|
{
|
||||||
|
this->mGameInReset = true;
|
||||||
|
|
||||||
// Print reset message at console
|
// Print reset message at console
|
||||||
char theResetString[128];
|
char theResetString[128];
|
||||||
|
|
||||||
|
@ -954,6 +958,9 @@ void AvHGamerules::DeleteAndResetEntities()
|
||||||
|
|
||||||
sprintf(theResetString, "Game reset complete.\n");
|
sprintf(theResetString, "Game reset complete.\n");
|
||||||
ALERT(at_logged, theResetString);
|
ALERT(at_logged, theResetString);
|
||||||
|
|
||||||
|
this->mGameInReset = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL AvHGamerules::FAllowMonsters( void )
|
BOOL AvHGamerules::FAllowMonsters( void )
|
||||||
|
|
|
@ -286,6 +286,8 @@ public:
|
||||||
bool GetMapVoteStrings(StringList& outMapVoteList);
|
bool GetMapVoteStrings(StringList& outMapVoteList);
|
||||||
void RemovePlayerFromVotemap(int inPlayerIndex);
|
void RemovePlayerFromVotemap(int inPlayerIndex);
|
||||||
|
|
||||||
|
bool GetIsGameInReset() {return this->mGameInReset; };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void AutoAssignPlayer(AvHPlayer* inPlayer);
|
void AutoAssignPlayer(AvHPlayer* inPlayer);
|
||||||
void PerformMapValidityCheck();
|
void PerformMapValidityCheck();
|
||||||
|
@ -390,6 +392,8 @@ private:
|
||||||
typedef map<int, float> EntityUnderAttackListType;
|
typedef map<int, float> EntityUnderAttackListType;
|
||||||
EntityUnderAttackListType mEntitiesUnderAttack;
|
EntityUnderAttackListType mEntitiesUnderAttack;
|
||||||
|
|
||||||
|
bool mGameInReset;
|
||||||
|
|
||||||
AvHMiniMap mMiniMap;
|
AvHMiniMap mMiniMap;
|
||||||
|
|
||||||
AvHMapExtents mMapExtents;
|
AvHMapExtents mMapExtents;
|
||||||
|
|
Loading…
Reference in a new issue