0-15-00 VMs
Server-side
This commit is contained in:
Victor Chow 2001-10-30 23:26:03 +00:00
parent 19d863fa5d
commit 4f41b8b094
6 changed files with 108 additions and 20 deletions

View file

@ -1656,7 +1656,9 @@ static void PM_CheckDuck (void)
}
}
if (pm->ps->pm_flags & PMF_DUCKED)
// Elder: don't allow mid-air "crouching"
// Removed because it was causing problems -- WTF is the "jump" flag?
if (pm->ps->pm_flags & PMF_DUCKED )// && pm->ps->groundEntityNum != ENTITYNUM_NONE)
{
pm->maxs[2] = 16;
pm->ps->viewheight = CROUCH_VIEWHEIGHT;
@ -1888,6 +1890,7 @@ static void PM_BeginWeaponChange( int weapon ) {
}
//Elder: temp hack
/*
if (pm->ps->weapon == WP_PISTOL ||
pm->ps->weapon == WP_M3 ||
pm->ps->weapon == WP_HANDCANNON ||
@ -1897,8 +1900,12 @@ static void PM_BeginWeaponChange( int weapon ) {
pm->ps->weapon == WP_GRENADE ||
(pm->ps->weapon == WP_KNIFE && (pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE)))
PM_StartWeaponAnim(WP_ANIM_DISARM);
else if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
else
*/
if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
PM_StartWeaponAnim(WP_ANIM_THROWDISARM);
else
PM_StartWeaponAnim(WP_ANIM_DISARM);
}
// Elder: cancel reload stuff here
@ -1911,17 +1918,22 @@ static void PM_BeginWeaponChange( int weapon ) {
pm->ps->weaponstate = WEAPON_DROPPING;
//Elder: temp hack
/*
if (pm->ps->weapon == WP_PISTOL ||
pm->ps->weapon == WP_M3 ||
pm->ps->weapon == WP_HANDCANNON ||
pm->ps->weapon == WP_SSG3000 ||
pm->ps->weapon == WP_M4 ||
pm->ps->weapon == WP_MP5 ||
pm->ps->weapon == WP_AKIMBO ||
pm->ps->weapon == WP_GRENADE ||
(pm->ps->weapon == WP_KNIFE && (pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE)))
PM_StartWeaponAnim(WP_ANIM_DISARM);
else if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
else*/
if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
PM_StartWeaponAnim(WP_ANIM_THROWDISARM);
else
PM_StartWeaponAnim(WP_ANIM_DISARM);
PM_StartTorsoAnim( TORSO_DROP );
}
@ -1992,17 +2004,23 @@ static void PM_FinishWeaponChange( void ) {
}
//Elder: temp hack
/*
if (pm->ps->weapon == WP_PISTOL ||
pm->ps->weapon == WP_M3 ||
pm->ps->weapon == WP_HANDCANNON ||
pm->ps->weapon == WP_SSG3000 ||
pm->ps->weapon == WP_M4 ||
pm->ps->weapon == WP_MP5 ||
pm->ps->weapon == WP_AKIMBO ||
pm->ps->weapon == WP_GRENADE ||
(pm->ps->weapon == WP_KNIFE && (pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE)))
PM_StartWeaponAnim(WP_ANIM_ACTIVATE);
else if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
*/
/*else*/
if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
PM_StartWeaponAnim(WP_ANIM_THROWACTIVATE);
else
PM_StartWeaponAnim(WP_ANIM_ACTIVATE);
PM_StartTorsoAnim( TORSO_RAISE );
@ -2027,17 +2045,22 @@ static void PM_TorsoAnimation( void ) {
//Elder: temp hack
if (pm->ps->ammo[pm->ps->weapon] == 0)
PM_ContinueWeaponAnim( WP_ANIM_EMPTY );
/*
else if (pm->ps->weapon == WP_PISTOL ||
pm->ps->weapon == WP_M3 ||
pm->ps->weapon == WP_HANDCANNON ||
pm->ps->weapon == WP_SSG3000 ||
pm->ps->weapon == WP_M4 ||
pm->ps->weapon == WP_MP5 ||
pm->ps->weapon == WP_AKIMBO ||
pm->ps->weapon == WP_GRENADE ||
(pm->ps->weapon == WP_KNIFE && (pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE)))
PM_ContinueWeaponAnim(WP_ANIM_IDLE);
*/
else if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
PM_ContinueWeaponAnim(WP_ANIM_THROWIDLE);
else
PM_ContinueWeaponAnim(WP_ANIM_IDLE);
// PM_ContinueWeaponAnim( WP_ANIM_READY );
@ -2534,18 +2557,23 @@ static void PM_Weapon( void ) {
{
if (pm->ps->ammo[pm->ps->weapon] == 0)
PM_ContinueWeaponAnim( WP_ANIM_EMPTY );
/*
else if (pm->ps->weapon == WP_PISTOL ||
pm->ps->weapon == WP_M3 ||
pm->ps->weapon == WP_HANDCANNON ||
pm->ps->weapon == WP_SSG3000 ||
pm->ps->weapon == WP_M4 ||
pm->ps->weapon == WP_MP5 ||
pm->ps->weapon == WP_AKIMBO ||
pm->ps->weapon == WP_GRENADE ||
(pm->ps->weapon == WP_KNIFE && (pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE)))
PM_ContinueWeaponAnim(WP_ANIM_IDLE);
*/
else if (pm->ps->weapon == WP_KNIFE &&
!(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
PM_ContinueWeaponAnim(WP_ANIM_THROWIDLE);
else
PM_ContinueWeaponAnim(WP_ANIM_IDLE);
}
}
}
@ -2590,17 +2618,22 @@ static void PM_Weapon( void ) {
// temp hack
if (pm->ps->ammo[pm->ps->weapon] == 0)
PM_ContinueWeaponAnim( WP_ANIM_EMPTY );
/*
else if (pm->ps->weapon == WP_PISTOL ||
pm->ps->weapon == WP_M3 ||
pm->ps->weapon == WP_HANDCANNON ||
pm->ps->weapon == WP_SSG3000 ||
pm->ps->weapon == WP_M4 ||
pm->ps->weapon == WP_MP5 ||
pm->ps->weapon == WP_AKIMBO ||
pm->ps->weapon == WP_GRENADE ||
(pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE)))
PM_StartWeaponAnim( WP_ANIM_IDLE );
*/
else if (pm->ps->weapon == WP_KNIFE && !(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
PM_StartWeaponAnim( WP_ANIM_THROWIDLE );
else
PM_StartWeaponAnim( WP_ANIM_IDLE );
return;
}
@ -2665,14 +2698,15 @@ static void PM_Weapon( void ) {
//Elder: custom player model fire animations go here
// start the animation even if out of ammo -- Elder: NO WAY
if ( pm->ps->weapon == WP_KNIFE ) {
if ( pm->ps->weapon == WP_KNIFE || pm->ps->weapon == WP_GRENADE ) {
// the gauntlet only "fires" when it actually hits something
// if ( !pm->gauntletHit ) {
// pm->ps->weaponTime = 0;
// pm->ps->weaponstate = WEAPON_READY;
// return;
// }
if (pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE)
if ( pm->ps->weapon == WP_GRENADE ||
(pm->ps->persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE) )
PM_StartWeaponAnim( WP_ANIM_FIRE );
else
PM_StartWeaponAnim( WP_ANIM_THROWFIRE );
@ -2697,12 +2731,13 @@ static void PM_Weapon( void ) {
if ( !pm->ps->stats[STAT_BURST] )
PM_StartWeaponAnim( WP_ANIM_FIRE );
}
else if (pm->ps->weapon == WP_PISTOL ||
else /* if (pm->ps->weapon == WP_PISTOL ||
pm->ps->weapon == WP_M3 ||
pm->ps->weapon == WP_HANDCANNON ||
pm->ps->weapon == WP_SSG3000 ||
pm->ps->weapon == WP_M4 ||
pm->ps->weapon == WP_GRENADE)
pm->ps->weapon == WP_MP5 ||
pm->ps->weapon == WP_GRENADE) */
PM_StartWeaponAnim( WP_ANIM_FIRE );
}
}
@ -3374,6 +3409,7 @@ void PmoveSingle (pmove_t *pmove) {
//weapon animations(rq3 specific)
//Elder: temp hack to avoid messing up fast-reloads
/*
if (pm->ps->weapon == WP_PISTOL ||
pm->ps->weapon == WP_M3 ||
pm->ps->weapon == WP_HANDCANNON ||
@ -3383,6 +3419,7 @@ void PmoveSingle (pmove_t *pmove) {
pm->ps->weapon == WP_GRENADE ||
pm->ps->weapon == WP_KNIFE)
PM_WeaponAnimation();
*/
// torso animation
PM_TorsoAnimation();

View file

@ -41,11 +41,12 @@
#define VOTE_TIME 30000 // 30 seconds before vote times out
#define MINS_Z -24
#define DEFAULT_VIEWHEIGHT 22
//#define DEFAULT_VIEWHEIGHT 26
//#define DEFAULT_VIEWHEIGHT 22
#define DEFAULT_VIEWHEIGHT 26
//Elder: changed to 8 like AQ2 source
#define CROUCH_VIEWHEIGHT 8
//#define CROUCH_VIEWHEIGHT 12
//Elder: moved back to original viewheight
//#define CROUCH_VIEWHEIGHT 8
#define CROUCH_VIEWHEIGHT 12
#define DEAD_VIEWHEIGHT -16
//Elder: New breakable bit definitions
@ -606,6 +607,26 @@ typedef enum {
WP_NONE,
//Blaze: Reaction Weapons
//Remember to put them in the right spots
/*
MK23 Pistol
M3 Super 90 Assault Shotgun
MP5/10 Submachinegun
Handcannon
Sniper Rifle
M4 Assault Rifle
Dual MK23 Pistols
Combat Knife
*/
WP_PISTOL,
WP_M3,
WP_MP5,
WP_HANDCANNON,
WP_SSG3000,
WP_M4,
WP_AKIMBO,
WP_KNIFE,
WP_GRENADE,
/*
WP_KNIFE,
WP_PISTOL,
WP_M4,
@ -615,6 +636,7 @@ typedef enum {
WP_HANDCANNON,
WP_AKIMBO,
WP_GRENADE,
*/
#ifdef MISSIONPACK
WP_NAILGUN,
WP_PROX_LAUNCHER,

View file

@ -1359,6 +1359,8 @@ void ClientSpawn(gentity_t *ent) {
// spawn given items have fired
client->ps.weapon = 1;
for ( i = WP_NUM_WEAPONS - 1 ; i > 0 ; i-- ) {
if ( i == WP_KNIFE )
continue;
if ( client->ps.stats[STAT_WEAPONS] & ( 1 << i ) ) {
client->ps.weapon = i;
break;

View file

@ -1680,11 +1680,13 @@ void Cmd_Bandage (gentity_t *ent)
ent->client->ps.weaponstate = WEAPON_DROPPING;
//Elder: temp hack
/*
if (ent->client->ps.weapon == WP_PISTOL ||
ent->client->ps.weapon == WP_M3 ||
ent->client->ps.weapon == WP_HANDCANNON ||
ent->client->ps.weapon == WP_SSG3000 ||
ent->client->ps.weapon == WP_M4 ||
ent->client->ps.weapon == WP_MP5 ||
ent->client->ps.weapon == WP_AKIMBO ||
ent->client->ps.weapon == WP_GRENADE ||
(ent->client->ps.weapon == WP_KNIFE && !(ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE)))
@ -1692,11 +1694,17 @@ void Cmd_Bandage (gentity_t *ent)
ent->client->ps.generic1 = ( ( ent->client->ps.generic1 & ANIM_TOGGLEBIT )
^ ANIM_TOGGLEBIT ) | WP_ANIM_DISARM;
}
else if (ent->client->ps.weapon == WP_KNIFE && (ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
else */
if (ent->client->ps.weapon == WP_KNIFE && (ent->client->ps.persistant[PERS_WEAPONMODES] & RQ3_KNIFEMODE))
{
ent->client->ps.generic1 = ( ( ent->client->ps.generic1 & ANIM_TOGGLEBIT )
^ ANIM_TOGGLEBIT ) | WP_ANIM_THROWDISARM;
}
else
{
ent->client->ps.generic1 = ( ( ent->client->ps.generic1 & ANIM_TOGGLEBIT )
^ ANIM_TOGGLEBIT ) | WP_ANIM_DISARM;
}
//Elder: always lower the player model
ent->client->ps.torsoAnim = ( ( ent->client->ps.torsoAnim & ANIM_TOGGLEBIT )

View file

@ -901,7 +901,7 @@ gentity_t *LaunchItem( gitem_t *item, vec3_t origin, vec3_t velocity, int xr_fla
dropped->s.eType = ET_ITEM;
dropped->s.modelindex = item - bg_itemlist; // store item number in modelindex
dropped->s.modelindex2 = 1; // This is non-zero is it's a dropped item
dropped->s.modelindex2 = 1; // This is non-zero if it's a dropped item
dropped->classname = item->classname;
dropped->item = item;
@ -956,8 +956,9 @@ gentity_t *LaunchItem( gitem_t *item, vec3_t origin, vec3_t velocity, int xr_fla
dropped->think = RQ3_DroppedItemThink;
dropped->nextthink = level.time + RQ3_RESPAWNTIME_DEFAULT;
}
else { // auto-remove after 30 seconds
else
{
// auto-remove after 30 seconds
dropped->think = G_FreeEntity;
dropped->nextthink = level.time + 30000;
}
@ -965,8 +966,8 @@ gentity_t *LaunchItem( gitem_t *item, vec3_t origin, vec3_t velocity, int xr_fla
dropped->flags = xr_flags;//FL_DROPPED_ITEM;
if( xr_flags & FL_THROWN_ITEM) {
//Elder: we don't want it to clip against players
dropped->clipmask = MASK_SOLID; //MASK_SHOT
dropped->s.pos.trTime = level.time; // +50; no pre-step if it doesn't clip players
dropped->clipmask = MASK_SOLID; //MASK_SHOT
dropped->s.pos.trTime = level.time; // +50; no pre-step if it doesn't clip players
VectorScale( velocity, 40, dropped->s.pos.trDelta ); // 700 500 400
SnapVector( dropped->s.pos.trDelta ); // save net bandwidth
dropped->physicsBounce = 0.1f;
@ -1300,8 +1301,9 @@ be on an entity that hasn't spawned yet.
void G_SpawnItem (gentity_t *ent, gitem_t *item) {
G_SpawnFloat( "random", "0", &ent->random );
G_SpawnFloat( "wait", "0", &ent->wait );
//TODO: check spawn angles; client-side should make use of them too
//Elder: check spawn angles; client-side should make use of them too
G_SpawnFloat( "angle", "0", &ent->s.angles[1] );
RegisterItem( item );
if ( G_ItemDisabled(item) )
@ -1407,6 +1409,14 @@ void G_RunItem( gentity_t *ent ) {
tr.fraction = 0;
}
if ( ent->flags & FL_DROPPED_ITEM && VectorLength(ent->s.pos.trDelta) != 0 &&
(ent->item->giType == IT_WEAPON || ent->item->giType == IT_HOLDABLE) )
{
// calculate spin -- should be identical to cg.autoAngles
//cg.autoAnglesFast[1] = ( cg.time & 1023 ) * 360 / 1024.0f;
ent->s.angles[1] = ( level.time & 1023 ) * 360 / 1024.0f;
}
trap_LinkEntity( ent ); // FIXME: avoid this for stationary?
// check think function

View file

@ -496,6 +496,15 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
//Elder: spawn unique items.
RQ3_StartUniqueItems();
// Elder: force sv_floodprotect to 0 -- remove when we finish
// recoding the weapon command and any other commands that may
// need smashing :)
if ( trap_Cvar_VariableIntegerValue( "sv_floodprotect" ) != 0 )
{
trap_Cvar_Set( "sv_floodprotect", "0" );
G_Printf("sv_floodprotect shut off for RQ3 Beta 1.\n");
}
SaveRegisteredItems();
G_Printf ("-----------------------------------\n");