summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/g_active.c14
-rw-r--r--src/game/g_buildable.c43
-rw-r--r--src/game/g_local.h3
-rw-r--r--src/game/g_main.c9
-rw-r--r--src/game/g_mover.c8
-rw-r--r--src/game/tremulous.h2
6 files changed, 40 insertions, 39 deletions
diff --git a/src/game/g_active.c b/src/game/g_active.c
index a8889ef1..f9e14243 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -986,11 +986,17 @@ void ClientThink_real( gentity_t *ent )
//randomly disable the jet pack if damaged
if( BG_gotItem( UP_JETPACK, client->ps.stats ) &&
- BG_activated( UP_JETPACK, client->ps.stats ) &&
- ( client->lastDamageTime + JETPACK_DISABLE_TIME > level.time ) )
+ BG_activated( UP_JETPACK, client->ps.stats ) )
{
- if( random( ) > JETPACK_DISABLE_CHANCE )
- client->ps.pm_type = PM_NORMAL;
+ if( client->lastDamageTime + JETPACK_DISABLE_TIME > level.time )
+ {
+ if( random( ) > JETPACK_DISABLE_CHANCE )
+ client->ps.pm_type = PM_NORMAL;
+ }
+
+ //switch jetpack off if no reactor
+ if( !level.reactorPresent )
+ BG_deactivateItem( UP_JETPACK, client->ps.stats );
}
// set up for pmove
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 7035ec18..29245882 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -140,7 +140,7 @@ static qboolean findPower( gentity_t *self )
//iterate through entities
for ( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ )
{
- if( !ent->classname || ent->s.eType != ET_BUILDABLE )
+ if( ent->s.eType != ET_BUILDABLE )
continue;
//if entity is a power item calculate the distance to it
@@ -223,7 +223,7 @@ static qboolean findDCC( gentity_t *self )
//iterate through entities
for( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ )
{
- if( !ent->classname || ent->s.eType != ET_BUILDABLE )
+ if( ent->s.eType != ET_BUILDABLE )
continue;
//if entity is a dcc calculate the distance to it
@@ -277,11 +277,6 @@ static qboolean findOvermind( gentity_t *self )
{
int i;
gentity_t *ent;
- gentity_t *closestOvermind;
- int distance = 0;
- int minDistance = 10000;
- vec3_t temp_v;
- qboolean foundOvermind = qfalse;
if( self->biteam != BIT_ALIENS )
return qfalse;
@@ -296,30 +291,18 @@ static qboolean findOvermind( gentity_t *self )
//iterate through entities
for( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ )
{
- if( !ent->classname || ent->s.eType != ET_BUILDABLE )
+ if( ent->s.eType != ET_BUILDABLE )
continue;
//if entity is a dcc calculate the distance to it
if( ent->s.modelindex == BA_A_OVERMIND && ent->spawned )
{
- VectorSubtract( self->s.origin, ent->s.origin, temp_v );
- distance = VectorLength( temp_v );
- if( distance < minDistance && ent->powered )
- {
- closestOvermind = ent;
- minDistance = distance;
- foundOvermind = qtrue;
- }
+ self->overmindNode = ent;
+ return qtrue;
}
}
- //if there were no power items nearby give up
- if( !foundOvermind )
- return qfalse;
-
- self->overmindNode = closestOvermind;
-
- return qtrue;
+ return qfalse;
}
/*
@@ -347,7 +330,7 @@ static qboolean findCreep( gentity_t *self )
{
for ( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ )
{
- if( !ent->classname || ent->s.eType != ET_BUILDABLE )
+ if( ent->s.eType != ET_BUILDABLE )
continue;
if( ( ent->s.modelindex == BA_A_SPAWN || ent->s.modelindex == BA_A_OVERMIND ) &&
@@ -1429,7 +1412,7 @@ void HRpt_Think( gentity_t *self )
//iterate through entities
for ( i = 1, ent = g_entities + i; i < level.num_entities; i++, ent++ )
{
- if( !ent->classname || ent->s.eType != ET_BUILDABLE )
+ if( ent->s.eType != ET_BUILDABLE )
continue;
if( ent->s.modelindex == BA_H_REACTOR )
@@ -2270,7 +2253,7 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance
//look for a hivemind
for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ )
{
- if( !tempent->classname || tempent->s.eType != ET_BUILDABLE )
+ if( tempent->s.eType != ET_BUILDABLE )
continue;
if( tempent->s.modelindex == BA_A_OVERMIND )
break;
@@ -2290,7 +2273,7 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance
{
for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ )
{
- if( !tempent->classname || tempent->s.eType != ET_BUILDABLE )
+ if( tempent->s.eType != ET_BUILDABLE )
continue;
if( tempent->s.modelindex == BA_A_OVERMIND )
@@ -2327,7 +2310,7 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance
{
for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ )
{
- if( !tempent->classname || tempent->s.eType != ET_BUILDABLE )
+ if( tempent->s.eType != ET_BUILDABLE )
continue;
if( tempent->s.modelindex == BA_H_REACTOR )
@@ -2347,7 +2330,7 @@ itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance
{
for ( i = 1, tempent = g_entities + i; i < level.num_entities; i++, tempent++ )
{
- if( !tempent->classname || tempent->s.eType != ET_BUILDABLE )
+ if( tempent->s.eType != ET_BUILDABLE )
continue;
if( tempent->s.modelindex == BA_H_REACTOR )
@@ -2691,7 +2674,7 @@ void FinishSpawningBuildable( gentity_t *ent )
if( tr.startsolid )
{
- G_Printf( "FinishSpawningBuildable: %s startsolid at %s\n", built->classname, vtos( built->s.origin ) );
+ G_Printf( S_COLOR_YELLOW "FinishSpawningBuildable: %s startsolid at %s\n", built->classname, vtos( built->s.origin ) );
G_FreeEntity( built );
return;
}
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 9f267c51..2026470d 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -520,6 +520,9 @@ typedef struct
int alienKills;
int humanKills;
+ qboolean reactorPresent;
+ qboolean overmindPresent;
+
pTeam_t lastWin;
} level_locals_t;
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 8656f0f5..ed129c6c 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -713,6 +713,9 @@ void calculateBuildPoints( void )
level.humanBuildPoints = level.humanBuildPointsPowered = localHTP;
level.alienBuildPoints = localATP;
+ level.reactorPresent = qfalse;
+ level.overmindPresent = qfalse;
+
for( i = 1, ent = g_entities + i ; i < level.num_entities ; i++, ent++ )
{
if( !ent->inuse )
@@ -725,6 +728,12 @@ void calculateBuildPoints( void )
if( buildable != BA_NONE )
{
+ if( buildable == BA_H_REACTOR )
+ level.reactorPresent = qtrue;
+
+ if( buildable == BA_A_OVERMIND )
+ level.overmindPresent = qtrue;
+
if( BG_FindTeamForBuildable( buildable ) == BIT_HUMANS )
{
level.humanBuildPoints -= BG_FindBuildPointsForBuildable( buildable );
diff --git a/src/game/g_mover.c b/src/game/g_mover.c
index 404453ed..3bc4e94b 100644
--- a/src/game/g_mover.c
+++ b/src/game/g_mover.c
@@ -1209,8 +1209,8 @@ static void manualDoorTriggerSpectator( gentity_t *door, gentity_t *player )
best = i;
}
- maxs[ best ] += 30;
- mins[ best ] -= 30;
+ maxs[ best ] += 60;
+ mins[ best ] -= 60;
VectorCopy( mins, triggerHull.r.absmin );
VectorCopy( maxs, triggerHull.r.absmax );
@@ -1340,8 +1340,8 @@ void Think_SpawnNewDoorTrigger( gentity_t *ent )
best = i;
}
- maxs[ best ] += 30;
- mins[ best ] -= 30;
+ maxs[ best ] += 60;
+ mins[ best ] -= 60;
// create a trigger with this size
other = G_Spawn( );
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index ccca7044..cf349276 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -317,7 +317,7 @@
#define PAINSAW_PRICE 100
#define PAINSAW_REPEAT 75
-#define PAINSAW_DAMAGE HDM(5)
+#define PAINSAW_DAMAGE HDM(25)
#define PAINSAW_RANGE 48.0f
#define SHOTGUN_PRICE 150