diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_consolecmds.c | 16 | ||||
-rw-r--r-- | src/cgame/cg_draw.c | 4 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 1 | ||||
-rw-r--r-- | src/game/bg_lib.c | 2 | ||||
-rw-r--r-- | src/game/bg_lib.h | 27 | ||||
-rw-r--r-- | src/game/bg_misc.c | 6 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 46 | ||||
-rw-r--r-- | src/game/bg_public.h | 23 | ||||
-rw-r--r-- | src/game/g_active.c | 7 | ||||
-rw-r--r-- | src/game/g_cmds.c | 143 | ||||
-rw-r--r-- | src/qcommon/msg.c | 4 | ||||
-rw-r--r-- | src/ui/ui_main.c | 2 |
12 files changed, 136 insertions, 145 deletions
diff --git a/src/cgame/cg_consolecmds.c b/src/cgame/cg_consolecmds.c index 47aadece..e1354f37 100644 --- a/src/cgame/cg_consolecmds.c +++ b/src/cgame/cg_consolecmds.c @@ -29,21 +29,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -void CG_TargetCommand_f( void ) -{ - int targetNum; - char test[ 4 ]; - - targetNum = CG_CrosshairPlayer( ); - if( !targetNum ) - return; - - trap_Argv( 1, test, 4 ); - trap_SendConsoleCommand( va( "gc %i %i", targetNum, atoi( test ) ) ); -} - - - /* ================= CG_SizeUp_f @@ -214,7 +199,6 @@ static consoleCommand_t commands[ ] = { "weapon", CG_Weapon_f }, { "tell_target", CG_TellTarget_f }, { "tell_attacker", CG_TellAttacker_f }, - { "tcmd", CG_TargetCommand_f }, { "testPS", CG_TestPS_f }, { "destroyTestPS", CG_DestroyTestPS_f }, { "testTS", CG_TestTS_f }, diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index bdff5eed..a2e5fc91 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -2175,7 +2175,6 @@ static void CG_DrawCrosshair( rectDef_t *rect, vec4_t color ) return; if( ( cg.snap->ps.persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) || - ( cg.snap->ps.stats[ STAT_STATE ] & SS_INFESTING ) || ( cg.snap->ps.stats[ STAT_STATE ] & SS_HOVELING ) ) return; @@ -3054,8 +3053,7 @@ static void CG_Draw2D( void ) else menu = Menus_FindByName( BG_ClassConfig( cg.predictedPlayerState.stats[ STAT_CLASS ] )->hudName ); - if( !( cg.snap->ps.stats[ STAT_STATE ] & SS_INFESTING ) && - !( cg.snap->ps.stats[ STAT_STATE ] & SS_HOVELING ) && menu && + if( menu && !( cg.snap->ps.stats[ STAT_STATE ] & SS_HOVELING ) && ( cg.snap->ps.stats[ STAT_HEALTH ] > 0 ) ) { CG_DrawBuildableStatus( ); diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 55a0a2ff..ac0f6a14 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -1219,7 +1219,6 @@ void CG_AddViewWeapon( playerState_t *ps ) cent = &cg.predictedPlayerEntity; // &cg_entities[cg.snap->ps.clientNum]; if( ( ps->persistant[PERS_SPECSTATE] != SPECTATOR_NOT ) || - ( ps->stats[ STAT_STATE ] & SS_INFESTING ) || ( ps->stats[ STAT_STATE ] & SS_HOVELING ) ) return; diff --git a/src/game/bg_lib.c b/src/game/bg_lib.c index 7524a53e..328af322 100644 --- a/src/game/bg_lib.c +++ b/src/game/bg_lib.c @@ -76,7 +76,7 @@ static char* med3(char *, char *, char *, cmp_t *); static void swapfunc(char *, char *, int, int); #ifndef min -#define min(a, b) (a) < (b) ? a : b +#define min(a, b) ((a) < (b) ? a : b) #endif /* diff --git a/src/game/bg_lib.h b/src/game/bg_lib.h index 6225ce99..b872709a 100644 --- a/src/game/bg_lib.h +++ b/src/game/bg_lib.h @@ -40,21 +40,28 @@ typedef char * va_list; #define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) ) #define va_end(ap) ( ap = (va_list)0 ) -#define CHAR_BIT 8 /* number of bits in a char */ -#define SCHAR_MIN (-128) /* minimum signed char value */ -#define SCHAR_MAX 127 /* maximum signed char value */ -#define UCHAR_MAX 0xff /* maximum unsigned char value */ +#define CHAR_BIT 8 /* number of bits in a char */ +#define SCHAR_MAX 0x7f /* maximum signed char value */ +#define SCHAR_MIN (-SCHAR_MAX - 1)/* minimum signed char value */ +#define UCHAR_MAX 0xff /* maximum unsigned char value */ -#define SHRT_MIN (-32768) /* minimum (signed) short value */ -#define SHRT_MAX 32767 /* maximum (signed) short value */ +#define SHRT_MAX 0x7fff /* maximum (signed) short value */ +#define SHRT_MIN (-SHRT_MAX - 1) /* minimum (signed) short value */ #define USHRT_MAX 0xffff /* maximum unsigned short value */ -#define INT_MIN (-2147483647 - 1) /* minimum (signed) int value */ -#define INT_MAX 2147483647 /* maximum (signed) int value */ +#define INT_MAX 0x7fffffff /* maximum (signed) int value */ +#define INT_MIN (-INT_MAX - 1) /* minimum (signed) int value */ #define UINT_MAX 0xffffffff /* maximum unsigned int value */ -#define LONG_MIN (-2147483647L - 1) /* minimum (signed) long value */ -#define LONG_MAX 2147483647L /* maximum (signed) long value */ +#define LONG_MAX 0x7fffffffL /* maximum (signed) long value */ +#define LONG_MIN (-LONG_MAX - 1) /* minimum (signed) long value */ #define ULONG_MAX 0xffffffffUL /* maximum unsigned long value */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed long int32_t; +typedef unsigned long uint32_t; + #define isalnum(c) (isalpha(c) || isdigit(c)) #define isalpha(c) (isupper(c) || islower(c)) #define isascii(c) ((c) > 0 && (c) <= 0x7f) diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 470e8784..27cecf77 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -2960,8 +2960,6 @@ void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean // have to get the surfNormal through somehow... VectorCopy( ps->grapplePoint, s->angles2 ); - if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) - s->eFlags |= EF_WALLCLIMBCEILING; s->loopSound = ps->loopSound; s->generic1 = ps->generic1; @@ -3072,8 +3070,6 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s // have to get the surfNormal through somehow... VectorCopy( ps->grapplePoint, s->angles2 ); - if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) - s->eFlags |= EF_WALLCLIMBCEILING; s->loopSound = ps->loopSound; s->generic1 = ps->generic1; @@ -3288,7 +3284,7 @@ void BG_GetClientNormal( const playerState_t *ps, vec3_t normal ) { if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) { - if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) + if( ps->eFlags & EF_WALLCLIMBCEILING ) VectorSet( normal, 0.0f, 0.0f, -1.0f ); else VectorCopy( ps->grapplePoint, normal ); diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 745bca4e..dfcac8df 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -88,13 +88,25 @@ void PM_AddTouchEnt( int entityNum ) } /* +=============== +PM_Paralyzed +=============== +*/ +qboolean PM_Paralyzed( playerState_t *ps ) +{ + return ( ps->pm_type == PM_DEAD || + ps->pm_type == PM_FREEZE || + ps->pm_type == PM_INTERMISSION ); +} + +/* =================== PM_StartTorsoAnim =================== */ void PM_StartTorsoAnim( int anim ) { - if( pm->ps->pm_type >= PM_DEAD ) + if( PM_Paralyzed( pm->ps ) ) return; pm->ps->torsoAnim = ( ( pm->ps->torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) @@ -108,7 +120,7 @@ PM_StartWeaponAnim */ static void PM_StartWeaponAnim( int anim ) { - if( pm->ps->pm_type >= PM_DEAD ) + if( PM_Paralyzed( pm->ps ) ) return; pm->ps->weaponAnim = ( ( pm->ps->weaponAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) @@ -122,7 +134,7 @@ PM_StartLegsAnim */ static void PM_StartLegsAnim( int anim ) { - if( pm->ps->pm_type >= PM_DEAD ) + if( PM_Paralyzed( pm->ps ) ) return; //legsTimer is clamped too tightly for nonsegmented models @@ -2093,7 +2105,7 @@ static void PM_GroundClimbTrace( void ) { CrossProduct( surfNormal, trace.plane.normal, pm->ps->grapplePoint ); VectorNormalize( pm->ps->grapplePoint ); - pm->ps->stats[ STAT_STATE ] |= SS_WALLCLIMBINGCEILING; + pm->ps->eFlags |= EF_WALLCLIMBCEILING; } //transition from ceiling to wall @@ -2117,7 +2129,7 @@ static void PM_GroundClimbTrace( void ) { //so we know what surface we're stuck to VectorCopy( trace.plane.normal, pm->ps->grapplePoint ); - pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBINGCEILING; + pm->ps->eFlags &= ~EF_WALLCLIMBCEILING; } //IMPORTANT: break out of the for loop if we've hit something @@ -2140,7 +2152,7 @@ static void PM_GroundClimbTrace( void ) pm->ps->eFlags &= ~EF_WALLCLIMB; //just transided from ceiling to floor... apply delta correction - if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) + if( pm->ps->eFlags & EF_WALLCLIMBCEILING ) { vec3_t forward, rotated, angles; @@ -2152,7 +2164,7 @@ static void PM_GroundClimbTrace( void ) pm->ps->delta_angles[ YAW ] -= ANGLE2SHORT( angles[ YAW ] - pm->ps->viewangles[ YAW ] ); } - pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBINGCEILING; + pm->ps->eFlags &= ~EF_WALLCLIMBCEILING; //we get very bizarre effects if we don't do this :0 VectorCopy( refNormal, pm->ps->grapplePoint ); @@ -2224,7 +2236,7 @@ static void PM_GroundTrace( void ) } //just transided from ceiling to floor... apply delta correction - if( pm->ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) + if( pm->ps->eFlags & EF_WALLCLIMBCEILING ) { vec3_t forward, rotated, angles; @@ -2238,8 +2250,7 @@ static void PM_GroundTrace( void ) } pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBING; - pm->ps->stats[ STAT_STATE ] &= ~SS_WALLCLIMBINGCEILING; - pm->ps->eFlags &= ~EF_WALLCLIMB; + pm->ps->eFlags &= ~( EF_WALLCLIMB | EF_WALLCLIMBCEILING ); point[ 0 ] = pm->ps->origin[ 0 ]; point[ 1 ] = pm->ps->origin[ 1 ]; @@ -2842,8 +2853,8 @@ static void PM_Weapon( void ) qboolean attack3 = qfalse; // Ignore weapons in some cases - if( pm->ps->persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT || - ( pm->ps->stats[ STAT_STATE ] & ( SS_INFESTING | SS_HOVELING ) ) ) + if( pm->ps->persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT || + ( pm->ps->stats[ STAT_STATE ] & SS_HOVELING ) ) return; // Check for dead player @@ -3407,6 +3418,9 @@ PM_Animate */ static void PM_Animate( void ) { + if( PM_Paralyzed( pm->ps ) ) + return; + if( pm->cmd.buttons & BUTTON_GESTURE ) { if( !( pm->ps->persistant[ PERS_STATE ] & PS_NONSEGMODEL ) ) @@ -3492,7 +3506,7 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) vec3_t axis[ 3 ], rotaxis[ 3 ]; vec3_t tempang; - if( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPINTERMISSION ) + if( ps->pm_type == PM_INTERMISSION ) return; // no view changes at all if( ps->pm_type != PM_SPECTATOR && ps->stats[ STAT_HEALTH ] <= 0 ) @@ -3525,7 +3539,7 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) if( !( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING ) || !BG_RotateAxis( ps->grapplePoint, axis, rotaxis, qfalse, - ps->stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) ) + ps->eFlags & EF_WALLCLIMBCEILING ) ) AxisCopy( axis, rotaxis ); //convert the new axis back to angles @@ -3683,7 +3697,7 @@ void PmoveSingle( pmove_t *pmove ) else if( pm->cmd.forwardmove > 0 || ( pm->cmd.forwardmove == 0 && pm->cmd.rightmove ) ) pm->ps->pm_flags &= ~PMF_BACKWARDS_RUN; - if( pm->ps->pm_type >= PM_DEAD ) + if( PM_Paralyzed( pm->ps ) ) { pm->cmd.forwardmove = 0; pm->cmd.rightmove = 0; @@ -3711,7 +3725,7 @@ void PmoveSingle( pmove_t *pmove ) if( pm->ps->pm_type == PM_FREEZE) return; // no movement at all - if( pm->ps->pm_type == PM_INTERMISSION || pm->ps->pm_type == PM_SPINTERMISSION ) + if( pm->ps->pm_type == PM_INTERMISSION ) return; // no movement at all // set watertype, and waterlevel diff --git a/src/game/bg_public.h b/src/game/bg_public.h index f1400522..ca61f135 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -114,7 +114,6 @@ typedef enum PM_DEAD, // no acceleration or turning, but free falling PM_FREEZE, // stuck in place with no control PM_INTERMISSION, // no movement or status bar - PM_SPINTERMISSION // no movement or status bar } pmtype_t; typedef enum @@ -229,18 +228,16 @@ typedef enum #define SCA_WALLJUMPER 0x00000040 #define SS_WALLCLIMBING 0x00000001 -#define SS_WALLCLIMBINGCEILING 0x00000002 -#define SS_CREEPSLOWED 0x00000004 -#define SS_SPEEDBOOST 0x00000008 -#define SS_INFESTING 0x00000010 -#define SS_GRABBED 0x00000020 -#define SS_BLOBLOCKED 0x00000040 -#define SS_POISONED 0x00000080 -#define SS_HOVELING 0x00000100 -#define SS_BOOSTED 0x00000200 -#define SS_SLOWLOCKED 0x00000400 -#define SS_BOOSTEDWARNING 0x00000800 // booster poison is running out -#define SS_CHARGING 0x00001000 +#define SS_CREEPSLOWED 0x00000002 +#define SS_SPEEDBOOST 0x00000004 +#define SS_GRABBED 0x00000008 +#define SS_BLOBLOCKED 0x00000010 +#define SS_POISONED 0x00000020 +#define SS_HOVELING 0x00000040 +#define SS_BOOSTED 0x00000080 +#define SS_SLOWLOCKED 0x00000100 +#define SS_BOOSTEDWARNING 0x00000200 // booster poison is running out +#define SS_CHARGING 0x00000400 #define SS_HEALING_ACTIVE 0x00002000 // medistat for Humans, creep for Aliens #define SS_HEALING_2X 0x00004000 // medkit or double healing rate (for HUD) #define SS_HEALING_3X 0x00008000 // triple healing rate (for HUD) diff --git a/src/game/g_active.c b/src/game/g_active.c index c5f1bd8e..8b3b79fc 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -360,7 +360,6 @@ void G_TouchTriggers( gentity_t *ent ) // ignore most entities if a spectator if( ( ent->client->sess.spectatorState != SPECTATOR_NOT ) || - ( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) || ( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) ) { if( hit->s.eType != ET_TELEPORT_TRIGGER && @@ -1406,8 +1405,7 @@ void ClientThink_real( gentity_t *ent ) client->ps.pm_type = PM_NOCLIP; else if( client->ps.stats[ STAT_HEALTH ] <= 0 ) client->ps.pm_type = PM_DEAD; - else if( client->ps.stats[ STAT_STATE ] & SS_INFESTING || - client->ps.stats[ STAT_STATE ] & SS_HOVELING ) + else if( client->ps.stats[ STAT_STATE ] & SS_HOVELING ) client->ps.pm_type = PM_FREEZE; else if( client->ps.stats[ STAT_STATE ] & SS_BLOBLOCKED || client->ps.stats[ STAT_STATE ] & SS_GRABBED ) @@ -1538,8 +1536,7 @@ void ClientThink_real( gentity_t *ent ) if( pm.ps->pm_type == PM_DEAD ) pm.tracemask = MASK_DEADSOLID; - if( pm.ps->stats[ STAT_STATE ] & SS_INFESTING || - pm.ps->stats[ STAT_STATE ] & SS_HOVELING ) + if( pm.ps->stats[ STAT_STATE ] & SS_HOVELING ) pm.tracemask = MASK_DEADSOLID; else pm.tracemask = MASK_PLAYERSOLID; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 3214ce3d..87fa5777 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -500,9 +500,6 @@ Cmd_Kill_f */ void Cmd_Kill_f( gentity_t *ent ) { - if( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) - return; - if( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) { trap_SendServerCommand( ent-g_entities, "print \"Leave the hovel first (use your destroy key)\n\"" ); @@ -1626,7 +1623,6 @@ void Cmd_Class_f( gentity_t *ent ) return; if( ent->client->pers.teamSelection == TEAM_ALIENS && - !( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) && !( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) ) { if( newClass == PCL_NONE ) @@ -1640,8 +1636,7 @@ void Cmd_Class_f( gentity_t *ent ) { int cost; - if( ( ent->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBING ) || - ( ent->client->ps.stats[ STAT_STATE ] & SS_WALLCLIMBINGCEILING ) ) + if( ent->client->ps.eFlags & EF_WALLCLIMB ) { G_TriggerMenu( clientNum, MN_A_EVOLVEWALLWALK ); return; @@ -1753,20 +1748,18 @@ void Cmd_Destroy_f( gentity_t *ent ) if( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) G_Damage( ent->client->hovel, ent, ent, forward, ent->s.origin, 10000, 0, MOD_SUICIDE ); - if( !( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) ) - { - AngleVectors( ent->client->ps.viewangles, forward, NULL, NULL ); - VectorMA( ent->client->ps.origin, 100, forward, end ); + AngleVectors( ent->client->ps.viewangles, forward, NULL, NULL ); + VectorMA( ent->client->ps.origin, 100, forward, end ); - trap_Trace( &tr, ent->client->ps.origin, NULL, NULL, end, ent->s.number, MASK_PLAYERSOLID ); - traceEnt = &g_entities[ tr.entityNum ]; + trap_Trace( &tr, ent->client->ps.origin, NULL, NULL, end, ent->s.number, MASK_PLAYERSOLID ); + traceEnt = &g_entities[ tr.entityNum ]; - if( tr.fraction < 1.0f && - ( traceEnt->s.eType == ET_BUILDABLE ) && - ( traceEnt->buildableTeam == ent->client->pers.teamSelection ) && - ( ( ent->client->ps.weapon >= WP_ABUILD ) && - ( ent->client->ps.weapon <= WP_HBUILD ) ) ) - { + if( tr.fraction < 1.0f && + ( traceEnt->s.eType == ET_BUILDABLE ) && + ( traceEnt->buildableTeam == ent->client->pers.teamSelection ) && + ( ( ent->client->ps.weapon >= WP_ABUILD ) && + ( ent->client->ps.weapon <= WP_HBUILD ) ) ) + { // Always let the builder prevent the explosion if( traceEnt->health <= 0 ) { @@ -1774,70 +1767,69 @@ void Cmd_Destroy_f( gentity_t *ent ) return; } - // Cancel deconstruction - if( g_markDeconstruct.integer && traceEnt->deconstruct ) - { - traceEnt->deconstruct = qfalse; - return; - } + // Cancel deconstruction + if( g_markDeconstruct.integer && traceEnt->deconstruct ) + { + traceEnt->deconstruct = qfalse; + return; + } - // Prevent destruction of the last spawn - if( !g_markDeconstruct.integer && !g_cheats.integer ) + // Prevent destruction of the last spawn + if( !g_markDeconstruct.integer && !g_cheats.integer ) + { + if( ent->client->pers.teamSelection == TEAM_ALIENS && + traceEnt->s.modelindex == BA_A_SPAWN ) { - if( ent->client->pers.teamSelection == TEAM_ALIENS && - traceEnt->s.modelindex == BA_A_SPAWN ) - { - if( level.numAlienSpawns <= 1 ) + if( level.numAlienSpawns <= 1 ) { G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN ); - return; + return; } - } - else if( ent->client->pers.teamSelection == TEAM_HUMANS && - traceEnt->s.modelindex == BA_H_SPAWN ) - { - if( level.numHumanSpawns <= 1 ) + } + else if( ent->client->pers.teamSelection == TEAM_HUMANS && + traceEnt->s.modelindex == BA_H_SPAWN ) + { + if( level.numHumanSpawns <= 1 ) { G_TriggerMenu( ent->client->ps.clientNum, MN_B_LASTSPAWN ); - return; + return; } - } } + } - // Don't allow destruction of hovel with granger inside - if( traceEnt->s.modelindex == BA_A_HOVEL && traceEnt->active ) - return; + // Don't allow destruction of hovel with granger inside + if( traceEnt->s.modelindex == BA_A_HOVEL && traceEnt->active ) + return; - // Don't allow destruction of buildables that cannot be rebuilt - if( G_TimeTilSuddenDeath( ) <= 0 ) - return; + // Don't allow destruction of buildables that cannot be rebuilt + if( G_TimeTilSuddenDeath( ) <= 0 ) + return; + + if( !g_markDeconstruct.integer && ent->client->ps.stats[ STAT_MISC ] > 0 ) + { + G_AddEvent( ent, EV_BUILD_DELAY, ent->client->ps.clientNum ); + return; + } - if( !g_markDeconstruct.integer && ent->client->ps.stats[ STAT_MISC ] > 0 ) + if( g_markDeconstruct.integer ) + { + if( !deconstruct ) + G_Damage( traceEnt, ent, ent, forward, tr.endpos, ent->health, 0, MOD_SUICIDE ); + else if( g_markDeconstruct.integer ) { - G_AddEvent( ent, EV_BUILD_DELAY, ent->client->ps.clientNum ); - return; + traceEnt->deconstruct = qtrue; // Mark buildable for deconstruction + traceEnt->deconstructTime = level.time; } - - if( g_markDeconstruct.integer ) + else { - if( !deconstruct ) - G_Damage( traceEnt, ent, ent, forward, tr.endpos, ent->health, 0, MOD_SUICIDE ); - else if( g_markDeconstruct.integer ) - { - traceEnt->deconstruct = qtrue; // Mark buildable for deconstruction - traceEnt->deconstructTime = level.time; - } - else - { - G_LogDestruction( traceEnt, ent, MOD_DECONSTRUCT ); - G_FreeEntity( traceEnt ); - } + G_LogDestruction( traceEnt, ent, MOD_DECONSTRUCT ); + G_FreeEntity( traceEnt ); + } - if( !g_cheats.integer ) - { - ent->client->ps.stats[ STAT_MISC ] += - BG_Buildable( traceEnt->s.modelindex )->buildTime; - } + if( !g_cheats.integer ) + { + ent->client->ps.stats[ STAT_MISC ] += + BG_Buildable( traceEnt->s.modelindex )->buildTime; } } } @@ -2339,7 +2331,6 @@ void Cmd_Build_f( gentity_t *ent ) if( buildable != BA_NONE && ( ( 1 << ent->client->ps.weapon ) & BG_Buildable( buildable )->buildWeapon ) && - !( ent->client->ps.stats[ STAT_STATE ] & SS_INFESTING ) && !( ent->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) && BG_BuildableIsAllowed( buildable ) && ( ( team == TEAM_ALIENS && BG_BuildableAllowedInStage( buildable, g_alienStage.integer ) ) || @@ -2410,13 +2401,23 @@ Cmd_Reload_f void Cmd_Reload_f( gentity_t *ent ) { playerState_t *ps = &ent->client->ps; + int ammo; // weapon doesn't ever need reloading if( BG_Weapon( ps->weapon )->infiniteAmmo ) return; + if( ps->clips <= 0 ) + return; + + if( BG_Weapon( ps->weapon )->usesEnergy && + BG_InventoryContainsUpgrade( UP_BATTPACK, ps->stats ) ) + ammo = BG_Weapon( ps->weapon )->maxAmmo * BATTPACK_MODIFIER; + else + ammo = BG_Weapon( ps->weapon )->maxAmmo; + // don't reload when full - if( ps->ammo == BG_Weapon( ps->weapon )->maxAmmo ) + if( ps->ammo >= ammo ) return; // the animation, ammo refilling etc. is handled by PM_Weapon @@ -2485,9 +2486,8 @@ void G_StopFollowing( gentity_t *ent ) ent->client->sess.spectatorClient = -1; ent->client->ps.pm_flags &= ~PMF_FOLLOW; ent->client->ps.stats[ STAT_STATE ] &= ~SS_WALLCLIMBING; - ent->client->ps.stats[ STAT_STATE ] &= ~SS_WALLCLIMBINGCEILING; ent->client->ps.stats[ STAT_VIEWLOCK ] = 0; - ent->client->ps.eFlags &= ~EF_WALLCLIMB; + ent->client->ps.eFlags &= ~( EF_WALLCLIMB | EF_WALLCLIMBCEILING ); ent->client->ps.viewangles[ PITCH ] = 0.0f; ent->client->ps.clientNum = ent - g_entities; @@ -2514,9 +2514,8 @@ void G_FollowLockView( gentity_t *ent ) ent->client->ps.pm_flags &= ~PMF_FOLLOW; ent->client->ps.stats[ STAT_TEAM ] = ent->client->pers.teamSelection; ent->client->ps.stats[ STAT_STATE ] &= ~SS_WALLCLIMBING; - ent->client->ps.stats[ STAT_STATE ] &= ~SS_WALLCLIMBINGCEILING; ent->client->ps.stats[ STAT_VIEWLOCK ] = 0; - ent->client->ps.eFlags &= ~EF_WALLCLIMB; + ent->client->ps.eFlags &= ~( EF_WALLCLIMB | EF_WALLCLIMBCEILING ); ent->client->ps.eFlags ^= EF_TELEPORT_BIT; ent->client->ps.viewangles[ PITCH ] = 0.0f; diff --git a/src/qcommon/msg.c b/src/qcommon/msg.c index 37c61c31..837c3696 100644 --- a/src/qcommon/msg.c +++ b/src/qcommon/msg.c @@ -1145,8 +1145,8 @@ netField_t playerStateFields[] = { PSF(weaponstate), 4 }, { PSF(eFlags), 16 }, { PSF(externalEvent), 10 }, -{ PSF(gravity), 16 }, -{ PSF(speed), 16 }, +{ PSF(gravity), -16 }, +{ PSF(speed), -16 }, { PSF(delta_angles[1]), 16 }, { PSF(externalEventParm), 8 }, { PSF(viewheight), -8 }, diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index df295a4e..dc483add 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -122,7 +122,7 @@ static cvarTable_t cvarTable[ ] = { &ui_serverStatusTimeOut, "ui_serverStatusTimeOut", "7000", CVAR_ARCHIVE}, { &ui_textWrapCache, "ui_textWrapCache", "1", CVAR_ARCHIVE }, { &ui_developer, "ui_developer", "0", CVAR_ARCHIVE | CVAR_CHEAT }, - { &ui_emoticons, "ui_emoticons", "1", CVAR_LATCH | CVAR_ARCHIVE }, + { &ui_emoticons, "cg_emoticons", "1", CVAR_LATCH | CVAR_ARCHIVE }, }; static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] ); |