summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_misc.c9
-rw-r--r--src/game/g_utils.c4
2 files changed, 7 insertions, 6 deletions
diff --git a/src/game/g_misc.c b/src/game/g_misc.c
index 2e002182..0572684d 100644
--- a/src/game/g_misc.c
+++ b/src/game/g_misc.c
@@ -91,10 +91,6 @@ void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles )
// set angles
G_SetClientViewAngle( player, angles );
- // kill anything at the destination
- if( player->client->sess.spectatorState == SPECTATOR_NOT )
- G_KillBox( player );
-
// save results of pmove
BG_PlayerStateToEntityState( &player->client->ps, &player->s, qtrue );
@@ -102,7 +98,12 @@ void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles )
VectorCopy( player->client->ps.origin, player->r.currentOrigin );
if( player->client->sess.spectatorState == SPECTATOR_NOT )
+ {
+ // kill anything at the destination
+ G_KillBox( player );
+
trap_LinkEntity (player);
+ }
}
diff --git a/src/game/g_utils.c b/src/game/g_utils.c
index e3e986d8..665cab3f 100644
--- a/src/game/g_utils.c
+++ b/src/game/g_utils.c
@@ -555,8 +555,8 @@ void G_KillBox( gentity_t *ent )
gentity_t *hit;
vec3_t mins, maxs;
- VectorAdd( ent->s.origin, ent->r.mins, mins );
- VectorAdd( ent->s.origin, ent->r.maxs, maxs );
+ VectorAdd( ent->r.currentOrigin, ent->r.mins, mins );
+ VectorAdd( ent->r.currentOrigin, ent->r.maxs, maxs );
num = trap_EntitiesInBox( mins, maxs, touch, MAX_GENTITIES );
for( i = 0; i < num; i++ )