summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Tetelman <kevlarman@gmail.com>2009-10-03 12:23:21 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:54 +0000
commiteb8d5fd1bb8e1b6faf512606b45287a4bd607374 (patch)
tree32a81cb5a19370a0b60cb8cf1c0036e42bb177c4
parentdf5c979a32fb978180f6793ebec42999748a146b (diff)
* redo hovel removal in a way that doesn't break log parsers (reported by msk)
-rw-r--r--src/cgame/cg_tutorial.c5
-rw-r--r--src/game/bg_misc.c6
-rw-r--r--src/game/bg_public.h2
-rw-r--r--src/game/g_buildable.c25
-rw-r--r--src/game/g_cmds.c4
5 files changed, 19 insertions, 23 deletions
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c
index 3e6d354a..2dd5a5a2 100644
--- a/src/cgame/cg_tutorial.c
+++ b/src/cgame/cg_tutorial.c
@@ -654,7 +654,7 @@ const char *CG_TutorialText( void )
if( ps->stats[ STAT_TEAM ] == TEAM_ALIENS )
{
- /*entityState_t *es = CG_BuildableInRange( ps, NULL );
+ entityState_t *es = CG_BuildableInRange( ps, NULL );
if( ps->stats[ STAT_STATE ] & SS_HOVELING )
{
@@ -671,8 +671,7 @@ const char *CG_TutorialText( void )
va( "Press %s to enter the hovel\n",
CG_KeyNameForCommand( "+button7" ) ) );
}
- else*/
- if( BG_AlienCanEvolve( ps->stats[ STAT_CLASS ],
+ else if( BG_AlienCanEvolve( ps->stats[ STAT_CLASS ],
ps->persistant[ PERS_CREDIT ],
cgs.alienStage ) )
{
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index ad4a1d3f..d5e1e1c2 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -280,7 +280,7 @@ static const buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean uniqueTest;
HIVE_VALUE, //int value;
},
- /*{
+ {
BA_A_HOVEL, //int buildNum;
"hovel", //char *buildName;
"Hovel", //char *humanName;
@@ -291,7 +291,7 @@ static const buildableAttributes_t bg_buildableList[ ] =
TR_GRAVITY, //trType_t traj;
0.0, //float bounce;
HOVEL_BP, //int buildPoints;
- ( 1 << S3 ), //int stages
+ 0, //can't build it //int stages
HOVEL_HEALTH, //int health;
HOVEL_REGEN, //int regenRate;
HOVEL_SPLASHDAMAGE, //int splashDamage;
@@ -314,7 +314,7 @@ static const buildableAttributes_t bg_buildableList[ ] =
qfalse, //qboolean transparentTest;
qtrue, //qboolean uniqueTest;
HOVEL_VALUE, //int value;
- },*/
+ },
{
BA_H_SPAWN, //int buildNum;
"telenode", //char *buildName;
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 2b303d22..a08b8cdd 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -403,7 +403,7 @@ typedef enum
BA_A_BOOSTER,
BA_A_HIVE,
- /*BA_A_HOVEL,*/
+ BA_A_HOVEL,
BA_H_SPAWN,
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 475b1e67..3a8fb639 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -1218,8 +1218,7 @@ Is this hovel entrance blocked?
*/
qboolean AHovel_Blocked( gentity_t *hovel, gentity_t *player, qboolean provideExit )
{
- return qfalse;
- /*vec3_t forward, normal, origin, start, end, angles, hovelMaxs;
+ vec3_t forward, normal, origin, start, end, angles, hovelMaxs;
vec3_t mins, maxs;
float displacement;
trace_t tr;
@@ -1263,7 +1262,7 @@ qboolean AHovel_Blocked( gentity_t *hovel, gentity_t *player, qboolean provideEx
G_SetClientViewAngle( player, angles );
}
- return tr.fraction < 1.0f;*/
+ return tr.fraction < 1.0f;
}
/*
@@ -1273,7 +1272,6 @@ APropHovel_Blocked
Wrapper to test a hovel placement for validity
================
*/
-/*
static qboolean APropHovel_Blocked( vec3_t origin, vec3_t angles, vec3_t normal,
gentity_t *player )
{
@@ -1285,7 +1283,6 @@ static qboolean APropHovel_Blocked( vec3_t origin, vec3_t angles, vec3_t normal,
return AHovel_Blocked( &hovel, player, qfalse );
}
-*/
/*
================
@@ -2680,7 +2677,7 @@ static int G_CompareBuildablesForRemoval( const void *a, const void *b )
BA_A_TRAPPER,
BA_A_HIVE,
BA_A_BOOSTER,
- /*BA_A_HOVEL,*/
+ BA_A_HOVEL,
BA_A_SPAWN,
BA_A_OVERMIND,
@@ -2891,8 +2888,8 @@ static itemBuildError_t G_SufficientBPAvailable( buildable_t buildable,
continue;
// Don't allow destruction of hovel with granger inside
- /*if( ent->s.modelindex == BA_A_HOVEL && ent->active )
- continue;*/
+ if( ent->s.modelindex == BA_A_HOVEL && ent->active )
+ continue;
// Explicitly disallow replacement of the core buildable with anything
// other than the core buildable
@@ -3061,7 +3058,7 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance
reason = IBE_NOCREEP;
}
- /*if( buildable == BA_A_HOVEL )
+ if( buildable == BA_A_HOVEL )
{
vec3_t builderMins, builderMaxs;
@@ -3070,7 +3067,7 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance
if( APropHovel_Blocked( angles, origin, normal, ent ) )
reason = IBE_HOVELEXIT;
- }*/
+ }
// Check permission to build here
if( tr1.surfaceFlags & SURF_NOALIENBUILD || contents & CONTENTS_NOALIENBUILD )
@@ -3124,9 +3121,9 @@ itemBuildError_t G_CanBuild( gentity_t *ent, buildable_t buildable, int distance
reason = IBE_ONEOVERMIND;
break;
- /*case BA_A_HOVEL:
+ case BA_A_HOVEL:
reason = IBE_ONEHOVEL;
- break;*/
+ break;
case BA_H_REACTOR:
reason = IBE_ONEREACTOR;
@@ -3280,12 +3277,12 @@ static gentity_t *G_Build( gentity_t *builder, buildable_t buildable, vec3_t ori
built->pain = AGeneric_Pain;
break;
- /*case BA_A_HOVEL:
+ case BA_A_HOVEL:
built->die = AHovel_Die;
built->use = AHovel_Use;
built->think = AHovel_Think;
built->pain = AGeneric_Pain;
- break;*/
+ break;
case BA_H_SPAWN:
built->die = HSpawn_Die;
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 2a95ffa5..8863f2a2 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1859,8 +1859,8 @@ void Cmd_Destroy_f( gentity_t *ent )
}
// Don't allow destruction of hovel with granger inside
- /*if( traceEnt->s.modelindex == BA_A_HOVEL && traceEnt->active )
- return;*/
+ if( traceEnt->s.modelindex == BA_A_HOVEL && traceEnt->active )
+ return;
// Don't allow destruction of buildables that cannot be rebuilt
if( G_TimeTilSuddenDeath( ) <= 0 )