summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Millwood <thebenmachine@gmail.com>2009-10-03 12:55:58 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:20 +0000
commit564fbccd704780f16dd58e03278b11336944fb68 (patch)
treeb8ff124be0ad0491071c92e43a31c1a1c8a39142
parent5d0545b0427813e9841d876d6022b5e4f664effd (diff)
add cg_disableBlueprintErrors and un-cvarize g_humanRepeaterAllowOverlap
-rw-r--r--src/cgame/cg_local.h1
-rw-r--r--src/cgame/cg_main.c2
-rw-r--r--src/game/g_buildable.c2
-rw-r--r--src/game/g_client.c8
-rw-r--r--src/game/g_cmds.c31
-rw-r--r--src/game/g_local.h2
-rw-r--r--src/game/g_main.c2
-rw-r--r--src/game/tremulous.h2
8 files changed, 39 insertions, 11 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 5518a329..f1e0ada0 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1504,6 +1504,7 @@ extern vmCvar_t cg_noTaunt;
extern vmCvar_t cg_drawSurfNormal;
extern vmCvar_t cg_drawBBOX;
extern vmCvar_t cg_wwSmoothTime;
+extern vmCvar_t cg_disableBlueprintErrors;
extern vmCvar_t cg_depthSortParticles;
extern vmCvar_t cg_bounceParticles;
extern vmCvar_t cg_consoleLatency;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 2dd07ba2..4ddc5c47 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -172,6 +172,7 @@ vmCvar_t cg_noTaunt;
vmCvar_t cg_drawSurfNormal;
vmCvar_t cg_drawBBOX;
vmCvar_t cg_wwSmoothTime;
+vmCvar_t cg_disableBlueprintErrors;
vmCvar_t cg_depthSortParticles;
vmCvar_t cg_bounceParticles;
vmCvar_t cg_consoleLatency;
@@ -284,6 +285,7 @@ static cvarTable_t cvarTable[ ] =
{ &cg_wwSmoothTime, "cg_wwSmoothTime", "300", CVAR_ARCHIVE },
{ NULL, "cg_wwFollow", "1", CVAR_ARCHIVE|CVAR_USERINFO },
{ NULL, "cg_wwToggle", "1", CVAR_ARCHIVE|CVAR_USERINFO },
+ { NULL, "cg_disableBlueprintErrors", "0", CVAR_ARCHIVE|CVAR_USERINFO },
{ &cg_stickySpec, "cg_stickySpec", "1", CVAR_ARCHIVE|CVAR_USERINFO },
{ &cg_alwaysSprint, "cg_alwaysSprint", "0", CVAR_ARCHIVE|CVAR_USERINFO },
{ &cg_unlagged, "cg_unlagged", "1", CVAR_ARCHIVE|CVAR_USERINFO },
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index e11fb109..d72b7352 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -3490,7 +3490,7 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance
reason = IBE_RPTPOWERHERE;
else if( !g_markDeconstruct.integer && G_IsPowered( entity_origin ) )
reason = IBE_RPTPOWERHERE;
- else if( !g_humanRepeaterAllowOverlap.integer )
+ else if( !REPEATER_ALLOWOVERLAP )
{
tempent = G_RepeaterWouldOverlap( entity_origin );
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 174498ab..51972395 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -1134,6 +1134,14 @@ void ClientUserinfoChanged( int clientNum )
else
client->pers.flySpeed = BG_Class( PCL_NONE )->speed;
+ // disable blueprint errors
+ s = Info_ValueForKey( userinfo, "cg_disableBlueprintErrors" );
+
+ if( atoi( s ) )
+ client->pers.disableBlueprintErrors = qtrue;
+ else
+ client->pers.disableBlueprintErrors = qfalse;
+
// teamInfo
s = Info_ValueForKey( userinfo, "teamoverlay" );
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 65eedc3f..9c670d5a 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -2522,32 +2522,51 @@ void Cmd_Build_f( gentity_t *ent )
case IBE_NOROOM:
case IBE_NOOVERMIND:
case IBE_NOPOWERHERE:
+ case IBE_RPWCAUSEOVRL:
ent->client->ps.stats[ STAT_BUILDABLE ] = buildable;
break;
// more serious errors just pop a menu
case IBE_NOALIENBP:
- G_TriggerMenu( ent->client->ps.clientNum, MN_A_NOBP );
+ if( ent->client->pers.disableBlueprintErrors )
+ ent->client->ps.stats[ STAT_BUILDABLE ] = buildable;
+ else
+ G_TriggerMenu( ent->client->ps.clientNum, MN_A_NOBP );
break;
case IBE_ONEOVERMIND:
- G_TriggerMenu( ent->client->ps.clientNum, MN_A_ONEOVERMIND );
+ if( ent->client->pers.disableBlueprintErrors )
+ ent->client->ps.stats[ STAT_BUILDABLE ] = buildable;
+ else
+ G_TriggerMenu( ent->client->ps.clientNum, MN_A_ONEOVERMIND );
break;
case IBE_ONEHOVEL:
- G_TriggerMenu( ent->client->ps.clientNum, MN_A_ONEHOVEL );
+ if( ent->client->pers.disableBlueprintErrors )
+ ent->client->ps.stats[ STAT_BUILDABLE ] = buildable;
+ else
+ G_TriggerMenu( ent->client->ps.clientNum, MN_A_ONEHOVEL );
break;
case IBE_ONEREACTOR:
- G_TriggerMenu( ent->client->ps.clientNum, MN_H_ONEREACTOR );
+ if( ent->client->pers.disableBlueprintErrors )
+ ent->client->ps.stats[ STAT_BUILDABLE ] = buildable;
+ else
+ G_TriggerMenu( ent->client->ps.clientNum, MN_H_ONEREACTOR );
break;
case IBE_NOHUMANBP:
- G_TriggerMenu( ent->client->ps.clientNum, MN_H_NOBP);
+ if( ent->client->pers.disableBlueprintErrors )
+ ent->client->ps.stats[ STAT_BUILDABLE ] = buildable;
+ else
+ G_TriggerMenu( ent->client->ps.clientNum, MN_H_NOBP);
break;
case IBE_NODCC:
- G_TriggerMenu( ent->client->ps.clientNum, MN_H_NODCC );
+ if( ent->client->pers.disableBlueprintErrors )
+ ent->client->ps.stats[ STAT_BUILDABLE ] = buildable;
+ else
+ G_TriggerMenu( ent->client->ps.clientNum, MN_H_NODCC );
break;
default:
diff --git a/src/game/g_local.h b/src/game/g_local.h
index af4a955c..e24d6f89 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -308,6 +308,7 @@ typedef struct
int voteCount; // to prevent people from constantly calling votes
qboolean teamInfo; // send team overlay updates?
float flySpeed; // for spectator/noclip moves
+ qboolean disableBlueprintErrors; // should the buildable blueprint never be hidden from the players?
class_t classSelection; // player class (copied to ent->client->ps.stats[ STAT_CLASS ] once spawned)
float evolveHealthFraction;
@@ -1087,7 +1088,6 @@ extern vmCvar_t g_humanBuildQueueTime;
extern vmCvar_t g_humanRepeaterBuildPoints;
extern vmCvar_t g_humanRepeaterBuildQueueTime;
extern vmCvar_t g_humanRepeaterMaxZones;
-extern vmCvar_t g_humanRepeaterAllowOverlap;
extern vmCvar_t g_humanStage;
extern vmCvar_t g_humanCredits;
extern vmCvar_t g_humanMaxStage;
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 44fafba0..67a59538 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -93,7 +93,6 @@ vmCvar_t g_humanBuildPoints;
vmCvar_t g_humanBuildQueueTime;
vmCvar_t g_humanRepeaterBuildPoints;
vmCvar_t g_humanRepeaterBuildQueueTime;
-vmCvar_t g_humanRepeaterAllowOverlap;
vmCvar_t g_humanRepeaterMaxZones;
vmCvar_t g_humanStage;
vmCvar_t g_humanCredits;
@@ -233,7 +232,6 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_humanRepeaterBuildPoints, "g_humanRepeaterBuildPoints", DEFAULT_HUMAN_REPEATER_BUILDPOINTS, 0, 0, qfalse },
{ &g_humanRepeaterMaxZones, "g_humanRepeaterMaxZones", DEFAULT_HUMAN_REPEATER_MAX_ZONES, 0, 0, qfalse },
{ &g_humanRepeaterBuildQueueTime, "g_humanRepeaterBuildQueueTime", DEFAULT_HUMAN_REPEATER_QUEUE_TIME, 0, 0, qfalse },
- { &g_humanRepeaterAllowOverlap, "g_humanRepeaterAllowOverlap", DEFAULT_HUMAN_REPEATER_ALLOW_OVERLAP, 0, 0, qfalse },
{ &g_humanStage, "g_humanStage", "0", 0, 0, qfalse },
{ &g_humanCredits, "g_humanCredits", "0", 0, 0, qfalse },
{ &g_humanMaxStage, "g_humanMaxStage", DEFAULT_HUMAN_MAX_STAGE, 0, 0, qfalse },
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index a3ca5152..26265536 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -616,6 +616,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define REPEATER_SPLASHRADIUS 100
#define REPEATER_INACTIVE_TIME 90000
#define REPEATER_VALUE HBVM(2)
+#define REPEATER_ALLOWOVERLAP qtrue
/*
* HUMAN misc
@@ -669,7 +670,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define DEFAULT_HUMAN_REPEATER_BUILDPOINTS "20"
#define DEFAULT_HUMAN_REPEATER_QUEUE_TIME "0"
#define DEFAULT_HUMAN_REPEATER_MAX_ZONES "500"
-#define DEFAULT_HUMAN_REPEATER_ALLOW_OVERLAP "1"
#define DEFAULT_HUMAN_STAGE2_THRESH "4000"
#define DEFAULT_HUMAN_STAGE3_THRESH "8000"
#define DEFAULT_HUMAN_MAX_STAGE "2"