From 91d17e135e2c4cc9869ab846f72798f018775c5c Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 31 Jul 2006 21:35:21 +0000 Subject: * Add otherEntityNum to playerState_t... and don't use it... yet * Improve ckit tutorial text * Entities.def correction --- misc/entities.def | 14 +++++++------- src/cgame/cg_predict.c | 7 ------- src/cgame/cg_tutorial.c | 21 ++++++++++++++++++--- src/cgame/cg_weapons.c | 2 -- src/game/bg_misc.c | 8 ++++++-- src/game/g_active.c | 7 ------- src/game/g_weapon.c | 2 +- src/qcommon/msg.c | 2 +- src/qcommon/q_shared.h | 2 +- 9 files changed, 34 insertions(+), 31 deletions(-) diff --git a/misc/entities.def b/misc/entities.def index 5b30405d..e4aeacb3 100644 --- a/misc/entities.def +++ b/misc/entities.def @@ -925,6 +925,13 @@ notteam: when set to 1, entity will not spawn in "Teamplay" and "CTF" modes. notsingle: when set to 1, entity will not spawn in Single Player mode (bot play mode). +-------- SPAWNFLAGS -------- +SLOWROTATE: makes the portal camera rotate slowly along the roll axis. + +FASTROTATE: makes the portal camera rotate faster along the roll axis. + +NOROTATE: no rolling at all. + -------- NOTES -------- Both the setting "angles" key or "targeting a target_position" methods can be used to aim the camera. However, the target_position method is simpler. In both cases, the "roll" key must be used to set the roll angle. */ @@ -943,13 +950,6 @@ notteam: when set to 1, entity will not spawn in "Teamplay" and "CTF" modes. notsingle: when set to 1, entity will not spawn in Single Player mode (bot play mode). --------- SPAWNFLAGS -------- -SLOWROTATE: makes the portal camera rotate slowly along the roll axis. - -FASTROTATE: makes the portal camera rotate faster along the roll axis. - -NOROTATE: no rolling at all. - -------- NOTES -------- The entity must be no farther than 64 units away from the portal surface to lock onto it. To make a mirror, apply the common/mirror shader to the surface, place this entity near it but don't target a misc_portal_camera. */ diff --git a/src/cgame/cg_predict.c b/src/cgame/cg_predict.c index 8c4bc8e3..926d9881 100644 --- a/src/cgame/cg_predict.c +++ b/src/cgame/cg_predict.c @@ -387,13 +387,6 @@ static void CG_TouchTriggerPrediction( void ) if( ent->eType == ET_TELEPORT_TRIGGER ) cg.hyperspace = qtrue; } - - // if we didn't touch a jump pad this pmove frame - if( cg.predictedPlayerState.jumppad_frame != cg.predictedPlayerState.pmove_framecount ) - { - cg.predictedPlayerState.jumppad_frame = 0; - cg.predictedPlayerState.jumppad_ent = 0; - } } diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c index 1499daef..be3cc37c 100644 --- a/src/cgame/cg_tutorial.c +++ b/src/cgame/cg_tutorial.c @@ -141,11 +141,12 @@ static const char *CG_KeyNameForCommand( const char *command ) CG_BuildableInRange =============== */ -static qboolean CG_BuildableInRange( playerState_t *ps ) +static qboolean CG_BuildableInRange( playerState_t *ps, float *healthFraction ) { vec3_t view, point; trace_t trace; entityState_t *es; + int health; AngleVectors( cg.refdefViewAngles, view, NULL, NULL ); VectorMA( cg.refdef.vieworg, 64, view, point ); @@ -154,6 +155,12 @@ static qboolean CG_BuildableInRange( playerState_t *ps ) es = &cg_entities[ trace.entityNum ].currentState; + if( healthFraction ) + { + health = es->generic1 & ~( B_POWERED_TOGGLEBIT | B_DCCED_TOGGLEBIT | B_SPAWNED_TOGGLEBIT ); + *healthFraction = (float)health / B_HEALTH_SCALE; + } + if( es->eType == ET_BUILDABLE && ps->stats[ STAT_PTEAM ] == BG_FindTeamForBuildable( es->modelindex ) ) return qtrue; @@ -188,7 +195,7 @@ static void CG_AlienBuilderText( char *text, playerState_t *ps ) va( "Press %s to build a structure\n", CG_KeyNameForCommand( "+attack" ) ) ); - if( CG_BuildableInRange( ps ) ) + if( CG_BuildableInRange( ps, NULL ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to destroy this structure\n", @@ -326,6 +333,7 @@ CG_HumanCkitText static void CG_HumanCkitText( char *text, playerState_t *ps ) { buildable_t buildable = ps->stats[ STAT_BUILDABLE ] & ~SB_VALID_TOGGLEBIT; + float health; if( buildable > BA_NONE ) { @@ -345,8 +353,15 @@ static void CG_HumanCkitText( char *text, playerState_t *ps ) va( "Press %s to build a structure\n", CG_KeyNameForCommand( "+attack" ) ) ); - if( CG_BuildableInRange( ps ) ) + if( CG_BuildableInRange( ps, &health ) ) { + if( health < 1.0f ) + { + Q_strcat( text, MAX_TUTORIAL_TEXT, + va( "Hold %s to repair this structure\n", + CG_KeyNameForCommand( "+button5" ) ) ); + } + Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to destroy this structure\n", CG_KeyNameForCommand( "deconstruct" ) ) ); diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 7b79fc5d..64e6e927 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -1047,8 +1047,6 @@ void CG_AddViewWeapon( playerState_t *ps ) return; // drop gun lower at higher fov - //if ( cg_fov.integer > 90 ) { - //TA: the client side variable isn't used ( shouldn't iD have done this anyway? ) if( cg.refdef.fov_y > 90 ) fovOffset = -0.4 * ( cg.refdef.fov_y - 90 ); else diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index f04d562f..01f7e046 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -4599,7 +4599,7 @@ void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean s->weapon = ps->weapon; s->groundEntityNum = ps->groundEntityNum; - //store items held and active items in otherEntityNum + //store items held and active items in modelindex and modelindex2 s->modelindex = 0; s->modelindex2 = 0; for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) @@ -4626,6 +4626,8 @@ void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean if( s->generic1 <= WPM_NONE || s->generic1 >= WPM_NUM_WEAPONMODES ) s->generic1 = WPM_PRIMARY; + + s->otherEntityNum = ps->otherEntityNum; } @@ -4708,7 +4710,7 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s s->weapon = ps->weapon; s->groundEntityNum = ps->groundEntityNum; - //store items held and active items in otherEntityNum + //store items held and active items in modelindex and modelindex2 s->modelindex = 0; s->modelindex2 = 0; @@ -4736,6 +4738,8 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s if( s->generic1 <= WPM_NONE || s->generic1 >= WPM_NUM_WEAPONMODES ) s->generic1 = WPM_PRIMARY; + + s->otherEntityNum = ps->otherEntityNum; } /* diff --git a/src/game/g_active.c b/src/game/g_active.c index 73c42b99..b0fdb56f 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -304,13 +304,6 @@ void G_TouchTriggers( gentity_t *ent ) if( hit->touch ) hit->touch( hit, ent, &trace ); } - - // if we didn't touch a jump pad this pmove frame - if( ent->client->ps.jumppad_frame != ent->client->ps.pmove_framecount ) - { - ent->client->ps.jumppad_frame = 0; - ent->client->ps.jumppad_ent = 0; - } } /* diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index abeee458..d57f259f 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -1169,7 +1169,7 @@ void G_UpdateZaps( int msec ) // don't let a high msec value inflate the total damage if( damage + zap->damageUsed > LEVEL2_AREAZAP_DMG ) - damage = LEVEL2_AREAZAP_DMG - zap->damageUsed; + damage = LEVEL2_AREAZAP_DMG - zap->damageUsed; VectorSubtract( target->s.origin, source->s.origin, forward ); VectorNormalize( forward ); diff --git a/src/qcommon/msg.c b/src/qcommon/msg.c index e4db4d8e..0fa7385a 100644 --- a/src/qcommon/msg.c +++ b/src/qcommon/msg.c @@ -1156,7 +1156,7 @@ netField_t playerStateFields[] = { PSF(grapplePoint[0]), 0 }, { PSF(grapplePoint[1]), 0 }, { PSF(grapplePoint[2]), 0 }, -{ PSF(jumppad_ent), 10 }, +{ PSF(otherEntityNum), 10 }, { PSF(loopSound), 16 } }; diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h index 0127fd90..9ade94b5 100644 --- a/src/qcommon/q_shared.h +++ b/src/qcommon/q_shared.h @@ -1077,7 +1077,7 @@ typedef struct playerState_s { int generic1; int loopSound; - int jumppad_ent; // jumppad entity hit this frame + int otherEntityNum; // not communicated over the net at all int ping; // server to game info for scoreboard -- cgit