From 1cf37f2ff540fdd0b3473cf4c3bbbf6ae7445d95 Mon Sep 17 00:00:00 2001 From: Victor Chow Date: Mon, 12 Nov 2001 09:01:21 +0000 Subject: [PATCH] Elder: Pre- 0-18-00 VMs Server-Side --- reaction/game/g_active.c | 2 ++ reaction/game/g_cmds.c | 15 ++++----------- reaction/game/g_items.c | 38 ++++++++++++++++++++++++++++---------- reaction/game/g_misc.c | 2 +- reaction/game/g_weapon.c | 4 ++-- 5 files changed, 37 insertions(+), 24 deletions(-) diff --git a/reaction/game/g_active.c b/reaction/game/g_active.c index ba47fdeb..d5c7b70c 100644 --- a/reaction/game/g_active.c +++ b/reaction/game/g_active.c @@ -977,6 +977,8 @@ int ThrowWeapon( gentity_t *ent, qboolean forceThrow ) xr_drop= dropWeapon( ent, xr_item, 0, FL_DROPPED_ITEM | FL_THROWN_ITEM ); xr_drop->count= -1; // XRAY FMJ 0 is already taken, -1 means no ammo + // remember who dropped you, child! + xr_drop->s.otherEntityNum = client->ps.clientNum; client->uniqueWeapons--; } diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index 1b51ed9e..8bb7294a 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -1706,9 +1706,11 @@ void Cmd_Bandage (gentity_t *ent) ^ ANIM_TOGGLEBIT ) | WP_ANIM_DISARM; } - //Elder: always lower the player model + //Elder: always lower the player model -- removed + /* ent->client->ps.torsoAnim = ( ( ent->client->ps.torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | TORSO_DROP; + */ ent->client->ps.weaponTime += BLEED_BANDAGE_TIME; @@ -2152,16 +2154,7 @@ void Cmd_OpenDoor(gentity_t *ent) } } -// Hawkisn todo: Must be set on a per-weapon basis, not a per-user basis. -/* Homer: This function is useful only if it applies to all weapons, which is not the case here. -void toggleSemi(gentity_t *ent){ - ent->client->semi = !(ent->client->semi); - if(ent->client->semi) - trap_SendServerCommand( ent-g_entities, va("print \"Switched to semi-automatic.\n\"")); - else - trap_SendServerCommand( ent-g_entities, va("print \"Switched to full automatic.\n\"")); -} -*/ + /* Hawkins. Reaction weapon command */ void Cmd_Weapon(gentity_t *ent) { diff --git a/reaction/game/g_items.c b/reaction/game/g_items.c index f8d3a3b3..a4f17f74 100644 --- a/reaction/game/g_items.c +++ b/reaction/game/g_items.c @@ -361,22 +361,22 @@ int Pickup_Weapon (gentity_t *ent, gentity_t *other, int bandolierFactor) { break; case WP_AKIMBO: //Elder: Should not need to come here - ammotoadd= RQ3_AKIMBO_AMMO; + ammotoadd = RQ3_AKIMBO_AMMO; break; case WP_MP5: - ammotoadd= RQ3_MP5_AMMO; + ammotoadd = RQ3_MP5_AMMO; other->client->uniqueWeapons++; break; case WP_M4: - ammotoadd= RQ3_M4_AMMO; + ammotoadd = RQ3_M4_AMMO; other->client->uniqueWeapons++; break; case WP_M3: - ammotoadd= RQ3_M3_AMMO; + ammotoadd = RQ3_M3_AMMO; other->client->uniqueWeapons++; break; case WP_HANDCANNON: - ammotoadd= RQ3_HANDCANNON_AMMO; + ammotoadd = RQ3_HANDCANNON_AMMO; //Elder: HC gets 2 in chamber and 5 in reserve //Also sync with M3 //Removed until we can store the amount of ammo in the gun @@ -386,7 +386,7 @@ int Pickup_Weapon (gentity_t *ent, gentity_t *other, int bandolierFactor) { other->client->uniqueWeapons++; break; case WP_SSG3000: - ammotoadd= RQ3_SSG3000_AMMO; + ammotoadd = RQ3_SSG3000_AMMO; other->client->uniqueWeapons++; break; case WP_GRENADE: @@ -402,13 +402,15 @@ int Pickup_Weapon (gentity_t *ent, gentity_t *other, int bandolierFactor) { default: //Blaze: Should never hit here G_Printf("Pickup_Weapon: Given bad giTag: %d\n", ent->item->giTag); - ammotoadd=0; + ammotoadd = 0; break; } //Elder: conditional added to "restore" weapons - if ( other->client->pers.hadUniqueWeapon[ent->item->giTag] == qfalse || - !((ent->flags & FL_THROWN_ITEM) == FL_THROWN_ITEM) ) { - other->client->ps.ammo[ent->item->giTag]= ammotoadd; + if ( !(ent->flags & FL_THROWN_ITEM) || + (ent->s.otherEntityNum == other->client->ps.clientNum && + other->client->pers.hadUniqueWeapon[ent->item->giTag] == qfalse ) ) + { + other->client->ps.ammo[ent->item->giTag] = ammotoadd; //Elder: add extra handcannon clips if it's "fresh" if (ent->item->giTag == WP_HANDCANNON) { other->client->numClips[ WP_HANDCANNON ] += 5; @@ -420,6 +422,22 @@ int Pickup_Weapon (gentity_t *ent, gentity_t *other, int bandolierFactor) { } } + /* + if ( other->client->pers.hadUniqueWeapon[ent->item->giTag] == qfalse || + !(ent->flags & FL_THROWN_ITEM) ) { + other->client->ps.ammo[ent->item->giTag] = ammotoadd; + //Elder: add extra handcannon clips if it's "fresh" + if (ent->item->giTag == WP_HANDCANNON) { + other->client->numClips[ WP_HANDCANNON ] += 5; + other->client->numClips[ WP_M3 ] += 5; + if (other->client->numClips[ WP_HANDCANNON ] > 13) { + other->client->numClips[ WP_HANDCANNON ] = 14; + other->client->numClips[ WP_M3 ] = 14; + } + } + } + */ + // End Duffman diff --git a/reaction/game/g_misc.c b/reaction/game/g_misc.c index 8601f289..a3086319 100644 --- a/reaction/game/g_misc.c +++ b/reaction/game/g_misc.c @@ -572,7 +572,7 @@ void G_BreakGlass( gentity_t *ent, vec3_t point, int mod ) } G_FreeEntity( ent ); - G_Printf("%s shift: %i\n", vtos(impactPoint), shiftCount); + //G_Printf("%s shift: %i\n", vtos(impactPoint), shiftCount); switch ( shiftCount ) { case 0: diff --git a/reaction/game/g_weapon.c b/reaction/game/g_weapon.c index 7eabc18a..77e2ea2d 100644 --- a/reaction/game/g_weapon.c +++ b/reaction/game/g_weapon.c @@ -2408,14 +2408,14 @@ void ReloadWeapon ( gentity_t *ent, int stage ) if (stage == 1 && (ent->client->ps.weapon == WP_SSG3000 || ent->client->ps.weapon == WP_M3) ) { - G_Printf("Hit server-side reload stage 1\n"); + //G_Printf("Hit server-side reload stage 1\n"); if ( ent->client->ps.weapon == WP_M3 ) ent->client->numClips[WP_HANDCANNON] = ent->client->numClips[WP_M3]; ent->client->numClips[ent->client->ps.weapon]--; } else if (stage == 2) { - G_Printf("Hit server-side reload stage 2\n"); + //G_Printf("Hit server-side reload stage 2\n"); ent->client->numClips[ent->client->ps.weapon]--; // remove an extra clip if using HC or Akimbos if (ent->client->ps.weapon == WP_HANDCANNON ||