summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-10-03 13:16:49 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:38 +0000
commite9e52d0b7ec9bae071534df7581126d69d3e9bf8 (patch)
tree821a036f77322396ef919bb12fc8a64c7bcc4e51
parent8c7c2601239c96c077a54dd4753cde8e5ceccff7 (diff)
* Fix various fuck-ups introduced during the merge
+ Re-add error case when parsing damage scripts + Reinstate G_CountSpawns + Add missing call to PM_StartTorsoAnim + staticise G_IsCreepHere
-rw-r--r--src/game/bg_pmove.c1
-rw-r--r--src/game/g_buildable.c2
-rw-r--r--src/game/g_combat.c4
-rw-r--r--src/game/g_main.c32
4 files changed, 38 insertions, 1 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 2da8e965..b7cec16e 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -3090,6 +3090,7 @@ static void PM_Weapon( void )
//allow some time for the weapon to be raised
pm->ps->weaponstate = WEAPON_RAISING;
+ PM_StartTorsoAnim( TORSO_RAISE );
pm->ps->weaponTime += 250;
return;
}
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 2e906115..ab9d9afd 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -603,7 +603,7 @@ G_IsCreepHere
simple wrapper to G_FindCreep to check if a location has creep
================
*/
-qboolean G_IsCreepHere( vec3_t origin )
+static qboolean G_IsCreepHere( vec3_t origin )
{
gentity_t dummy;
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index fef3c6f5..afa613a4 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -506,6 +506,10 @@ int G_ParseDmgScript( damageRegion_t *regions, char *buf )
{
regions[ count ].crouch = qtrue;
}
+ else
+ {
+ G_Printf("WARNING: unknown token \"%s\" in damage script\n", token);
+ }
}
// Angle portion covered
diff --git a/src/game/g_main.c b/src/game/g_main.c
index d1eb0c68..8f77c5ea 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -302,6 +302,7 @@ void G_RunFrame( int levelTime );
void G_ShutdownGame( int restart );
void CheckExitRules( void );
+void G_CountSpawns( void );
void G_CalculateBuildPoints( void );
/*
@@ -665,6 +666,9 @@ void G_InitGame( int levelTime, int randomSeed, int restart )
level.suddenDeathBeginTime = g_suddenDeathTime.integer * 60000;
G_Printf( "-----------------------------------\n" );
+
+ // So the server counts the spawns without a client attached
+ G_CountSpawns( );
G_ResetPTRConnections( );
}
@@ -1044,6 +1048,33 @@ void G_SpawnClients( team_t team )
}
}
+/*
+============
+G_CountSpawns
+
+Counts the number of spawns for each team
+============
+*/
+void G_CountSpawns( void )
+{
+ int i;
+ gentity_t *ent;
+
+ level.numAlienSpawns = 0;
+ level.numHumanSpawns = 0;
+ for( i = 1, ent = g_entities + i ; i < level.num_entities ; i++, ent++ )
+ {
+ if( !ent->inuse || ent->s.eType != ET_BUILDABLE || ent->health <= 0 )
+ continue;
+
+ if( ent->s.modelindex == BA_A_SPAWN )
+ level.numAlienSpawns++;
+
+ if( ent->s.modelindex == BA_H_SPAWN )
+ level.numHumanSpawns++;
+ }
+}
+
/*
============
@@ -2553,6 +2584,7 @@ void G_RunFrame( int levelTime )
// save position information for all active clients
G_UnlaggedStore( );
+ G_CountSpawns( );
G_CalculateBuildPoints( );
G_CalculateStages( );
G_SpawnClients( TEAM_ALIENS );