summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_misc.c4
-rw-r--r--src/game/g_active.c11
-rw-r--r--src/game/g_buildable.c13
-rw-r--r--src/game/g_client.c8
4 files changed, 26 insertions, 10 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 25ade6fd..d168b8da 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -1421,7 +1421,7 @@ void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean
int i;
vec3_t ceilingNormal = { 0, 0, -1 };
- if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR ) {
+ if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR || ps->pm_type == PM_FREEZE ) {
s->eType = ET_INVISIBLE;
} else if ( ps->stats[STAT_HEALTH] <= GIB_HEALTH ) {
s->eType = ET_INVISIBLE;
@@ -1516,7 +1516,7 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s
int i;
vec3_t ceilingNormal = { 0, 0, -1 };
- if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR ) {
+ if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR || ps->pm_type == PM_FREEZE ) {
s->eType = ET_INVISIBLE;
} else if ( ps->stats[STAT_HEALTH] <= GIB_HEALTH ) {
s->eType = ET_INVISIBLE;
diff --git a/src/game/g_active.c b/src/game/g_active.c
index 3e2d704c..e2215014 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -777,7 +777,6 @@ void ClientThink_real( gentity_t *ent ) {
!( client->ps.pm_type == PM_DEAD )
)
{
- Com_Printf( "spawn torch\n" );
light = G_Spawn( );
light->s.eType = ET_TORCH;
light->r.ownerNum = ent->s.number;
@@ -792,7 +791,6 @@ void ClientThink_real( gentity_t *ent ) {
)
)
{
- Com_Printf( "destroy torch\n" );
G_FreeEntity( client->torch );
trap_LinkEntity( client->torch );
client->torch = NULL;
@@ -927,17 +925,16 @@ void ClientThink_real( gentity_t *ent ) {
{
trace_t mcu;
vec3_t view, point;
- gentity_t *mcuEntity;
+ gentity_t *traceEnt;
AngleVectors( client->ps.viewangles, view, NULL, NULL );
VectorMA( client->ps.origin, 200, view, point );
trap_Trace( &mcu, client->ps.origin, NULL, NULL, point, ent->s.number, MASK_SHOT );
- mcuEntity = &g_entities[ mcu.entityNum ];
+ traceEnt = &g_entities[ mcu.entityNum ];
- //bring up a menu if its there
- if( !Q_stricmp( mcuEntity->classname, "team_human_mcu" ) )
- G_AddPredictableEvent( ent, EV_MENU, MN_MCU );
+ if( traceEnt->use )
+ traceEnt->use( traceEnt, ent, ent ); //other and activator are the same in this context
}
}
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 98fbe237..455c74b9 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -211,6 +211,18 @@ void DDef1_Think( gentity_t *self )
self->nextthink = level.time + 100;
}
+/*
+================
+HMCU_Activate
+
+Called when a human activates an MCU
+================
+*/
+void HMCU_Activate( gentity_t *self, gentity_t *other, gentity_t *activator )
+{
+ G_AddPredictableEvent( activator, EV_MENU, MN_MCU );
+}
+
//TA: the following defense turret code was written by
// "fuzzysteve" (fuzzysteve@quakefiles.com) and
// Anthony "inolen" Pesch (www.inolen.com)
@@ -635,6 +647,7 @@ gentity_t *Build_Item( gentity_t *ent, gitem_t *item, int distance ) {
//built->think = HSpawn_Think;
//built->nextthink = level.time + 1000;
built->die = HSpawn_Die;
+ built->use = HMCU_Activate;
//built->pain = HSpawn_Pain;
}
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 4b0c4b78..5e6c4c4e 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -559,7 +559,8 @@ just like the existing corpse to leave behind.
void CopyToBodyQue( gentity_t *ent ) {
gentity_t *body;
int contents;
- vec3_t origin;
+ vec3_t origin, dest;
+ trace_t tr;
VectorCopy( ent->r.currentOrigin, origin );
@@ -622,6 +623,11 @@ void CopyToBodyQue( gentity_t *ent ) {
VectorSet( body->r.mins, -15, -15, -15 );
VectorSet( body->r.maxs, 15, 15, 15 );
+ //drop to floor
+ VectorSet( dest, origin[0], origin[1], origin[2] - 4096 );
+ trap_Trace( &tr, origin, body->r.mins, body->r.maxs, dest, body->s.number, body->clipmask );
+ VectorCopy( tr.endpos, origin );
+
G_SetOrigin( body, origin );
VectorCopy( origin, body->s.origin );
body->s.pos.trType = TR_GRAVITY;