Fixed some of the new persistant stuff + sniper spread
This commit is contained in:
Victor Chow 2001-06-11 23:02:21 +00:00
parent 93267c42cc
commit 725f2284fe
5 changed files with 50 additions and 16 deletions

View file

@ -581,8 +581,12 @@ void ClientTimerActions( gentity_t *ent, int msec ) {
//Blaze: Do bandaging stuff
if (ent->client->bleedtick > 1)
{
G_Printf("Bleedtick getting lowerd by one(%d)\n",client->timeResidual);
G_Printf("Bleedtick (%d) getting lowered by one (%d)\n", ent->client->bleedtick, client->timeResidual);
ent->client->bleedtick--;
//Elder: added
if (ent->client->bleedtick == 2) {
ent->client->ps.stats[STAT_RQ3] &= !RQ3_LEGDAMAGE;
}
}
else if (ent->client->bleedtick == 1)
{
@ -883,6 +887,8 @@ void ThrowWeapon( gentity_t *ent )
return;
}
//Elder: have to add a reloading case
weap = 0;
if (client->ps.stats[STAT_UNIQUEWEAPONS] > 0)
{

View file

@ -989,6 +989,12 @@ void ClientBegin( int clientNum ) {
memset( &client->ps, 0, sizeof( client->ps ) );
client->ps.eFlags = flags;
//Elder: added to initialize weaponmodes
client->ps.persistant[PERS_WEAPONMODES] |= RQ3_GRENSHORT; //set to short range
client->ps.persistant[PERS_WEAPONMODES] |= RQ3_KNIFEMODE; //set to slash attack
//Elder: debug
//G_Printf("In clientbegin- PERS_WEAPONMODES: %d\n", ent->client->ps.persistant[PERS_WEAPONMODES]);
// locate ent at a spawn point
ClientSpawn( ent );
@ -1094,6 +1100,7 @@ void ClientSpawn(gentity_t *ent) {
// savedAreaBits = client->areabits;
accuracy_hits = client->accuracy_hits;
accuracy_shots = client->accuracy_shots;
for ( i = 0 ; i < MAX_PERSISTANT ; i++ ) {
persistant[i] = client->ps.persistant[i];
}
@ -1223,7 +1230,8 @@ void ClientSpawn(gentity_t *ent) {
client->zoomed=0;
//Elder: knife reset/initialize
client->ps.persistant[PERS_WEAPONMODES] &= !RQ3_KNIFEMODE;
//Elder: removed - set in ClientBegin
//client->ps.persistant[PERS_WEAPONMODES] &= !RQ3_KNIFEMODE;
//Elder: reset isBandaging flag
client->isBandaging = qfalse;
@ -1262,6 +1270,9 @@ void ClientSpawn(gentity_t *ent) {
trap_LinkEntity( ent );
}
//Elder: debug
//G_Printf("Just after respawn- PERS_WEAPONMODES: %d\n", ent->client->ps.persistant[PERS_WEAPONMODES]);
// run the presend to set anything else
ClientEndFrame( ent );

View file

@ -1611,7 +1611,8 @@ void Cmd_Bandage (gentity_t *ent)
ent->client->bleedtick = 4;
//Elder: added
ent->client->isBandaging = qtrue;
ent->client->ps.stats[STAT_RQ3] &= !RQ3_LEGDAMAGE;
//Elder: moved to g_active where it will be unset after 2 bleedticks
//ent->client->ps.stats[STAT_RQ3] &= !RQ3_LEGDAMAGE;
}
else
{
@ -1865,6 +1866,10 @@ void toggleSemi(gentity_t *ent){
/* Hawkins. Reaction weapon command */
void Cmd_Weapon(gentity_t *ent)
{
//Elder: debug code
//G_Printf("PERS_WEAPONMODES: %d\n", ent->client->ps.persistant[PERS_WEAPONMODES]);
//Elder: added brackets, and-ops and not-ops instead of logical ops
switch(ent->s.weapon){
case WP_SSG3000:
// zoom is done by client. zoom 3 levels, then zoom out
@ -1884,7 +1889,7 @@ void Cmd_Weapon(gentity_t *ent)
// semiauto toggle (increase accuracy)
if ((ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_MK23MODE) == RQ3_MK23MODE)
{
ent->client->ps.persistant[PERS_WEAPONMODES] &= !RQ3_MK23MODE;
ent->client->ps.persistant[PERS_WEAPONMODES] &= ~RQ3_MK23MODE;
trap_SendServerCommand( ent-g_entities, va("print \"Switched to full automatic.\n\""));
}
else
@ -1897,7 +1902,7 @@ void Cmd_Weapon(gentity_t *ent)
// 3rb/full auto toggle
if ((ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_M4MODE) == RQ3_M4MODE)
{
ent->client->ps.persistant[PERS_WEAPONMODES] &= !RQ3_M4MODE;
ent->client->ps.persistant[PERS_WEAPONMODES] &= ~RQ3_M4MODE;
trap_SendServerCommand( ent-g_entities, va("print \"Switched to full automatic.\n\""));
}
else
@ -1910,7 +1915,7 @@ void Cmd_Weapon(gentity_t *ent)
// 3rb/full auto toggle
if ((ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_MP5MODE) == RQ3_MP5MODE)
{
ent->client->ps.persistant[PERS_WEAPONMODES] &= !RQ3_MP5MODE;
ent->client->ps.persistant[PERS_WEAPONMODES] &= ~RQ3_MP5MODE;
trap_SendServerCommand( ent-g_entities, va("print \"Switched to full automatic.\n\""));
}
else
@ -1924,7 +1929,7 @@ void Cmd_Weapon(gentity_t *ent)
if ((ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE) == RQ3_KNIFEMODE)
{
//Elder: added
ent->client->ps.persistant[PERS_WEAPONMODES] &= !RQ3_KNIFEMODE;
ent->client->ps.persistant[PERS_WEAPONMODES] &= ~RQ3_KNIFEMODE;
trap_SendServerCommand( ent-g_entities, va("print \"Switched to throwing.\n\""));
}
else
@ -1945,25 +1950,37 @@ void Cmd_Weapon(gentity_t *ent)
break;
case WP_GRENADE:
// short, medium, long throws
if (ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENSHORT == RQ3_GRENSHORT && ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENMED == RQ3_GRENMED)
if ( (ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENSHORT) == RQ3_GRENSHORT &&
(ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENMED) == RQ3_GRENMED)
{//Going into Short
ent->client->ps.persistant[PERS_WEAPONMODES] |= RQ3_GRENSHORT; //Set the short flag
ent->client->ps.persistant[PERS_WEAPONMODES] |= !RQ3_GRENMED; //unset the med flag
ent->client->ps.persistant[PERS_WEAPONMODES] &= ~RQ3_GRENMED; //unset the med flag
trap_SendServerCommand( ent-g_entities, va("print \"Grenade set for short range throw.\n\""));
}
else if (ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENSHORT == RQ3_GRENSHORT)
else if ( (ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENSHORT) == RQ3_GRENSHORT)
{//Going into Med
ent->client->ps.persistant[PERS_WEAPONMODES] |= !RQ3_GRENSHORT; //unset the short flag
ent->client->ps.persistant[PERS_WEAPONMODES] &= ~RQ3_GRENSHORT; //unset the short flag
ent->client->ps.persistant[PERS_WEAPONMODES] |= RQ3_GRENMED; //Set the med flag
trap_SendServerCommand( ent-g_entities, va("print \"Grenade set for medium range throw.\n\""));
}
else if (ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENMED == RQ3_GRENMED)
else if ( (ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENMED) == RQ3_GRENMED)
{//Going into Long
ent->client->ps.persistant[PERS_WEAPONMODES] |= RQ3_GRENSHORT; //Set the short flag
ent->client->ps.persistant[PERS_WEAPONMODES] |= RQ3_GRENMED; //Set the med flag
trap_SendServerCommand( ent-g_entities, va("print \"Grenade set for long range throw.\n\""));
}
//Elder: added
else {
G_Printf("Cmd_Weapon_f: Received bad grenade toggle\n");
}
/* Elder: debugging code
G_Printf("Grenade toggle- Short: %d, Medium: %d, Long: %d\n",
(ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENSHORT) == RQ3_GRENSHORT,
(ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENMED) == RQ3_GRENMED,
(ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENSHORT) == RQ3_GRENSHORT &&
(ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_GRENMED) == RQ3_GRENMED);
*/
break;
default:
break;

View file

@ -493,7 +493,6 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
if ( self->client )
{
// Hawkins put spread back and zoom out
//Elder: removed
self->client->zoomed = 0;
self->client->bleeding = 0;
//targ->client->bleedcount = 0;

View file

@ -1025,7 +1025,8 @@ void Weapon_SSG3000_Fire(gentity_t *ent)
{
//Elder: Don't print - will broadcast to server
//G_Printf("Zoom Level: %d\n", ent->client->zoomed);
Bullet_Fire( ent, ( ent->client->zoomed?0:SNIPER_SPREAD), SNIPER_DAMAGE, MOD_SNIPER);
//Elder: changed to use RQ3Spread as well
Bullet_Fire( ent, ( ent->client->zoomed? 0:RQ3Spread(ent, SNIPER_SPREAD)), SNIPER_DAMAGE, MOD_SNIPER);
}