diff options
-rw-r--r-- | src/cgame/cg_local.h | 2 | ||||
-rw-r--r-- | src/cgame/cg_syscalls.c | 2 | ||||
-rw-r--r-- | src/game/bg_misc.c | 44 | ||||
-rw-r--r-- | src/game/g_active.c | 26 | ||||
-rw-r--r-- | src/game/g_client.c | 2 | ||||
-rw-r--r-- | src/game/g_cmds.c | 2 |
6 files changed, 54 insertions, 24 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index de9c7c6f..276bfd41 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1475,7 +1475,7 @@ int trap_FS_FOpenFile( const char *qpath, fileHandle_t *f, fsMode_t mo void trap_FS_Read( void *buffer, int len, fileHandle_t f ); void trap_FS_Write( const void *buffer, int len, fileHandle_t f ); void trap_FS_FCloseFile( fileHandle_t f ); -int trap_FS_Seek( fileHandle_t f, long offset, int origin ); // fsOrigin_t +void trap_FS_Seek( fileHandle_t f, long offset, fsOrigin_t origin ); // fsOrigin_t // add commands to the local console as if they were typed in // for map changing, etc. The command is not executed immediately, diff --git a/src/cgame/cg_syscalls.c b/src/cgame/cg_syscalls.c index 835ea14d..b89751e2 100644 --- a/src/cgame/cg_syscalls.c +++ b/src/cgame/cg_syscalls.c @@ -104,7 +104,7 @@ void trap_FS_FCloseFile( fileHandle_t f ) syscall( CG_FS_FCLOSEFILE, f ); } -void trap_FS_Seek( fileHandle_t f, int offset, fsOrigin_t origin ) +void trap_FS_Seek( fileHandle_t f, long offset, fsOrigin_t origin ) { syscall( CG_FS_SEEK, f, offset, origin ); } diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 4422d29c..4300cfa1 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -1273,12 +1273,12 @@ classAttributes_t bg_classList[ ] = "default", //char *skinname; "alien_hud", //char *hudname; ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages - { -15, -15, -15 }, //vec3_t mins; - { 15, 15, 15 }, //vec3_t maxs; - { 15, 15, 15 }, //vec3_t crouchmaxs; + { -15, -15, -6 }, //vec3_t mins; + { 15, 15, 6 }, //vec3_t maxs; + { 15, 15, 6 }, //vec3_t crouchmaxs; { -15, -15, -4 }, //vec3_t deadmins; { 15, 15, 4 }, //vec3_t deadmaxs; - 0, 0, //int viewheight, crouchviewheight; + 6, 6, //int viewheight, crouchviewheight; SOLDIER_HEALTH, //int health; SOLDIER_REGEN, //int regenRate; SCA_WALLCLIMBER|SCA_CANJUMP|SCA_NOWEAPONDRIFT| @@ -1303,9 +1303,9 @@ classAttributes_t bg_classList[ ] = "red", //char *skinname; "alien_hud", //char *hudname; ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages - { -24, -24, -24 }, //vec3_t mins; - { 24, 24, 24 }, //vec3_t maxs; - { 24, 24, 24 }, //vec3_t crouchmaxs; + { -24, -24, -9 }, //vec3_t mins; + { 24, 24, 9 }, //vec3_t maxs; + { 24, 24, 9 }, //vec3_t crouchmaxs; { -24, -24, -4 }, //vec3_t deadmins; { 24, 24, 4 }, //vec3_t deadmaxs; 6, 6, //int viewheight, crouchviewheight; @@ -1332,9 +1332,9 @@ classAttributes_t bg_classList[ ] = "blue", //char *skinname; "alien_hud", //char *hudname; ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages - { -24, -24, -24 }, //vec3_t mins; - { 24, 24, 24 }, //vec3_t maxs; - { 24, 24, 24 }, //vec3_t crouchmaxs; + { -24, -24, -11 }, //vec3_t mins; + { 24, 24, 11 }, //vec3_t maxs; + { 24, 24, 11 }, //vec3_t crouchmaxs; { -24, -24, -4 }, //vec3_t deadmins; { 24, 24, 4 }, //vec3_t deadmaxs; 6, 6, //int viewheight, crouchviewheight; @@ -1361,9 +1361,9 @@ classAttributes_t bg_classList[ ] = "default", //char *skinname; "alien_hud", //char *hudname; ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages - { -24, -24, -24 }, //vec3_t mins; - { 24, 24, 24 }, //vec3_t maxs; - { 24, 24, 24 }, //vec3_t crouchmaxs; + { -24, -24, -12 }, //vec3_t mins; + { 24, 24, 12 }, //vec3_t maxs; + { 24, 24, 12 }, //vec3_t crouchmaxs; { -24, -24, -4 }, //vec3_t deadmins; { 24, 24, 4 }, //vec3_t deadmaxs; 6, 6, //int viewheight, crouchviewheight; @@ -1391,9 +1391,9 @@ classAttributes_t bg_classList[ ] = "blue", //char *skinname; "alien_hud", //char *hudname; ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages - { -24, -24, -24 }, //vec3_t mins; - { 24, 24, 24 }, //vec3_t maxs; - { 24, 24, 24 }, //vec3_t crouchmaxs; + { -24, -24, -14 }, //vec3_t mins; + { 24, 24, 14 }, //vec3_t maxs; + { 24, 24, 14 }, //vec3_t crouchmaxs; { -24, -24, -4 }, //vec3_t deadmins; { 24, 24, 4 }, //vec3_t deadmaxs; 6, 6, //int viewheight, crouchviewheight; @@ -1450,9 +1450,9 @@ classAttributes_t bg_classList[ ] = "red", //char *skinname; "alien_hud", //char *hudname; ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages - { -15, -15, -15 }, //vec3_t mins; - { 15, 15, 15 }, //vec3_t maxs; - { 15, 15, 15 }, //vec3_t crouchmaxs; + { -15, -15, -16 }, //vec3_t mins; + { 15, 15, 16 }, //vec3_t maxs; + { 15, 15, 16 }, //vec3_t crouchmaxs; { -15, -15, -4 }, //vec3_t deadmins; { 15, 15, 4 }, //vec3_t deadmaxs; 4, 4, //int viewheight, crouchviewheight; @@ -1479,9 +1479,9 @@ classAttributes_t bg_classList[ ] = "default", //char *skinname; "alien_hud", //char *hudname; ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages - { -30, -30, -35 }, //vec3_t mins; - { 30, 30, 15 }, //vec3_t maxs; - { 30, 30, 15 }, //vec3_t crouchmaxs; + { -30, -30, -36 }, //vec3_t mins; + { 30, 30, 36 }, //vec3_t maxs; + { 30, 30, 36 }, //vec3_t crouchmaxs; { -15, -15, -4 }, //vec3_t deadmins; { 15, 15, 4 }, //vec3_t deadmaxs; 4, 4, //int viewheight, crouchviewheight; diff --git a/src/game/g_active.c b/src/game/g_active.c index 463868db..7c643014 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1114,6 +1114,13 @@ void ClientThink_real( gentity_t *ent ) } else { +#define USE_OBJECT_RANGE 64 + + int entityList[ MAX_GENTITIES ]; + vec3_t range = { USE_OBJECT_RANGE, USE_OBJECT_RANGE, USE_OBJECT_RANGE }; + vec3_t mins, maxs, dir; + int i, num; + //TA: look for object infront of player AngleVectors( client->ps.viewangles, view, NULL, NULL ); VectorMA( client->ps.origin, 200, view, point ); @@ -1123,6 +1130,25 @@ void ClientThink_real( gentity_t *ent ) if( traceEnt->use ) traceEnt->use( traceEnt, ent, ent ); //other and activator are the same in this context + else + { + //no entity in front of player - do a small area search + + VectorAdd( client->ps.origin, range, maxs ); + VectorSubtract( client->ps.origin, range, mins ); + + num = trap_EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES ); + for( i = 0; i < num; i++ ) + { + traceEnt = &g_entities[ entityList[ i ] ]; + + if( traceEnt->use ) + { + traceEnt->use( traceEnt, ent, ent ); //other and activator are the same in this context + break; + } + } + } } } diff --git a/src/game/g_client.c b/src/game/g_client.c index 0935c84a..b6bb58f8 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1281,6 +1281,8 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn ) spawn_origin[ 2 ] += bodyMaxs[ 2 ] + fabs( classMins[ 2 ] ) + 1; G_AddEvent( spawn, EV_GIB_ALIEN, DirToByte( up ) ); spawn->freeAfterEvent = qtrue; + + spawnPoint = spawn; } else { diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 6b8664ec..32c3c6ee 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1836,6 +1836,8 @@ void Cmd_Spawnbody_f( gentity_t *ent ) VectorMA( ent->client->ps.origin, 128.0f, forward, dummy->r.currentOrigin ); dummy->r.currentOrigin[ 2 ] += 64.0f; + dummy->client = level.clients + MAX_CLIENTS; + dummy->client->ps.stats[ STAT_PTEAM ] = PTE_HUMANS; dummy->client->ps.stats[ STAT_PCLASS ] = PCL_H_BASE; |