o Force sv_structurelimit to 300 when mp_tournamentmode is set to 1

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@428 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
tankefugl 2006-04-27 12:32:35 +00:00
parent 8bda8397da
commit 55ee213145
3 changed files with 13 additions and 4 deletions

View file

@ -227,6 +227,7 @@ extern cvar_t avh_uplink;
extern cvar_t avh_gametime;
extern cvar_t avh_ironman;
extern cvar_t avh_mapvoteratio;
extern cvar_t avh_structurelimit;
BOOL IsSpawnPointValid( CBaseEntity *pPlayer, CBaseEntity *pSpot );
inline int FNullEnt( CBaseEntity *ent ) { return (ent == NULL) || FNullEnt( ent->edict() ); }
@ -1766,6 +1767,14 @@ void AvHGamerules::PlayerGotWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapo
}
}
int AvHGamerules::GetStructureLimit()
{
if (GetGameRules()->GetIsTournamentMode())
return 300;
else
return avh_structurelimit.value;
}
Vector AvHGamerules::GetSpawnAreaCenter(AvHTeamNumber inTeamNumber) const
{
Vector theCenter(0, 0, 0);

View file

@ -288,6 +288,8 @@ public:
bool GetIsGameInReset() {return this->mGameInReset; };
int GetStructureLimit();
protected:
void AutoAssignPlayer(AvHPlayer* inPlayer);
void PerformMapValidityCheck();

View file

@ -270,8 +270,6 @@ extern int gWeaponAnimationEventID;
extern int gMetabolizeSuccessEventID;
extern int gPhaseInEventID;
extern cvar_t avh_structurelimit;
// Yucky globals
extern AvHParticleTemplateListServer gParticleTemplateList;
extern AvHSoundListManager gSoundListManager;
@ -492,7 +490,7 @@ bool AvHPlayer::AttemptToBuildAlienStructure(AvHMessageID inMessageID)
// Check if collision point is valid for building
if(AvHSHUGetIsSiteValidForBuild(inMessageID, &theLocation))
{
if (theNumBuildings < avh_structurelimit.value)
if (theNumBuildings < GetGameRules()->GetStructureLimit())
{
// Make sure there aren't too many buildings in this area already
int theNumBuildingsNearby = UTIL_CountEntitiesInSphere(theLocation, BALANCE_VAR(kBuildingVisibilityRadius), theClassName);
@ -604,7 +602,7 @@ bool AvHPlayer::BuildTech(AvHMessageID inBuildID, const Vector& inPickRay)
// Make sure we haven't exceeded the structure limit
int theNumBuildings = AvHSUGetStructureCount(inBuildID);
if(theNumBuildings < avh_structurelimit.value)
if(theNumBuildings < GetGameRules()->GetStructureLimit())
{
if(theNumFriendlyEntitiesInArea < BALANCE_VAR(kMaxMarineEntitiesAllowedInRadius))
{