mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2024-11-21 12:11:07 +00:00
Fix all whitespace errors
Excluding 3rd party files.
This commit is contained in:
parent
eac3112d2d
commit
c7c187e4dc
424 changed files with 5695 additions and 5729 deletions
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -621,7 +621,7 @@ idAF::LoadConstraint
|
|||
bool idAF::LoadConstraint( const idDeclAF_Constraint *fc ) {
|
||||
idAFBody *body1, *body2;
|
||||
idAngles angles;
|
||||
idMat3 axis;
|
||||
idMat3 axis;
|
||||
|
||||
body1 = physicsObj.GetBody( fc->body1 );
|
||||
body2 = physicsObj.GetBody( fc->body2 );
|
||||
|
@ -1143,7 +1143,7 @@ void idAF::LoadState( const idDict &args ) {
|
|||
body->SetWorldOrigin( origin );
|
||||
body->SetWorldAxis( angles.ToMat3() );
|
||||
} else {
|
||||
gameLocal.Warning("Unknown body part %s in articulated figure %s", name.c_str(), this->name.c_str());
|
||||
gameLocal.Warning("Unknown body part %s in articulated figure %s", name.c_str(), this->name.c_str());
|
||||
}
|
||||
|
||||
kv = args.MatchPrefix( "body ", kv );
|
||||
|
@ -1261,7 +1261,7 @@ void idAF::RemoveBindConstraints( void ) {
|
|||
name.Strip( "bindConstraint " );
|
||||
|
||||
if ( physicsObj.GetConstraint( name ) ) {
|
||||
physicsObj.DeleteConstraint( name );
|
||||
physicsObj.DeleteConstraint( name );
|
||||
}
|
||||
|
||||
kv = args.MatchPrefix( "bindConstraint ", kv );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -371,9 +371,9 @@ idAFAttachment::Damage
|
|||
Pass damage to body at the bindjoint
|
||||
============
|
||||
*/
|
||||
void idAFAttachment::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir,
|
||||
void idAFAttachment::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir,
|
||||
const char *damageDefName, const float damageScale, const int location ) {
|
||||
|
||||
|
||||
if ( body ) {
|
||||
body->Damage( inflictor, attacker, dir, damageDefName, damageScale, attachJoint );
|
||||
}
|
||||
|
@ -1705,7 +1705,7 @@ void idAFEntity_Vehicle::Spawn( void ) {
|
|||
steeringWheelJoint = animator.GetJointHandle( steeringWheelJointName );
|
||||
|
||||
spawnArgs.GetFloat( "wheelRadius", "20", wheelRadius );
|
||||
spawnArgs.GetFloat( "steerSpeed", "5", steerSpeed );
|
||||
spawnArgs.GetFloat( "steerSpeed", "5", steerSpeed );
|
||||
|
||||
player = NULL;
|
||||
steerAngle = 0.0f;
|
||||
|
@ -3116,7 +3116,7 @@ idRenderModel *idGameEdit::AF_CreateMesh( const idDict &args, idVec3 &meshOrigin
|
|||
modifiedAxis[ jointNum ] = ( bodyAxis[i] * originalJoints[jointNum].ToMat3().Transpose() ).Transpose() * ( newBodyAxis[i] * meshAxis.Transpose() );
|
||||
// FIXME: calculate correct modifiedOrigin
|
||||
modifiedOrigin[ jointNum ] = originalJoints[ jointNum ].ToVec3();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// apply joint modifications to the skeleton
|
||||
|
@ -3184,7 +3184,7 @@ idHarvestable::~idHarvestable() {
|
|||
}
|
||||
|
||||
void idHarvestable::Spawn() {
|
||||
|
||||
|
||||
startTime = 0;
|
||||
|
||||
spawnArgs.GetFloat( "triggersize", "120", triggersize );
|
||||
|
@ -3197,13 +3197,13 @@ void idHarvestable::Spawn() {
|
|||
fxFollowPlayer = spawnArgs.GetBool("fx_follow_player", "1");
|
||||
fxOrient = spawnArgs.GetString("fx_orient");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void idHarvestable::Init(idEntity* parent) {
|
||||
|
||||
assert(parent);
|
||||
|
||||
|
||||
parentEnt = parent;
|
||||
|
||||
GetPhysics()->SetOrigin( parent->GetPhysics()->GetOrigin() );
|
||||
|
@ -3214,7 +3214,7 @@ void idHarvestable::Init(idEntity* parent) {
|
|||
if(skin.Length()) {
|
||||
parent->SetSkin(declManager->FindSkin(skin.c_str()));
|
||||
}
|
||||
|
||||
|
||||
idEntity* head;
|
||||
if(parent->IsType(idActor::Type)) {
|
||||
idActor* withHead = (idActor*)parent;
|
||||
|
@ -3270,7 +3270,7 @@ void idHarvestable::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadBool( fxFollowPlayer );
|
||||
fx.Restore( savefile );
|
||||
savefile->ReadString( fxOrient );
|
||||
|
||||
|
||||
parentEnt.Restore(savefile);
|
||||
}
|
||||
|
||||
|
@ -3302,7 +3302,7 @@ void idHarvestable::Think() {
|
|||
parent->PostEventMS( &EV_Remove, 0 );
|
||||
PostEventMS( &EV_Remove, 0 );
|
||||
}
|
||||
|
||||
|
||||
if(fxFollowPlayer) {
|
||||
idEntityFx* fxEnt = fx.GetEntity();
|
||||
|
||||
|
@ -3339,12 +3339,12 @@ idAFEntity_Harvest::BeginBurn
|
|||
================
|
||||
*/
|
||||
void idHarvestable::BeginBurn() {
|
||||
|
||||
|
||||
idEntity* parent = parentEnt.GetEntity();
|
||||
if(!parent) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(!spawnArgs.GetBool("burn")) {
|
||||
return;
|
||||
}
|
||||
|
@ -3377,8 +3377,8 @@ void idHarvestable::BeginBurn() {
|
|||
head->SetShaderParm( SHADERPARM_TIME_OF_DEATH, gameLocal.slow.time * 0.001f );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3406,7 +3406,7 @@ idAFEntity_Harvest::CalcTriggerBounds
|
|||
================
|
||||
*/
|
||||
void idHarvestable::CalcTriggerBounds( float size, idBounds &bounds ) {
|
||||
|
||||
|
||||
idEntity* parent = parentEnt.GetEntity();
|
||||
if(!parent) {
|
||||
return;
|
||||
|
@ -3420,12 +3420,12 @@ void idHarvestable::CalcTriggerBounds( float size, idBounds &bounds ) {
|
|||
}
|
||||
|
||||
bool idHarvestable::GetFxOrientationAxis(idMat3& mat) {
|
||||
|
||||
|
||||
idEntity* parent = parentEnt.GetEntity();
|
||||
if(!parent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
idPlayer *thePlayer = player.GetEntity();
|
||||
|
||||
if(!fxOrient.Icmp("up")) {
|
||||
|
@ -3466,7 +3466,7 @@ bool idHarvestable::GetFxOrientationAxis(idMat3& mat) {
|
|||
//Orient the fx towards the eye of the player
|
||||
idVec3 eye = thePlayer->GetEyePosition();
|
||||
idVec3 toPlayer = eye-parent->GetPhysics()->GetOrigin();
|
||||
|
||||
|
||||
toPlayer.Normalize();
|
||||
|
||||
idVec3 left, up;
|
||||
|
@ -3613,11 +3613,11 @@ idAFEntity_Harvest::~idAFEntity_Harvest
|
|||
================
|
||||
*/
|
||||
idAFEntity_Harvest::~idAFEntity_Harvest() {
|
||||
|
||||
|
||||
if ( harvestEnt.GetEntity() ) {
|
||||
harvestEnt.GetEntity()->PostEventMS( &EV_Remove, 0 );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -526,7 +526,7 @@ private:
|
|||
|
||||
#ifdef _D3XP
|
||||
|
||||
/**
|
||||
/**
|
||||
* idHarvestable contains all of the code required to turn an entity into a harvestable
|
||||
* entity. The entity must create an instance of this class and call the appropriate
|
||||
* interface methods at the correct time.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -230,7 +230,7 @@ idAnimState::AnimDone
|
|||
*/
|
||||
bool idAnimState::AnimDone( int blendFrames ) const {
|
||||
int animDoneTime;
|
||||
|
||||
|
||||
animDoneTime = animator->CurrentAnim( channel )->GetEndTime();
|
||||
if ( animDoneTime < 0 ) {
|
||||
// playing a cycle
|
||||
|
@ -457,7 +457,7 @@ idActor::idActor( void ) {
|
|||
allowEyeFocus = false;
|
||||
|
||||
waitState = "";
|
||||
|
||||
|
||||
blink_anim = NULL;
|
||||
blink_time = 0;
|
||||
blink_min = 0;
|
||||
|
@ -527,7 +527,7 @@ void idActor::Spawn( void ) {
|
|||
spawnArgs.GetInt( "team", "0", team );
|
||||
spawnArgs.GetVector( "offsetModel", "0 0 0", modelOffset );
|
||||
|
||||
spawnArgs.GetBool( "use_combat_bbox", "0", use_combat_bbox );
|
||||
spawnArgs.GetBool( "use_combat_bbox", "0", use_combat_bbox );
|
||||
|
||||
viewAxis = GetPhysics()->GetAxis();
|
||||
|
||||
|
@ -560,7 +560,7 @@ void idActor::Spawn( void ) {
|
|||
|
||||
// don't let them drop to the floor
|
||||
args.Set( "dropToFloor", "0" );
|
||||
|
||||
|
||||
gameLocal.SpawnEntityDef( args, &ent );
|
||||
if ( !ent ) {
|
||||
gameLocal.Error( "Couldn't spawn '%s' to attach to entity '%s'", kv->GetValue().c_str(), name.c_str() );
|
||||
|
@ -627,7 +627,7 @@ void idActor::Spawn( void ) {
|
|||
int headAnim = headAnimator->GetAnim( "def_head" );
|
||||
if ( headAnim ) {
|
||||
if ( headEnt ) {
|
||||
headAnimator->CycleAnim( ANIMCHANNEL_ALL, headAnim, gameLocal.time, 0 );
|
||||
headAnimator->CycleAnim( ANIMCHANNEL_ALL, headAnim, gameLocal.time, 0 );
|
||||
} else {
|
||||
headAnimator->CycleAnim( ANIMCHANNEL_HEAD, headAnim, gameLocal.time, 0 );
|
||||
}
|
||||
|
@ -1065,7 +1065,7 @@ void idActor::Show( void ) {
|
|||
static_cast<idLight *>( ent )->On();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1304,7 +1304,7 @@ idThread *idActor::ConstructScriptObject( void ) {
|
|||
} else {
|
||||
scriptThread->EndThread();
|
||||
}
|
||||
|
||||
|
||||
// call script object's constructor
|
||||
constructor = scriptObject.GetConstructor();
|
||||
if ( !constructor ) {
|
||||
|
@ -1392,7 +1392,7 @@ void idActor::UpdateScript( void ) {
|
|||
if ( scriptThread->IsWaiting() ) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
scriptThread->Execute();
|
||||
if ( idealState == state ) {
|
||||
break;
|
||||
|
@ -1477,7 +1477,7 @@ bool idActor::CheckFOV( const idVec3 &pos ) const {
|
|||
|
||||
float dot;
|
||||
idVec3 delta;
|
||||
|
||||
|
||||
delta = pos - GetEyePosition();
|
||||
|
||||
// get our gravity normal
|
||||
|
@ -1911,7 +1911,7 @@ void idActor::GetAASLocation( idAAS *aas, idVec3 &pos, int &areaNum ) const {
|
|||
areaNum = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
size = aas->GetSettings()->boundingBoxes[0][1];
|
||||
bounds[0] = -size;
|
||||
size.z = 32.0f;
|
||||
|
@ -1948,7 +1948,7 @@ void idActor::SetAnimState( int channel, const char *statename, int blendFrames
|
|||
headAnim.SetState( statename, blendFrames );
|
||||
allowEyeFocus = true;
|
||||
break;
|
||||
|
||||
|
||||
case ANIMCHANNEL_TORSO :
|
||||
torsoAnim.SetState( statename, blendFrames );
|
||||
legsAnim.Enable( blendFrames );
|
||||
|
@ -2200,7 +2200,7 @@ Bleeding wounds and surface overlays are applied in the collision code that
|
|||
calls Damage()
|
||||
============
|
||||
*/
|
||||
void idActor::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir,
|
||||
void idActor::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir,
|
||||
const char *damageDefName, const float damageScale, const int location ) {
|
||||
if ( !fl.takedamage ) {
|
||||
return;
|
||||
|
@ -2222,7 +2222,7 @@ void idActor::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir
|
|||
}
|
||||
|
||||
// Maledict is immume to the falling asteroids
|
||||
if ( !idStr::Icmp( GetEntityDefName(), "monster_boss_d3xp_maledict" ) &&
|
||||
if ( !idStr::Icmp( GetEntityDefName(), "monster_boss_d3xp_maledict" ) &&
|
||||
(!idStr::Icmp( damageDefName, "damage_maledict_asteroid" ) || !idStr::Icmp( damageDefName, "damage_maledict_asteroid_splash" ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
@ -2360,7 +2360,7 @@ bool idActor::Pain( idEntity *inflictor, idEntity *attacker, int damage, const i
|
|||
}
|
||||
|
||||
if ( g_debugDamage.GetBool() ) {
|
||||
gameLocal.Printf( "Damage: joint: '%s', zone '%s', anim '%s'\n", animator.GetJointName( ( jointHandle_t )location ),
|
||||
gameLocal.Printf( "Damage: joint: '%s', zone '%s', anim '%s'\n", animator.GetJointName( ( jointHandle_t )location ),
|
||||
damageGroup.c_str(), painAnim.c_str() );
|
||||
}
|
||||
|
||||
|
@ -2504,7 +2504,7 @@ idActor::Event_DisableEyeFocus
|
|||
*/
|
||||
void idActor::Event_DisableEyeFocus( void ) {
|
||||
allowEyeFocus = false;
|
||||
|
||||
|
||||
idEntity *headEnt = head.GetEntity();
|
||||
if ( headEnt ) {
|
||||
headEnt->GetAnimator()->Clear( ANIMCHANNEL_EYELIDS, gameLocal.time, FRAME2MS( 2 ) );
|
||||
|
@ -2641,7 +2641,7 @@ void idActor::Event_PlayAnim( int channel, const char *animname ) {
|
|||
animFlags_t flags;
|
||||
idEntity *headEnt;
|
||||
int anim;
|
||||
|
||||
|
||||
anim = GetAnim( channel, animname );
|
||||
if ( !anim ) {
|
||||
if ( ( channel == ANIMCHANNEL_HEAD ) && head.GetEntity() ) {
|
||||
|
@ -2720,7 +2720,7 @@ idActor::Event_PlayCycle
|
|||
void idActor::Event_PlayCycle( int channel, const char *animname ) {
|
||||
animFlags_t flags;
|
||||
int anim;
|
||||
|
||||
|
||||
anim = GetAnim( channel, animname );
|
||||
if ( !anim ) {
|
||||
if ( ( channel == ANIMCHANNEL_HEAD ) && head.GetEntity() ) {
|
||||
|
@ -2793,8 +2793,8 @@ idActor::Event_IdleAnim
|
|||
*/
|
||||
void idActor::Event_IdleAnim( int channel, const char *animname ) {
|
||||
int anim;
|
||||
|
||||
anim = GetAnim( channel, animname );
|
||||
|
||||
anim = GetAnim( channel, animname );
|
||||
if ( !anim ) {
|
||||
if ( ( channel == ANIMCHANNEL_HEAD ) && head.GetEntity() ) {
|
||||
gameLocal.DPrintf( "missing '%s' animation on '%s' (%s)\n", animname, name.c_str(), spawnArgs.GetString( "def_head", "" ) );
|
||||
|
@ -3198,9 +3198,9 @@ void idActor::Event_AnimLength( int channel, const char *animname ) {
|
|||
} else {
|
||||
idThread::ReturnFloat( MS2SEC( animator.AnimLength( anim ) ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
idThread::ReturnFloat( 0.0f );
|
||||
}
|
||||
|
||||
|
@ -3224,7 +3224,7 @@ void idActor::Event_AnimDistance( int channel, const char *animname ) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
idThread::ReturnFloat( 0.0f );
|
||||
}
|
||||
|
||||
|
@ -3268,7 +3268,7 @@ void idActor::Event_NextEnemy( idEntity *ent ) {
|
|||
}
|
||||
}
|
||||
|
||||
idThread::ReturnEntity( NULL );
|
||||
idThread::ReturnEntity( NULL );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -196,8 +196,8 @@ public:
|
|||
|
||||
virtual void Teleport( const idVec3 &origin, const idAngles &angles, idEntity *destination );
|
||||
|
||||
virtual renderView_t * GetRenderView();
|
||||
|
||||
virtual renderView_t * GetRenderView();
|
||||
|
||||
// animation state control
|
||||
int GetAnim( int channel, const char *name );
|
||||
void UpdateAnimState( void );
|
||||
|
@ -333,7 +333,7 @@ private:
|
|||
void Event_SetDamageCap( float _damageCap );
|
||||
void Event_SetWaitState( const char* waitState);
|
||||
void Event_GetWaitState();
|
||||
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -105,7 +105,7 @@ void idBrittleFracture::Save( idSaveGame *savefile ) const {
|
|||
entityFlags_s flags = fl;
|
||||
LittleBitField( &flags, sizeof( flags ) );
|
||||
savefile->Write( &flags, sizeof( flags ) );
|
||||
|
||||
|
||||
// setttings
|
||||
savefile->WriteMaterial( material );
|
||||
savefile->WriteMaterial( decalMaterial );
|
||||
|
@ -416,7 +416,7 @@ bool idBrittleFracture::UpdateRenderEntity( renderEntity_s *renderEntity, const
|
|||
}
|
||||
packedColor = PackColor( idVec4( renderEntity->shaderParms[ SHADERPARM_RED ] * fade,
|
||||
renderEntity->shaderParms[ SHADERPARM_GREEN ] * fade,
|
||||
renderEntity->shaderParms[ SHADERPARM_BLUE ] * fade,
|
||||
renderEntity->shaderParms[ SHADERPARM_BLUE ] * fade,
|
||||
fade ) );
|
||||
|
||||
const idWinding &winding = shards[i]->winding;
|
||||
|
@ -946,7 +946,7 @@ void idBrittleFracture::DropFloatingIslands( const idVec3 &point, const idVec3 &
|
|||
continue;
|
||||
}
|
||||
|
||||
queueStart = 0;
|
||||
queueStart = 0;
|
||||
queueEnd = 1;
|
||||
queue[0] = shards[i];
|
||||
shards[i]->islandNum = numIslands+1;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -193,7 +193,7 @@ idCameraView::GetViewParms
|
|||
*/
|
||||
void idCameraView::GetViewParms( renderView_t *view ) {
|
||||
assert( view );
|
||||
|
||||
|
||||
if (view == NULL) {
|
||||
return;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ void idCameraView::GetViewParms( renderView_t *view ) {
|
|||
} else {
|
||||
view->viewaxis = ent->GetPhysics()->GetAxis();
|
||||
}
|
||||
|
||||
|
||||
gameLocal.CalcFov( fov, view->fov_x, view->fov_y );
|
||||
}
|
||||
|
||||
|
@ -519,7 +519,7 @@ void idCameraAnim::Think( void ) {
|
|||
frameTime = ( gameLocal.time - starttime ) * frameRate;
|
||||
frame = frameTime / 1000;
|
||||
}
|
||||
|
||||
|
||||
if ( frame > camera.Num() + cameraCuts.Num() - 2 ) {
|
||||
if ( cycle > 0 ) {
|
||||
cycle--;
|
||||
|
@ -656,7 +656,7 @@ void idCameraAnim::GetViewParms( renderView_t *view ) {
|
|||
|
||||
// setup the pvs for this frame
|
||||
UpdatePVSAreas( view->vieworg );
|
||||
|
||||
|
||||
#if 0
|
||||
static int lastFrame = 0;
|
||||
static idVec3 lastFrameVec( 0.0f, 0.0f, 0.0f );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -75,7 +75,7 @@ idTarget_EndLevel::~idTarget_EndLevel()
|
|||
================
|
||||
*/
|
||||
idTarget_EndLevel::~idTarget_EndLevel() {
|
||||
//FIXME: need to go to smart ptrs for gui allocs or the unique method
|
||||
//FIXME: need to go to smart ptrs for gui allocs or the unique method
|
||||
//delete gui;
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ void idTarget_EndLevel::Event_Trigger( idEntity *activator ) {
|
|||
if ( gameLocal.endLevel ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// mark the endLevel, which will modify some game actions
|
||||
// and pass control to us for drawing the stats and camera position
|
||||
gameLocal.endLevel = this;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -63,4 +63,3 @@ private:
|
|||
|
||||
void Event_Trigger( idEntity *activator );
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -160,8 +160,8 @@ ABSTRACT_DECLARATION( idClass, idEntity )
|
|||
EVENT( EV_GetMins, idEntity::Event_GetMins)
|
||||
EVENT( EV_GetMaxs, idEntity::Event_GetMaxs )
|
||||
EVENT( EV_Touches, idEntity::Event_Touches )
|
||||
EVENT( EV_SetGuiParm, idEntity::Event_SetGuiParm )
|
||||
EVENT( EV_SetGuiFloat, idEntity::Event_SetGuiFloat )
|
||||
EVENT( EV_SetGuiParm, idEntity::Event_SetGuiParm )
|
||||
EVENT( EV_SetGuiFloat, idEntity::Event_SetGuiFloat )
|
||||
EVENT( EV_GetNextKey, idEntity::Event_GetNextKey )
|
||||
EVENT( EV_SetKey, idEntity::Event_SetKey )
|
||||
EVENT( EV_GetKey, idEntity::Event_GetKey )
|
||||
|
@ -490,7 +490,7 @@ void idEntity::Spawn( void ) {
|
|||
gameEdit->ParseSpawnArgsToRenderEntity( &spawnArgs, &renderEntity );
|
||||
|
||||
renderEntity.entityNum = entityNumber;
|
||||
|
||||
|
||||
#ifdef _D3XP
|
||||
noGrab = spawnArgs.GetBool( "noGrab", "0" );
|
||||
|
||||
|
@ -778,7 +778,7 @@ void idEntity::Restore( idRestoreGame *savefile ) {
|
|||
|
||||
savefile->Read( &fl, sizeof( fl ) );
|
||||
LittleBitField( &fl, sizeof( fl ) );
|
||||
|
||||
|
||||
#ifdef _D3XP
|
||||
savefile->ReadInt( timeGroup );
|
||||
savefile->ReadBool( noGrab );
|
||||
|
@ -880,7 +880,7 @@ const char * idEntity::GetName( void ) const {
|
|||
/***********************************************************************
|
||||
|
||||
Thinking
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -945,7 +945,7 @@ off from the player can skip all of their work
|
|||
*/
|
||||
bool idEntity::CheckDormant( void ) {
|
||||
bool dormant;
|
||||
|
||||
|
||||
dormant = DoDormantTests();
|
||||
if ( dormant && !fl.isDormant ) {
|
||||
fl.isDormant = true;
|
||||
|
@ -1056,7 +1056,7 @@ void idEntity::BecomeInactive( int flags ) {
|
|||
/***********************************************************************
|
||||
|
||||
Visuals
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -1600,7 +1600,7 @@ renderView_t *idEntity::GetRenderView( void ) {
|
|||
/***********************************************************************
|
||||
|
||||
Sound
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -1794,7 +1794,7 @@ void idEntity::FreeSoundEmitter( bool immediate ) {
|
|||
/***********************************************************************
|
||||
|
||||
entity binding
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -2429,13 +2429,13 @@ void idEntity::JoinTeam( idEntity *teammember ) {
|
|||
ent->teamChain->teamMaster = master;
|
||||
}
|
||||
|
||||
prev->teamChain = this;
|
||||
prev->teamChain = this;
|
||||
ent->teamChain = next;
|
||||
}
|
||||
|
||||
teamMaster = master;
|
||||
|
||||
// reorder the active entity list
|
||||
// reorder the active entity list
|
||||
gameLocal.sortTeamMasters = true;
|
||||
}
|
||||
|
||||
|
@ -2490,7 +2490,7 @@ void idEntity::QuitTeam( void ) {
|
|||
/***********************************************************************
|
||||
|
||||
Physics.
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -2947,7 +2947,7 @@ void idEntity::RemoveContactEntity( idEntity *ent ) {
|
|||
/***********************************************************************
|
||||
|
||||
Damage
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -2959,9 +2959,9 @@ explosions and melee attacks.
|
|||
============
|
||||
*/
|
||||
bool idEntity::CanDamage( const idVec3 &origin, idVec3 &damagePoint ) const {
|
||||
idVec3 dest;
|
||||
idVec3 dest;
|
||||
trace_t tr;
|
||||
idVec3 midpoint;
|
||||
idVec3 midpoint;
|
||||
|
||||
// use the midpoint of the bounds instead of the origin, because
|
||||
// bmodels may have their origin at 0,0,0
|
||||
|
@ -3058,7 +3058,7 @@ inflictor, attacker, dir, and point can be NULL for environmental effects
|
|||
|
||||
============
|
||||
*/
|
||||
void idEntity::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir,
|
||||
void idEntity::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir,
|
||||
const char *damageDefName, const float damageScale, const int location ) {
|
||||
if ( !fl.takedamage ) {
|
||||
return;
|
||||
|
@ -3167,7 +3167,7 @@ void idEntity::Killed( idEntity *inflictor, idEntity *attacker, int damage, cons
|
|||
/***********************************************************************
|
||||
|
||||
Script functions
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -3402,7 +3402,7 @@ void idEntity::SignalEvent( idThread *thread, signalNum_t signalnum ) {
|
|||
/***********************************************************************
|
||||
|
||||
Guis.
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
|
@ -3599,7 +3599,7 @@ bool idEntity::HandleSingleGuiCommand( idEntity *entityGui, idLexer *src ) {
|
|||
/***********************************************************************
|
||||
|
||||
Targets
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -3650,7 +3650,7 @@ idEntity::ActivateTargets
|
|||
void idEntity::ActivateTargets( idEntity *activator ) const {
|
||||
idEntity *ent;
|
||||
int i, j;
|
||||
|
||||
|
||||
for( i = 0; i < targets.Num(); i++ ) {
|
||||
ent = targets[ i ].GetEntity();
|
||||
if ( !ent ) {
|
||||
|
@ -3659,7 +3659,7 @@ void idEntity::ActivateTargets( idEntity *activator ) const {
|
|||
if ( ent->RespondsTo( EV_Activate ) || ent->HasSignal( SIG_TRIGGER ) ) {
|
||||
ent->Signal( SIG_TRIGGER );
|
||||
ent->ProcessEvent( &EV_Activate, activator );
|
||||
}
|
||||
}
|
||||
for ( j = 0; j < MAX_RENDERENTITY_GUI; j++ ) {
|
||||
if ( ent->renderEntity.gui[ j ] ) {
|
||||
ent->renderEntity.gui[ j ]->Trigger( gameLocal.time );
|
||||
|
@ -3671,7 +3671,7 @@ void idEntity::ActivateTargets( idEntity *activator ) const {
|
|||
/***********************************************************************
|
||||
|
||||
Misc.
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -3803,7 +3803,7 @@ void idEntity::ShowEditingDialog( void ) {
|
|||
/***********************************************************************
|
||||
|
||||
Events
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -3970,7 +3970,7 @@ void idEntity::Event_SpawnBind( void ) {
|
|||
const idAnim *anim;
|
||||
int animNum;
|
||||
idAnimator *parentAnimator;
|
||||
|
||||
|
||||
if ( spawnArgs.GetString( "bind", "", &bind ) ) {
|
||||
if ( idStr::Icmp( bind, "worldspawn" ) == 0 ) {
|
||||
//FIXME: Completely unneccessary since the worldspawn is called "world"
|
||||
|
@ -4175,12 +4175,12 @@ void idEntity::Event_StopSound( int channel, int netSync ) {
|
|||
|
||||
/*
|
||||
================
|
||||
idEntity::Event_StartSound
|
||||
idEntity::Event_StartSound
|
||||
================
|
||||
*/
|
||||
void idEntity::Event_StartSound( const char *soundName, int channel, int netSync ) {
|
||||
int time;
|
||||
|
||||
|
||||
StartSound( soundName, ( s_channelType )channel, 0, ( netSync != 0 ), &time );
|
||||
idThread::ReturnFloat( MS2SEC( time ) );
|
||||
}
|
||||
|
@ -4499,9 +4499,9 @@ void idEntity::Event_RestorePosition( void ) {
|
|||
if ( spawnArgs.GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", axis ) ) {
|
||||
angles = axis.ToAngles();
|
||||
} else {
|
||||
angles[ 0 ] = 0;
|
||||
angles[ 1 ] = spawnArgs.GetFloat( "angle" );
|
||||
angles[ 2 ] = 0;
|
||||
angles[ 0 ] = 0;
|
||||
angles[ 1 ] = spawnArgs.GetFloat( "angle" );
|
||||
angles[ 2 ] = 0;
|
||||
}
|
||||
|
||||
Teleport( org, angles, NULL );
|
||||
|
@ -4543,7 +4543,7 @@ void idEntity::Event_UpdateCameraTarget( void ) {
|
|||
dir.Normalize();
|
||||
cameraTarget->SetAxis( dir.ToMat3() );
|
||||
SetAxis(dir.ToMat3());
|
||||
break;
|
||||
break;
|
||||
}
|
||||
kv = cameraTarget->spawnArgs.MatchPrefix( "target", kv );
|
||||
}
|
||||
|
@ -4592,7 +4592,7 @@ idEntity::Event_WaitFrame
|
|||
*/
|
||||
void idEntity::Event_WaitFrame( void ) {
|
||||
idThread *thread;
|
||||
|
||||
|
||||
thread = idThread::CurrentThread();
|
||||
if ( thread ) {
|
||||
thread->WaitFrame();
|
||||
|
@ -4735,7 +4735,7 @@ void idEntity::Event_GuiNamedEvent(int guiNum, const char *event) {
|
|||
/***********************************************************************
|
||||
|
||||
Network
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -4909,7 +4909,7 @@ void idEntity::ServerSendEvent( int eventId, const idBitMsg *msg, bool saveEvent
|
|||
|
||||
outMsg.Init( msgBuf, sizeof( msgBuf ) );
|
||||
outMsg.BeginWriting();
|
||||
outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT );
|
||||
outMsg.WriteByte( GAME_RELIABLE_MESSAGE_EVENT );
|
||||
outMsg.WriteBits( gameLocal.GetSpawnId( this ), 32 );
|
||||
outMsg.WriteByte( eventId );
|
||||
outMsg.WriteLong( gameLocal.time );
|
||||
|
@ -5281,7 +5281,7 @@ bool idAnimatedEntity::GetJointTransformForAnim( jointHandle_t jointHandle, int
|
|||
|
||||
offset = frame[ jointHandle ].ToVec3();
|
||||
axis = frame[ jointHandle ].ToMat3();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -484,7 +484,7 @@ private:
|
|||
===============================================================================
|
||||
|
||||
Animated entity base class.
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -536,12 +536,12 @@ protected:
|
|||
|
||||
private:
|
||||
void Event_GetJointHandle( const char *jointname );
|
||||
void Event_ClearAllJoints( void );
|
||||
void Event_ClearJoint( jointHandle_t jointnum );
|
||||
void Event_SetJointPos( jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos );
|
||||
void Event_SetJointAngle( jointHandle_t jointnum, jointModTransform_t transform_type, const idAngles &angles );
|
||||
void Event_GetJointPos( jointHandle_t jointnum );
|
||||
void Event_GetJointAngle( jointHandle_t jointnum );
|
||||
void Event_ClearAllJoints( void );
|
||||
void Event_ClearJoint( jointHandle_t jointnum );
|
||||
void Event_SetJointPos( jointHandle_t jointnum, jointModTransform_t transform_type, const idVec3 &pos );
|
||||
void Event_SetJointAngle( jointHandle_t jointnum, jointModTransform_t transform_type, const idAngles &angles );
|
||||
void Event_GetJointPos( jointHandle_t jointnum );
|
||||
void Event_GetJointAngle( jointHandle_t jointnum );
|
||||
};
|
||||
|
||||
|
||||
|
|
18
d3xp/Fx.cpp
18
d3xp/Fx.cpp
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -43,7 +43,7 @@ const idEventDef EV_Fx_KillFx( "_killfx" );
|
|||
const idEventDef EV_Fx_Action( "_fxAction", "e" ); // implemented by subclasses
|
||||
|
||||
CLASS_DECLARATION( idEntity, idEntityFx )
|
||||
EVENT( EV_Activate, idEntityFx::Event_Trigger )
|
||||
EVENT( EV_Activate, idEntityFx::Event_Trigger )
|
||||
EVENT( EV_Fx_KillFx, idEntityFx::Event_ClearFx )
|
||||
END_CLASS
|
||||
|
||||
|
@ -217,7 +217,7 @@ void idEntityFx::CleanUp( void ) {
|
|||
for( int i = 0; i < fxEffect->events.Num(); i++ ) {
|
||||
const idFXSingleAction& fxaction = fxEffect->events[i];
|
||||
idFXLocalAction& laction = actions[i];
|
||||
CleanUpSingleAction( fxaction, laction );
|
||||
CleanUpSingleAction( fxaction, laction );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -319,7 +319,7 @@ void idEntityFx::ApplyFade( const idFXSingleAction& fxaction, idFXLocalAction& l
|
|||
laction.renderEntity.shaderParms[SHADERPARM_RED] = (fxaction.fadeInTime) ? fadePct : 1.0f - fadePct;
|
||||
laction.renderEntity.shaderParms[SHADERPARM_GREEN] = (fxaction.fadeInTime) ? fadePct : 1.0f - fadePct;
|
||||
laction.renderEntity.shaderParms[SHADERPARM_BLUE] = (fxaction.fadeInTime) ? fadePct : 1.0f - fadePct;
|
||||
|
||||
|
||||
gameRenderWorld->UpdateEntityDef( laction.modelDefHandle, &laction.renderEntity );
|
||||
}
|
||||
if ( laction.lightDefHandle != -1 ) {
|
||||
|
@ -383,7 +383,7 @@ void idEntityFx::Run( int time ) {
|
|||
}
|
||||
laction.delay = totalDelay;
|
||||
laction.start = time;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ void idEntityFx::Run( int time ) {
|
|||
case FX_DECAL: {
|
||||
if ( !useAction->decalDropped ) {
|
||||
useAction->decalDropped = true;
|
||||
gameLocal.ProjectDecal( GetPhysics()->GetOrigin(), GetPhysics()->GetGravity(), 8.0f, true, fxaction.size, fxaction.data );
|
||||
gameLocal.ProjectDecal( GetPhysics()->GetOrigin(), GetPhysics()->GetGravity(), 8.0f, true, fxaction.size, fxaction.data );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -789,8 +789,8 @@ idEntityFx::ClientPredictionThink
|
|||
=================
|
||||
*/
|
||||
void idEntityFx::ClientPredictionThink( void ) {
|
||||
if ( gameLocal.isNewFrame ) {
|
||||
Run( gameLocal.time );
|
||||
if ( gameLocal.isNewFrame ) {
|
||||
Run( gameLocal.time );
|
||||
}
|
||||
RunPhysics();
|
||||
Present();
|
||||
|
@ -800,7 +800,7 @@ void idEntityFx::ClientPredictionThink( void ) {
|
|||
===============================================================================
|
||||
|
||||
idTeleporter
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -241,7 +241,7 @@ public:
|
|||
|
||||
// Animation system calls for non-game based skeletal rendering.
|
||||
virtual idRenderModel * ANIM_GetModelFromEntityDef( const char *classname );
|
||||
virtual const idVec3 &ANIM_GetModelOffsetFromEntityDef( const char *classname );
|
||||
virtual const idVec3 &ANIM_GetModelOffsetFromEntityDef( const char *classname );
|
||||
virtual idRenderModel * ANIM_GetModelFromEntityDef( const idDict *args );
|
||||
virtual idRenderModel * ANIM_GetModelFromName( const char *modelName );
|
||||
virtual const idMD5Anim * ANIM_GetAnimFromEntityDef( const char *classname, const char *animname );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -176,7 +176,7 @@ void idDragEntity::Update( idPlayer *player ) {
|
|||
player->GetViewPos( viewPoint, viewAxis );
|
||||
|
||||
// if no entity selected for dragging
|
||||
if ( !dragEnt.GetEntity() ) {
|
||||
if ( !dragEnt.GetEntity() ) {
|
||||
|
||||
if ( player->usercmd.buttons & BUTTON_ATTACK ) {
|
||||
|
||||
|
@ -470,7 +470,7 @@ idEditEntities::RemoveSelectedEntity
|
|||
==============
|
||||
*/
|
||||
void idEditEntities::RemoveSelectedEntity( idEntity *ent ) {
|
||||
if ( selectedEntities.Find( ent ) ) {
|
||||
if ( selectedEntities.Find( ent ) ) {
|
||||
selectedEntities.Remove( ent );
|
||||
}
|
||||
}
|
||||
|
@ -751,7 +751,7 @@ idGameEdit::FindEntity
|
|||
================
|
||||
*/
|
||||
idEntity *idGameEdit::FindEntity( const char *name ) const {
|
||||
return gameLocal.FindEntity( name );
|
||||
return gameLocal.FindEntity( name );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -876,7 +876,7 @@ void idGameEdit::EntityChangeSpawnArgs( idEntity *ent, const idDict *newArgs ) {
|
|||
if ( ent ) {
|
||||
for ( int i = 0 ; i < newArgs->GetNumKeyVals () ; i ++ ) {
|
||||
const idKeyValue *kv = newArgs->GetKeyVal( i );
|
||||
|
||||
|
||||
if ( kv->GetValue().Length() > 0 ) {
|
||||
ent->spawnArgs.Set ( kv->GetKey() ,kv->GetValue() );
|
||||
} else {
|
||||
|
@ -1107,7 +1107,7 @@ int idGameEdit::MapGetEntitiesMatchingClassWithString( const char *classname, co
|
|||
if (ent) {
|
||||
idStr work = ent->epairs.GetString("classname");
|
||||
if ( work.Icmp( classname ) == 0 ) {
|
||||
if ( match && *match ) {
|
||||
if ( match && *match ) {
|
||||
work = ent->epairs.GetString( "soundgroup" );
|
||||
if ( count < max && work.Icmp( match ) == 0 ) {
|
||||
list[count++] = ent->epairs.GetString( "name" );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -352,7 +352,7 @@ void idGameLocal::Init( void ) {
|
|||
|
||||
// load default scripts
|
||||
program.Startup( SCRIPT_DEFAULT );
|
||||
|
||||
|
||||
#ifdef _D3XP
|
||||
//BSM Nerve: Loads a game specific main script file
|
||||
idStr gamedir;
|
||||
|
@ -363,7 +363,7 @@ void idGameLocal::Init( void ) {
|
|||
} else if ( i == 1 ) {
|
||||
gamedir = cvarSystem->GetCVarString( "fs_game" );
|
||||
}
|
||||
if( gamedir.Length() > 0 ) {
|
||||
if( gamedir.Length() > 0 ) {
|
||||
idStr scriptFile = va( "script/%s_main.script", gamedir.c_str() );
|
||||
if ( fileSystem->ReadFile( scriptFile.c_str(), NULL ) > 0 ) {
|
||||
program.CompileFile( scriptFile.c_str() );
|
||||
|
@ -486,7 +486,7 @@ void idGameLocal::SaveGame( idFile *f ) {
|
|||
|
||||
idSaveGame savegame( f );
|
||||
|
||||
if (g_flushSave.GetBool( ) == true ) {
|
||||
if (g_flushSave.GetBool( ) == true ) {
|
||||
// force flushing with each write... for tracking down
|
||||
// save game bugs.
|
||||
f->ForceFlush();
|
||||
|
@ -844,7 +844,7 @@ const idDict* idGameLocal::SetUserInfo( int clientNum, const idDict &userInfo, b
|
|||
idGameLocal::userInfo[ clientNum ].Set( "ui_name", va( "%s_", idGameLocal::userInfo[ clientNum ].GetString( "ui_name" ) ) );
|
||||
modifiedInfo = true;
|
||||
}
|
||||
|
||||
|
||||
// don't allow dupe nicknames
|
||||
for ( i = 0; i < numClients; i++ ) {
|
||||
if ( i == clientNum ) {
|
||||
|
@ -959,7 +959,7 @@ void idGameLocal::LoadMap( const char *mapName, int randseed ) {
|
|||
memset( usercmds, 0, sizeof( usercmds ) );
|
||||
memset( spawnIds, -1, sizeof( spawnIds ) );
|
||||
spawnCount = INITIAL_SPAWN_COUNT;
|
||||
|
||||
|
||||
spawnedEntities.Clear();
|
||||
activeEntities.Clear();
|
||||
numEntitiesToDeactivate = 0;
|
||||
|
@ -988,7 +988,7 @@ void idGameLocal::LoadMap( const char *mapName, int randseed ) {
|
|||
|
||||
lastAIAlertEntity = NULL;
|
||||
lastAIAlertTime = 0;
|
||||
|
||||
|
||||
previousTime = 0;
|
||||
time = 0;
|
||||
framenum = 0;
|
||||
|
@ -1131,7 +1131,7 @@ void idGameLocal::MapRestart( ) {
|
|||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
if ( isClient ) {
|
||||
LocalMapRestart();
|
||||
} else {
|
||||
|
@ -1628,7 +1628,7 @@ idGameLocal::MapShutdown
|
|||
*/
|
||||
void idGameLocal::MapShutdown( void ) {
|
||||
Printf( "--------- Game Map Shutdown ----------\n" );
|
||||
|
||||
|
||||
gamestate = GAMESTATE_SHUTDOWN;
|
||||
|
||||
if ( gameRenderWorld ) {
|
||||
|
@ -1867,7 +1867,7 @@ void idGameLocal::CacheDictionaryMedia( const idDict *dict ) {
|
|||
while( kv ) {
|
||||
if ( kv->GetValue().Length() ) {
|
||||
if ( !idStr::Icmp( kv->GetKey(), "gui_noninteractive" )
|
||||
|| !idStr::Icmpn( kv->GetKey(), "gui_parm", 8 )
|
||||
|| !idStr::Icmpn( kv->GetKey(), "gui_parm", 8 )
|
||||
|| !idStr::Icmp( kv->GetKey(), "gui_inventory" ) ) {
|
||||
// unfortunate flag names, they aren't actually a gui
|
||||
} else {
|
||||
|
@ -2240,7 +2240,7 @@ bool idGameLocal::InPlayerPVS( idEntity *ent ) const {
|
|||
if ( playerPVS.i == -1 ) {
|
||||
return false;
|
||||
}
|
||||
return pvs.InCurrentPVS( playerPVS, ent->GetPVSAreas(), ent->GetNumPVSAreas() );
|
||||
return pvs.InCurrentPVS( playerPVS, ent->GetPVSAreas(), ent->GetNumPVSAreas() );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2254,7 +2254,7 @@ bool idGameLocal::InPlayerConnectedArea( idEntity *ent ) const {
|
|||
if ( playerConnectedAreas.i == -1 ) {
|
||||
return false;
|
||||
}
|
||||
return pvs.InCurrentPVS( playerConnectedAreas, ent->GetPVSAreas(), ent->GetNumPVSAreas() );
|
||||
return pvs.InCurrentPVS( playerConnectedAreas, ent->GetPVSAreas(), ent->GetNumPVSAreas() );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2269,7 +2269,7 @@ void idGameLocal::UpdateGravity( void ) {
|
|||
if ( g_gravity.GetFloat() == 0.0f ) {
|
||||
g_gravity.SetFloat( 1.0f );
|
||||
}
|
||||
gravity.Set( 0, 0, -g_gravity.GetFloat() );
|
||||
gravity.Set( 0, 0, -g_gravity.GetFloat() );
|
||||
|
||||
// update all physics objects
|
||||
for( ent = spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next() ) {
|
||||
|
@ -2385,7 +2385,7 @@ void idGameLocal::RunTimeGroup2() {
|
|||
slow.Get( time, previousTime, msec, framenum, realClientTime );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
idGameLocal::RunFrame
|
||||
|
@ -2611,7 +2611,7 @@ gameReturn_t idGameLocal::RunFrame( const usercmd_t *clientCmds ) {
|
|||
ret.syncNextGameFrame = skipCinematic;
|
||||
if ( skipCinematic ) {
|
||||
soundSystem->SetMute( false );
|
||||
skipCinematic = false;
|
||||
skipCinematic = false;
|
||||
}
|
||||
|
||||
// show any debug info for this frame
|
||||
|
@ -2642,7 +2642,7 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const {
|
|||
float y;
|
||||
float ratio_x;
|
||||
float ratio_y;
|
||||
|
||||
|
||||
if ( !sys->FPU_StackIsEmpty() ) {
|
||||
Printf( sys->FPU_GetState() );
|
||||
Error( "idGameLocal::CalcFov: FPU stack not empty" );
|
||||
|
@ -3255,7 +3255,7 @@ idEntity *idGameLocal::SpawnEntityType( const idTypeInfo &classdef, const idDict
|
|||
obj = classdef.CreateInstance();
|
||||
obj->CallSpawn();
|
||||
}
|
||||
|
||||
|
||||
catch( idAllocError & ) {
|
||||
obj = NULL;
|
||||
}
|
||||
|
@ -3392,7 +3392,7 @@ idGameLocal::InhibitEntitySpawn
|
|||
================
|
||||
*/
|
||||
bool idGameLocal::InhibitEntitySpawn( idDict &spawnArgs ) {
|
||||
|
||||
|
||||
bool result = false;
|
||||
|
||||
if ( isMultiplayer ) {
|
||||
|
@ -3413,7 +3413,7 @@ bool idGameLocal::InhibitEntitySpawn( idDict &spawnArgs ) {
|
|||
|
||||
const char *name;
|
||||
#ifndef ID_DEMO_BUILD
|
||||
if ( g_skill.GetInteger() == 3 ) {
|
||||
if ( g_skill.GetInteger() == 3 ) {
|
||||
name = spawnArgs.GetString( "classname" );
|
||||
// _D3XP :: remove moveable medkit packs also
|
||||
if ( idStr::Icmp( name, "item_medkit" ) == 0 || idStr::Icmp( name, "item_medkit_small" ) == 0 ||
|
||||
|
@ -3575,7 +3575,7 @@ int idGameLocal::GetTargets( const idDict &args, idList< idEntityPtr<idEntity> >
|
|||
ent = FindEntity( arg->GetValue() );
|
||||
if ( ent ) {
|
||||
idEntityPtr<idEntity> &entityPtr = list.Alloc();
|
||||
entityPtr = ent;
|
||||
entityPtr = ent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3844,7 +3844,7 @@ void idGameLocal::RadiusDamage( const idVec3 &origin, idEntity *inflictor, idEnt
|
|||
idEntity * entityList[ MAX_GENTITIES ];
|
||||
int numListedEntities;
|
||||
idBounds bounds;
|
||||
idVec3 v, damagePoint, dir;
|
||||
idVec3 v, damagePoint, dir;
|
||||
int i, e, damage, radius, push;
|
||||
|
||||
const idDict *damageDef = FindEntityDefDict( damageDefName, false );
|
||||
|
@ -3929,7 +3929,7 @@ void idGameLocal::RadiusDamage( const idVec3 &origin, idEntity *inflictor, idEnt
|
|||
}
|
||||
|
||||
ent->Damage( inflictor, attacker, dir, damageDefName, damageScale, INVALID_JOINT );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// push physics objects
|
||||
|
@ -4180,7 +4180,7 @@ void idGameLocal::SetCamera( idCamera *cam ) {
|
|||
|
||||
// set r_znear so that transitioning into/out of the player's head doesn't clip through the view
|
||||
cvarSystem->SetCVarFloat( "r_znear", 1.0f );
|
||||
|
||||
|
||||
// hide all the player models
|
||||
for( i = 0; i < numClients; i++ ) {
|
||||
if ( entities[ i ] ) {
|
||||
|
@ -4196,7 +4196,7 @@ void idGameLocal::SetCamera( idCamera *cam ) {
|
|||
// only kill entities that aren't needed for cinematics and aren't dormant
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ( ent->IsType( idAI::Type ) ) {
|
||||
ai = static_cast<idAI *>( ent );
|
||||
if ( !ai->GetEnemy() || !ai->IsActive() ) {
|
||||
|
@ -4400,7 +4400,7 @@ void idGameLocal::RandomizeInitialSpawns( void ) {
|
|||
#ifdef CTF
|
||||
int k;
|
||||
#endif
|
||||
|
||||
|
||||
idEntity *ent;
|
||||
|
||||
if ( !isMultiplayer || isClient ) {
|
||||
|
@ -4414,7 +4414,7 @@ void idGameLocal::RandomizeInitialSpawns( void ) {
|
|||
teamInitialSpots[0].Clear();
|
||||
teamInitialSpots[1].Clear();
|
||||
#endif
|
||||
|
||||
|
||||
spot.dist = 0;
|
||||
spot.ent = FindEntityUsingDef( NULL, "info_player_deathmatch" );
|
||||
while( spot.ent ) {
|
||||
|
@ -4428,7 +4428,7 @@ void idGameLocal::RandomizeInitialSpawns( void ) {
|
|||
else
|
||||
common->Warning( "info_player_deathmatch : invalid or no team attached to spawn point\n");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
spawnSpots.Append( spot );
|
||||
if ( spot.ent->spawnArgs.GetBool( "initial" ) ) {
|
||||
#ifdef CTF
|
||||
|
@ -4438,7 +4438,7 @@ void idGameLocal::RandomizeInitialSpawns( void ) {
|
|||
teamInitialSpots[ spot.team ].Append( spot.ent );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
initialSpots.Append( spot.ent );
|
||||
}
|
||||
spot.ent = FindEntityUsingDef( spot.ent, "info_player_deathmatch" );
|
||||
|
@ -4456,7 +4456,7 @@ void idGameLocal::RandomizeInitialSpawns( void ) {
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if ( !spawnSpots.Num() ) {
|
||||
common->Warning( "no info_player_deathmatch in map" );
|
||||
return;
|
||||
|
@ -4485,7 +4485,7 @@ void idGameLocal::RandomizeInitialSpawns( void ) {
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
common->Printf( "%d spawns (%d initials)\n", spawnSpots.Num(), initialSpots.Num() );
|
||||
// if there are no initial spots in the map, consider they can all be used as initial
|
||||
if ( !initialSpots.Num() ) {
|
||||
|
@ -4504,7 +4504,7 @@ void idGameLocal::RandomizeInitialSpawns( void ) {
|
|||
teamInitialSpots[ k ][ j ] = ent;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
for ( i = 0; i < initialSpots.Num(); i++ ) {
|
||||
j = random.RandomInt( initialSpots.Num() );
|
||||
ent = initialSpots[ i ];
|
||||
|
@ -4557,7 +4557,7 @@ idEntity *idGameLocal::SelectInitialSpawnPoint( idPlayer *player ) {
|
|||
useInitialSpots = player->useInitialSpawns && currentInitialSpot < initialSpots.Num();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if ( player->spectating ) {
|
||||
// plain random spot, don't bother
|
||||
return spawnSpots[ random.RandomInt( spawnSpots.Num() ) ].ent;
|
||||
|
@ -4619,7 +4619,7 @@ idEntity *idGameLocal::SelectInitialSpawnPoint( idPlayer *player ) {
|
|||
|| static_cast< idPlayer * >( entities[ j ] )->spectating ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
dist = ( pos - entities[ j ]->GetPhysics()->GetOrigin() ).LengthSqr();
|
||||
if ( dist < teamSpawnSpots[ team ][ i ].dist ) {
|
||||
teamSpawnSpots[ team ][ i ].dist = dist;
|
||||
|
@ -4638,7 +4638,7 @@ idEntity *idGameLocal::SelectInitialSpawnPoint( idPlayer *player ) {
|
|||
return spot.ent;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// find the distance to the closest active player for each spawn spot
|
||||
for( i = 0; i < spawnSpots.Num(); i++ ) {
|
||||
pos = spawnSpots[ i ].ent->GetPhysics()->GetOrigin();
|
||||
|
@ -4649,7 +4649,7 @@ idEntity *idGameLocal::SelectInitialSpawnPoint( idPlayer *player ) {
|
|||
|| static_cast< idPlayer * >( entities[ j ] )->spectating ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
dist = ( pos - entities[ j ]->GetPhysics()->GetOrigin() ).LengthSqr();
|
||||
if ( dist < spawnSpots[ i ].dist ) {
|
||||
spawnSpots[ i ].dist = dist;
|
||||
|
@ -4688,7 +4688,7 @@ void idGameLocal::UpdateServerInfoFlags() {
|
|||
gameType = GAME_CTF;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if ( gameType == GAME_LASTMAN ) {
|
||||
if ( !serverInfo.GetInt( "si_warmup" ) ) {
|
||||
common->Warning( "Last Man Standing - forcing warmup on" );
|
||||
|
@ -4923,12 +4923,12 @@ idGameLocal::NeedRestart
|
|||
===============
|
||||
*/
|
||||
bool idGameLocal::NeedRestart() {
|
||||
|
||||
|
||||
idDict newInfo;
|
||||
const idKeyValue *keyval, *keyval2;
|
||||
|
||||
newInfo = *cvarSystem->MoveCVarsToDict( CVAR_SERVERINFO );
|
||||
|
||||
|
||||
for ( int i = 0; i < newInfo.GetNumKeyVals(); i++ ) {
|
||||
keyval = newInfo.GetKeyVal( i );
|
||||
keyval2 = serverInfo.FindKey( keyval->GetKey() );
|
||||
|
@ -4983,4 +4983,3 @@ idGameLocal::GetMapLoadingGUI
|
|||
===============
|
||||
*/
|
||||
void idGameLocal::GetMapLoadingGUI( char gui[ MAX_STRING_CHARS ] ) { }
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -181,8 +181,8 @@ typedef struct {
|
|||
idEntity *ent;
|
||||
int dist;
|
||||
#ifdef CTF
|
||||
int team;
|
||||
#endif
|
||||
int team;
|
||||
#endif
|
||||
} spawnSpot_t;
|
||||
|
||||
//============================================================================
|
||||
|
@ -286,7 +286,7 @@ public:
|
|||
idDict persistentLevelInfo; // contains args that are kept around between levels
|
||||
|
||||
// can be used to automatically effect every material in the world that references globalParms
|
||||
float globalShaderParms[ MAX_GLOBAL_SHADER_PARMS ];
|
||||
float globalShaderParms[ MAX_GLOBAL_SHADER_PARMS ];
|
||||
|
||||
idRandom random; // random number generator used throughout the game
|
||||
|
||||
|
@ -300,7 +300,7 @@ public:
|
|||
idTestModel * testmodel; // for development testing of models
|
||||
idEntityFx * testFx; // for development testing of fx
|
||||
|
||||
idStr sessionCommand; // a target_sessionCommand can set this to return something to the session
|
||||
idStr sessionCommand; // a target_sessionCommand can set this to return something to the session
|
||||
|
||||
idMultiplayerGame mpGame; // handles rules for standard dm
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -566,7 +566,7 @@ void idGameLocal::ServerWriteSnapshot( int clientNum, int sequence, idBitMsg &ms
|
|||
} else {
|
||||
spectated = player;
|
||||
}
|
||||
|
||||
|
||||
// free too old snapshots
|
||||
FreeSnapshotsOlderThanSequence( clientNum, sequence - 64 );
|
||||
|
||||
|
@ -749,7 +749,7 @@ void idGameLocal::ServerProcessEntityNetworkEventQueue( void ) {
|
|||
}
|
||||
|
||||
idEntityPtr< idEntity > entPtr;
|
||||
|
||||
|
||||
if( !entPtr.SetSpawnId( event->spawnId ) ) {
|
||||
NetworkEventWarning( event, "Entity does not exist any longer, or has not been spawned yet." );
|
||||
} else {
|
||||
|
@ -1294,7 +1294,7 @@ void idGameLocal::ClientProcessEntityNetworkEventQueue( void ) {
|
|||
}
|
||||
|
||||
idEntityPtr< idEntity > entPtr;
|
||||
|
||||
|
||||
if( !entPtr.SetSpawnId( event->spawnId ) ) {
|
||||
if( !gameLocal.entities[ event->spawnId & ( ( 1 << GENTITYNUM_BITS ) - 1 ) ] ) {
|
||||
// if new entity exists in this position, silently ignore
|
||||
|
@ -1573,7 +1573,7 @@ idGameLocal::Tokenize
|
|||
void idGameLocal::Tokenize( idStrList &out, const char *in ) {
|
||||
char buf[ MAX_STRING_CHARS ];
|
||||
char *token, *next;
|
||||
|
||||
|
||||
idStr::Copynz( buf, in, MAX_STRING_CHARS );
|
||||
token = buf;
|
||||
next = strchr( token, ';' );
|
||||
|
@ -1588,7 +1588,7 @@ void idGameLocal::Tokenize( idStrList &out, const char *in ) {
|
|||
next = strchr( token, ';' );
|
||||
} else {
|
||||
token = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1647,7 +1647,7 @@ bool idGameLocal::DownloadRequest( const char *IP, const char *guid, const char
|
|||
common->DPrintf( "download for %s: %s\n", IP, url.c_str() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
idStr::Copynz( urls, reply, MAX_STRING_CHARS );
|
||||
return true;
|
||||
}
|
||||
|
@ -1738,7 +1738,7 @@ entityNetEvent_t* idEventQueue::RemoveLast( void ) {
|
|||
if ( !end ) {
|
||||
start = NULL;
|
||||
} else {
|
||||
end->next = NULL;
|
||||
end->next = NULL;
|
||||
}
|
||||
|
||||
event->next = NULL;
|
||||
|
@ -1782,7 +1782,7 @@ void idEventQueue::Enqueue( entityNetEvent_t *event, outOfOrderBehaviour_t behav
|
|||
cur->next = event;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// add the new event
|
||||
event->next = NULL;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -341,7 +341,7 @@ void idGrabber::StopDrag( bool dropOnly ) {
|
|||
|
||||
aiEnt->Damage( thePlayer, thePlayer, vec3_origin, "damage_suicide", 1.0f, INVALID_JOINT );
|
||||
}
|
||||
|
||||
|
||||
af->SetThrown( !dropOnly );
|
||||
|
||||
// Reset timers so that it isn't forcibly put to rest in mid-air
|
||||
|
@ -451,7 +451,7 @@ int idGrabber::Update( idPlayer *player, bool hide ) {
|
|||
if ( !gameLocal.isMultiplayer && !abort && (( player->usercmd.flags & UCF_IMPULSE_SEQUENCE ) != ( oldUcmdFlags & UCF_IMPULSE_SEQUENCE )) && (player->usercmd.impulse == IMPULSE_13) ) {
|
||||
abort = true;
|
||||
}
|
||||
|
||||
|
||||
if ( abort ) {
|
||||
StopDrag( true );
|
||||
return 3;
|
||||
|
@ -461,7 +461,7 @@ int idGrabber::Update( idPlayer *player, bool hide ) {
|
|||
owner = player;
|
||||
|
||||
// if no entity selected for dragging
|
||||
if ( !dragEnt.GetEntity() ) {
|
||||
if ( !dragEnt.GetEntity() ) {
|
||||
idBounds bounds;
|
||||
idVec3 end = player->firstPersonViewOrigin + player->firstPersonViewAxis[0] * dragTraceDist;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -30,7 +30,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
/*
|
||||
===============================================================================
|
||||
|
||||
Grabber Object - Class to extend idWeapon to include functionality for
|
||||
Grabber Object - Class to extend idWeapon to include functionality for
|
||||
manipulating physics objects.
|
||||
|
||||
===============================================================================
|
||||
|
|
46
d3xp/IK.cpp
46
d3xp/IK.cpp
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -151,7 +151,7 @@ bool idIK::Init( idEntity *self, const char *anim, const idVec3 &modelOffset ) {
|
|||
self->name.c_str(), self->GetPhysics()->GetOrigin().ToString(0) );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
this->modelOffset = modelOffset;
|
||||
|
||||
return true;
|
||||
|
@ -296,40 +296,40 @@ idIK_Walk::Save
|
|||
*/
|
||||
void idIK_Walk::Save( idSaveGame *savefile ) const {
|
||||
int i;
|
||||
|
||||
|
||||
idIK::Save( savefile );
|
||||
|
||||
savefile->WriteClipModel( footModel );
|
||||
|
||||
savefile->WriteInt( numLegs );
|
||||
savefile->WriteInt( enabledLegs );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteInt( footJoints[i] );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteInt( ankleJoints[i] );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteInt( kneeJoints[i] );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteInt( hipJoints[i] );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteInt( dirJoints[i] );
|
||||
savefile->WriteInt( waistJoint );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteVec3( hipForward[i] );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteVec3( kneeForward[i] );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteFloat( upperLegLength[i] );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteFloat( lowerLegLength[i] );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteMat3( upperLegToHipJoint[i] );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->WriteMat3( lowerLegToKneeJoint[i] );
|
||||
|
||||
|
||||
savefile->WriteFloat( smoothing );
|
||||
savefile->WriteFloat( waistSmoothing );
|
||||
savefile->WriteFloat( footShift );
|
||||
|
@ -359,7 +359,7 @@ idIK_Walk::Restore
|
|||
*/
|
||||
void idIK_Walk::Restore( idRestoreGame *savefile ) {
|
||||
int i;
|
||||
|
||||
|
||||
idIK::Restore( savefile );
|
||||
|
||||
savefile->ReadClipModel( footModel );
|
||||
|
@ -377,22 +377,22 @@ void idIK_Walk::Restore( idRestoreGame *savefile ) {
|
|||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->ReadInt( (int&)dirJoints[i] );
|
||||
savefile->ReadInt( (int&)waistJoint );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->ReadVec3( hipForward[i] );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->ReadVec3( kneeForward[i] );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->ReadFloat( upperLegLength[i] );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->ReadFloat( lowerLegLength[i] );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->ReadMat3( upperLegToHipJoint[i] );
|
||||
for ( i = 0; i < MAX_LEGS; i++ )
|
||||
savefile->ReadMat3( lowerLegToKneeJoint[i] );
|
||||
|
||||
|
||||
savefile->ReadFloat( smoothing );
|
||||
savefile->ReadFloat( waistSmoothing );
|
||||
savefile->ReadFloat( footShift );
|
||||
|
@ -893,17 +893,17 @@ void idIK_Reach::Save( idSaveGame *savefile ) const {
|
|||
savefile->WriteInt( shoulderJoints[i] );
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->WriteInt( dirJoints[i] );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->WriteVec3( shoulderForward[i] );
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->WriteVec3( elbowForward[i] );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->WriteFloat( upperArmLength[i] );
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->WriteFloat( lowerArmLength[i] );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->WriteMat3( upperArmToShoulderJoint[i] );
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
|
@ -929,17 +929,17 @@ void idIK_Reach::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadInt( (int&)shoulderJoints[i] );
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->ReadInt( (int&)dirJoints[i] );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->ReadVec3( shoulderForward[i] );
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->ReadVec3( elbowForward[i] );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->ReadFloat( upperArmLength[i] );
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->ReadFloat( lowerArmLength[i] );
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
savefile->ReadMat3( upperArmToShoulderJoint[i] );
|
||||
for ( i = 0; i < MAX_ARMS; i++ )
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -69,7 +69,7 @@ protected:
|
|||
/*
|
||||
===============================================================================
|
||||
|
||||
IK controller for a walking character with an arbitrary number of legs.
|
||||
IK controller for a walking character with an arbitrary number of legs.
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
|
162
d3xp/Item.cpp
162
d3xp/Item.cpp
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -165,7 +165,7 @@ bool idItem::UpdateRenderEntity( renderEntity_s *renderEntity, const renderView_
|
|||
}
|
||||
}
|
||||
|
||||
// fade down after the last pulse finishes
|
||||
// fade down after the last pulse finishes
|
||||
if ( !inView && cycle > lastCycle ) {
|
||||
renderEntity->shaderParms[4] = 0.0f;
|
||||
} else {
|
||||
|
@ -224,7 +224,7 @@ void idItem::Think( void ) {
|
|||
SetAngles( ang );
|
||||
|
||||
float scale = 0.005f + entityNumber * 0.00001f;
|
||||
|
||||
|
||||
org = orgOrigin;
|
||||
org.z += 4.0f + cos( ( gameLocal.time + 2000 ) * scale ) * 4.0f;
|
||||
SetOrigin( org );
|
||||
|
@ -302,7 +302,7 @@ void idItem::Spawn( void ) {
|
|||
if ( spawnArgs.GetBool( "spin" ) || (gameLocal.isMultiplayer && !this->IsType( idItemTeam::Type ) ) ) {
|
||||
spin = true;
|
||||
BecomeActive( TH_THINK );
|
||||
}
|
||||
}
|
||||
#else
|
||||
if ( spawnArgs.GetBool( "spin" ) || gameLocal.isMultiplayer ) {
|
||||
spin = true;
|
||||
|
@ -352,8 +352,8 @@ bool idItem::GiveToPlayer( idPlayer *player ) {
|
|||
|
||||
if ( spawnArgs.GetBool( "inv_carry" ) ) {
|
||||
return player->GiveInventoryItem( &spawnArgs );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return player->GiveItem( this );
|
||||
}
|
||||
|
||||
|
@ -363,7 +363,7 @@ idItem::Pickup
|
|||
================
|
||||
*/
|
||||
bool idItem::Pickup( idPlayer *player ) {
|
||||
|
||||
|
||||
if ( !GiveToPlayer( player ) ) {
|
||||
return false;
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ bool idItem::Pickup( idPlayer *player ) {
|
|||
const char *sfx = spawnArgs.GetString( "fxRespawn" );
|
||||
if ( sfx && *sfx ) {
|
||||
PostEventSec( &EV_RespawnFx, respawn - 0.5f );
|
||||
}
|
||||
}
|
||||
PostEventSec( &EV_RespawnItem, respawn );
|
||||
} else if ( !spawnArgs.GetBool( "inv_objective" ) && !no_respawn ) {
|
||||
// give some time for the pickup sound to play
|
||||
|
@ -677,12 +677,12 @@ idItemTeam::idItemTeam
|
|||
===============
|
||||
*/
|
||||
idItemTeam::idItemTeam() {
|
||||
team = -1;
|
||||
team = -1;
|
||||
carried = false;
|
||||
dropped = false;
|
||||
lastDrop = 0;
|
||||
|
||||
itemGlowHandle = -1;
|
||||
itemGlowHandle = -1;
|
||||
|
||||
skinDefault = NULL;
|
||||
skinCarried = NULL;
|
||||
|
@ -710,7 +710,7 @@ idItemTeam::Spawn
|
|||
===============
|
||||
*/
|
||||
void idItemTeam::Spawn( void ) {
|
||||
team = spawnArgs.GetInt( "team" );
|
||||
team = spawnArgs.GetInt( "team" );
|
||||
returnOrigin = GetPhysics()->GetOrigin() + idVec3( 0, 0, 20 );
|
||||
returnAxis = GetPhysics()->GetAxis();
|
||||
|
||||
|
@ -829,18 +829,18 @@ idItemTeam::Pickup
|
|||
===============
|
||||
*/
|
||||
bool idItemTeam::Pickup( idPlayer *player ) {
|
||||
if ( !gameLocal.mpGame.IsGametypeFlagBased() ) /* CTF */
|
||||
return false;
|
||||
if ( !gameLocal.mpGame.IsGametypeFlagBased() ) /* CTF */
|
||||
return false;
|
||||
|
||||
if ( gameLocal.mpGame.GetGameState() == idMultiplayerGame::WARMUP ||
|
||||
gameLocal.mpGame.GetGameState() == idMultiplayerGame::COUNTDOWN )
|
||||
return false;
|
||||
if ( gameLocal.mpGame.GetGameState() == idMultiplayerGame::WARMUP ||
|
||||
gameLocal.mpGame.GetGameState() == idMultiplayerGame::COUNTDOWN )
|
||||
return false;
|
||||
|
||||
// wait 2 seconds after drop before beeing picked up again
|
||||
if ( lastDrop != 0 && (gameLocal.time - lastDrop) < spawnArgs.GetInt("pickupDelay", "500") )
|
||||
return false;
|
||||
|
||||
if ( carried == false && player->team != this->team ) {
|
||||
|
||||
if ( carried == false && player->team != this->team ) {
|
||||
|
||||
PostEventMS( &EV_TakeFlag, 0, player );
|
||||
|
||||
|
@ -864,10 +864,10 @@ idItemTeam::ClientReceiveEvent
|
|||
===============
|
||||
*/
|
||||
bool idItemTeam::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
|
||||
gameLocal.DPrintf("ClientRecieveEvent: %i\n", event );
|
||||
gameLocal.DPrintf("ClientRecieveEvent: %i\n", event );
|
||||
|
||||
switch ( event ) {
|
||||
case EVENT_TAKEFLAG: {
|
||||
case EVENT_TAKEFLAG: {
|
||||
idPlayer * player = static_cast<idPlayer *>(gameLocal.entities[ msg.ReadBits( GENTITYNUM_BITS ) ]);
|
||||
if ( player == NULL ) {
|
||||
gameLocal.Warning( "NULL player takes flag?\n" );
|
||||
|
@ -905,7 +905,7 @@ bool idItemTeam::ClientReceiveEvent( int event, int time, const idBitMsg &msg )
|
|||
return true;
|
||||
};
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -982,7 +982,7 @@ void idItemTeam::PrivateReturn( void )
|
|||
itemGlow.shaderParms[ SHADERPARM_BLUE ] = 0.0f;
|
||||
itemGlow.shaderParms[ SHADERPARM_ALPHA ] = 0.0f;
|
||||
|
||||
if ( itemGlowHandle != -1 )
|
||||
if ( itemGlowHandle != -1 )
|
||||
gameRenderWorld->UpdateLightDef( itemGlowHandle, &itemGlow );*/
|
||||
|
||||
GetPhysics()->SetLinearVelocity( idVec3(0, 0, 0) );
|
||||
|
@ -995,7 +995,7 @@ idItemTeam::Event_TakeFlag
|
|||
================
|
||||
*/
|
||||
void idItemTeam::Event_TakeFlag( idPlayer * player ) {
|
||||
gameLocal.DPrintf("Event_TakeFlag()!\n");
|
||||
gameLocal.DPrintf("Event_TakeFlag()!\n");
|
||||
|
||||
if ( gameLocal.isServer ) {
|
||||
idBitMsg msg;
|
||||
|
@ -1044,14 +1044,14 @@ void idItemTeam::Event_TakeFlag( idPlayer * player ) {
|
|||
SetSkin( skinCarried );
|
||||
|
||||
UpdateVisuals();
|
||||
UpdateGuis();
|
||||
UpdateGuis();
|
||||
|
||||
if ( gameLocal.isServer ) {
|
||||
if ( team == 0 )
|
||||
gameLocal.mpGame.player_red_flag = player->entityNumber;
|
||||
else
|
||||
gameLocal.mpGame.player_blue_flag = player->entityNumber;
|
||||
}
|
||||
if ( gameLocal.isServer ) {
|
||||
if ( team == 0 )
|
||||
gameLocal.mpGame.player_red_flag = player->entityNumber;
|
||||
else
|
||||
gameLocal.mpGame.player_blue_flag = player->entityNumber;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1060,7 +1060,7 @@ idItemTeam::Event_DropFlag
|
|||
================
|
||||
*/
|
||||
void idItemTeam::Event_DropFlag( bool death ) {
|
||||
gameLocal.DPrintf("Event_DropFlag()!\n");
|
||||
gameLocal.DPrintf("Event_DropFlag()!\n");
|
||||
|
||||
if ( gameLocal.isServer ) {
|
||||
idBitMsg msg;
|
||||
|
@ -1094,7 +1094,7 @@ void idItemTeam::Event_DropFlag( bool death ) {
|
|||
// GetPhysics()->SetLinearVelocity( ( GetPhysics()->GetLinearVelocity() * GetBindMaster()->GetPhysics()->GetAxis() ) + GetBindMaster()->GetPhysics()->GetLinearVelocity() );
|
||||
|
||||
if ( GetBindMaster() ) {
|
||||
const idBounds bounds = GetPhysics()->GetBounds();
|
||||
const idBounds bounds = GetPhysics()->GetBounds();
|
||||
idVec3 origin = GetBindMaster()->GetPhysics()->GetOrigin() + idVec3(0, 0, ( bounds[1].z-bounds[0].z )*0.6f );
|
||||
|
||||
Unbind();
|
||||
|
@ -1116,18 +1116,18 @@ void idItemTeam::Event_DropFlag( bool death ) {
|
|||
thread->DelayedStart( 0 );
|
||||
}
|
||||
|
||||
SetSkin( skinDefault );
|
||||
SetSkin( skinDefault );
|
||||
UpdateVisuals();
|
||||
UpdateGuis();
|
||||
UpdateGuis();
|
||||
|
||||
|
||||
if ( gameLocal.isServer ) {
|
||||
if ( team == 0 )
|
||||
gameLocal.mpGame.player_red_flag = -1;
|
||||
else
|
||||
gameLocal.mpGame.player_blue_flag = -1;
|
||||
|
||||
}
|
||||
if ( gameLocal.isServer ) {
|
||||
if ( team == 0 )
|
||||
gameLocal.mpGame.player_red_flag = -1;
|
||||
else
|
||||
gameLocal.mpGame.player_blue_flag = -1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1136,7 +1136,7 @@ idItemTeam::Event_FlagReturn
|
|||
================
|
||||
*/
|
||||
void idItemTeam::Event_FlagReturn( idPlayer * player ) {
|
||||
gameLocal.DPrintf("Event_FlagReturn()!\n");
|
||||
gameLocal.DPrintf("Event_FlagReturn()!\n");
|
||||
|
||||
if ( gameLocal.isServer ) {
|
||||
ServerSendEvent( EVENT_FLAGRETURN, NULL, false, -1 );
|
||||
|
@ -1166,15 +1166,15 @@ void idItemTeam::Event_FlagReturn( idPlayer * player ) {
|
|||
}
|
||||
|
||||
UpdateVisuals();
|
||||
UpdateGuis();
|
||||
UpdateGuis();
|
||||
// Present();
|
||||
|
||||
if ( gameLocal.isServer ) {
|
||||
if ( team == 0 )
|
||||
gameLocal.mpGame.player_red_flag = -1;
|
||||
else
|
||||
gameLocal.mpGame.player_blue_flag = -1;
|
||||
}
|
||||
if ( gameLocal.isServer ) {
|
||||
if ( team == 0 )
|
||||
gameLocal.mpGame.player_red_flag = -1;
|
||||
else
|
||||
gameLocal.mpGame.player_blue_flag = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1215,16 +1215,16 @@ void idItemTeam::Event_FlagCapture( void ) {
|
|||
}
|
||||
|
||||
UpdateVisuals();
|
||||
UpdateGuis();
|
||||
|
||||
UpdateGuis();
|
||||
|
||||
|
||||
if ( gameLocal.isServer ) {
|
||||
if ( team == 0 )
|
||||
gameLocal.mpGame.player_red_flag = -1;
|
||||
else
|
||||
gameLocal.mpGame.player_blue_flag = -1;
|
||||
}
|
||||
|
||||
if ( gameLocal.isServer ) {
|
||||
if ( team == 0 )
|
||||
gameLocal.mpGame.player_red_flag = -1;
|
||||
else
|
||||
gameLocal.mpGame.player_blue_flag = -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1287,15 +1287,15 @@ void idItemTeam::ReadFromSnapshot( const idBitMsgDelta &msg ) {
|
|||
|
||||
ReadBindFromSnapshot( msg );
|
||||
|
||||
if ( msg.HasChanged() )
|
||||
{
|
||||
UpdateGuis();
|
||||
if ( msg.HasChanged() )
|
||||
{
|
||||
UpdateGuis();
|
||||
|
||||
if ( carried == true )
|
||||
SetSkin( skinCarried );
|
||||
else
|
||||
SetSkin( skinDefault );
|
||||
}
|
||||
if ( carried == true )
|
||||
SetSkin( skinCarried );
|
||||
else
|
||||
SetSkin( skinDefault );
|
||||
}
|
||||
|
||||
idMoveableItem::ReadFromSnapshot( msg );
|
||||
}
|
||||
|
@ -1308,21 +1308,21 @@ Update all client's huds wrt the flag status.
|
|||
================
|
||||
*/
|
||||
void idItemTeam::UpdateGuis( void ) {
|
||||
idPlayer *player;
|
||||
|
||||
idPlayer *player;
|
||||
|
||||
for ( int i = 0; i < gameLocal.numClients; i++ ) {
|
||||
player = static_cast<idPlayer *>( gameLocal.entities[ i ] );
|
||||
|
||||
if ( player == NULL || player->hud == NULL )
|
||||
if ( player == NULL || player->hud == NULL )
|
||||
continue;
|
||||
|
||||
player->hud->SetStateInt( "red_flagstatus", gameLocal.mpGame.GetFlagStatus( 0 ) );
|
||||
player->hud->SetStateInt( "blue_flagstatus", gameLocal.mpGame.GetFlagStatus( 1 ) );
|
||||
player->hud->SetStateInt( "red_flagstatus", gameLocal.mpGame.GetFlagStatus( 0 ) );
|
||||
player->hud->SetStateInt( "blue_flagstatus", gameLocal.mpGame.GetFlagStatus( 1 ) );
|
||||
|
||||
player->hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints( 0 ) );
|
||||
player->hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints( 1 ) );
|
||||
player->hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints( 0 ) );
|
||||
player->hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints( 1 ) );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1479,7 +1479,7 @@ void idObjective::Event_Trigger( idEntity *activator ) {
|
|||
//Pickup( player );
|
||||
|
||||
if ( spawnArgs.GetString( "inv_objective", NULL ) ) {
|
||||
if ( player && player->hud ) {
|
||||
if ( player && player->hud ) {
|
||||
idStr shotName = gameLocal.GetMapName();
|
||||
shotName.StripFileExtension();
|
||||
shotName += "/";
|
||||
|
@ -1598,7 +1598,7 @@ bool idPDAItem::GiveToPlayer(idPlayer *player) {
|
|||
===============================================================================
|
||||
|
||||
idMoveableItem
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -1641,7 +1641,7 @@ idMoveableItem::Save
|
|||
================
|
||||
*/
|
||||
void idMoveableItem::Save( idSaveGame *savefile ) const {
|
||||
savefile->WriteStaticObject( physicsObj );
|
||||
savefile->WriteStaticObject( physicsObj );
|
||||
|
||||
savefile->WriteClipModel( trigger );
|
||||
|
||||
|
@ -1757,7 +1757,7 @@ void idMoveableItem::Think( void ) {
|
|||
// update trigger position
|
||||
trigger->Link( gameLocal.clip, this, 0, GetPhysics()->GetOrigin(), mat3_identity );
|
||||
}
|
||||
|
||||
|
||||
if ( thinkFlags & TH_UPDATEPARTICLES ) {
|
||||
if ( !gameLocal.smokeParticles->EmitSmoke( smoke, smokeTime, gameLocal.random.CRandomFloat(), GetPhysics()->GetOrigin(), GetPhysics()->GetAxis(), timeGroup /*_D3XP*/ ) ) {
|
||||
#ifdef CTF
|
||||
|
@ -1810,7 +1810,7 @@ bool idMoveableItem::Pickup( idPlayer *player ) {
|
|||
bool ret = idItem::Pickup( player );
|
||||
if ( ret ) {
|
||||
trigger->SetContents( 0 );
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2034,7 +2034,7 @@ idItemRemover::RemoveItem
|
|||
*/
|
||||
void idItemRemover::RemoveItem( idPlayer *player ) {
|
||||
const char *remove;
|
||||
|
||||
|
||||
remove = spawnArgs.GetString( "remove" );
|
||||
player->RemoveInventoryItem( remove );
|
||||
}
|
||||
|
@ -2115,7 +2115,7 @@ void idObjectiveComplete::Event_Trigger( idEntity *activator ) {
|
|||
RemoveItem( player );
|
||||
|
||||
if ( spawnArgs.GetString( "inv_objective", NULL ) ) {
|
||||
if ( player->hud ) {
|
||||
if ( player->hud ) {
|
||||
player->hud->SetStateString( "objective", "2");
|
||||
|
||||
player->hud->SetStateString( "objectivetext", spawnArgs.GetString( "objectivetext" ) );
|
||||
|
|
30
d3xp/Item.h
30
d3xp/Item.h
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -60,9 +60,9 @@ public:
|
|||
EVENT_RESPAWN,
|
||||
EVENT_RESPAWNFX,
|
||||
#ifdef CTF
|
||||
EVENT_TAKEFLAG,
|
||||
EVENT_DROPFLAG,
|
||||
EVENT_FLAGRETURN,
|
||||
EVENT_TAKEFLAG,
|
||||
EVENT_DROPFLAG,
|
||||
EVENT_FLAGRETURN,
|
||||
EVENT_FLAGCAPTURE,
|
||||
#endif
|
||||
EVENT_MAXEVENTS
|
||||
|
@ -176,7 +176,7 @@ public:
|
|||
virtual void WriteToSnapshot( idBitMsgDelta &msg ) const;
|
||||
virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
|
||||
|
||||
#ifdef CTF
|
||||
#ifdef CTF
|
||||
protected:
|
||||
#else
|
||||
private:
|
||||
|
@ -203,14 +203,14 @@ private:
|
|||
|
||||
class idItemTeam : public idMoveableItem {
|
||||
public:
|
||||
CLASS_PROTOTYPE( idItemTeam );
|
||||
CLASS_PROTOTYPE( idItemTeam );
|
||||
|
||||
idItemTeam();
|
||||
idItemTeam();
|
||||
virtual ~idItemTeam();
|
||||
|
||||
void Spawn();
|
||||
void Spawn();
|
||||
virtual bool Pickup( idPlayer *player );
|
||||
virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg );
|
||||
virtual bool ClientReceiveEvent( int event, int time, const idBitMsg &msg );
|
||||
virtual void Think(void );
|
||||
|
||||
void Drop( bool death = false ); // was the drop caused by death of carrier?
|
||||
|
@ -225,8 +225,8 @@ public:
|
|||
virtual void ReadFromSnapshot( const idBitMsgDelta &msg );
|
||||
|
||||
public:
|
||||
int team;
|
||||
// TODO : turn this into a state :
|
||||
int team;
|
||||
// TODO : turn this into a state :
|
||||
bool carried; // is it beeing carried by a player?
|
||||
bool dropped; // was it dropped?
|
||||
|
||||
|
@ -243,8 +243,8 @@ private:
|
|||
const function_t * scriptReturned;
|
||||
const function_t * scriptCaptured;
|
||||
|
||||
renderLight_t itemGlow; // Used by flags when they are picked up
|
||||
int itemGlowHandle;
|
||||
renderLight_t itemGlow; // Used by flags when they are picked up
|
||||
int itemGlowHandle;
|
||||
|
||||
int lastNuggetDrop;
|
||||
const char * nuggetName;
|
||||
|
@ -252,7 +252,7 @@ private:
|
|||
private:
|
||||
|
||||
void Event_TakeFlag( idPlayer * player );
|
||||
void Event_DropFlag( bool death );
|
||||
void Event_DropFlag( bool death );
|
||||
void Event_FlagReturn( idPlayer * player = NULL );
|
||||
void Event_FlagCapture( void );
|
||||
|
||||
|
@ -260,7 +260,7 @@ private:
|
|||
function_t * LoadScript( char * script );
|
||||
|
||||
void SpawnNugget( idVec3 pos );
|
||||
void UpdateGuis( void );
|
||||
void UpdateGuis( void );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -123,10 +123,10 @@ void idGameEdit::ParseSpawnArgsToRenderLight( const idDict *args, renderLight_t
|
|||
idMat3 mat;
|
||||
if ( !args->GetMatrix( "light_rotation", "1 0 0 0 1 0 0 0 1", mat ) ) {
|
||||
if ( !args->GetMatrix( "rotation", "1 0 0 0 1 0 0 0 1", mat ) ) {
|
||||
args->GetFloat( "angle", "0", angles[ 1 ] );
|
||||
angles[ 0 ] = 0;
|
||||
args->GetFloat( "angle", "0", angles[ 1 ] );
|
||||
angles[ 0 ] = 0;
|
||||
angles[ 1 ] = idMath::AngleNormalize360( angles[ 1 ] );
|
||||
angles[ 2 ] = 0;
|
||||
angles[ 2 ] = 0;
|
||||
mat = angles.ToMat3();
|
||||
}
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ archives object for save game file
|
|||
*/
|
||||
void idLight::Save( idSaveGame *savefile ) const {
|
||||
savefile->WriteRenderLight( renderLight );
|
||||
|
||||
|
||||
savefile->WriteBool( renderLight.prelightModel != NULL );
|
||||
|
||||
savefile->WriteVec3( localLightOrigin );
|
||||
|
@ -357,12 +357,12 @@ void idLight::Spawn( void ) {
|
|||
}
|
||||
|
||||
#ifdef CTF
|
||||
// Midnight CTF
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") && !spawnArgs.GetBool("midnight_override") ) {
|
||||
Off();
|
||||
}
|
||||
// Midnight CTF
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") && !spawnArgs.GetBool("midnight_override") ) {
|
||||
Off();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
health = spawnArgs.GetInt( "health", "0" );
|
||||
spawnArgs.GetString( "broken", "", brokenModel );
|
||||
spawnArgs.GetBool( "break", "0", breakOnTrigger );
|
||||
|
@ -390,7 +390,7 @@ void idLight::Spawn( void ) {
|
|||
int pos;
|
||||
|
||||
needBroken = false;
|
||||
|
||||
|
||||
pos = model.Find( "." );
|
||||
if ( pos < 0 ) {
|
||||
pos = model.Length();
|
||||
|
@ -403,7 +403,7 @@ void idLight::Spawn( void ) {
|
|||
brokenModel += &model[ pos ];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// make sure the model gets cached
|
||||
if ( !renderModelManager->CheckModel( brokenModel ) ) {
|
||||
if ( needBroken ) {
|
||||
|
@ -414,7 +414,7 @@ void idLight::Spawn( void ) {
|
|||
}
|
||||
|
||||
GetPhysics()->SetContents( spawnArgs.GetBool( "nonsolid" ) ? 0 : CONTENTS_SOLID );
|
||||
|
||||
|
||||
// make sure the collision model gets cached
|
||||
idClipModel::CheckModel( brokenModel );
|
||||
}
|
||||
|
@ -1095,7 +1095,7 @@ void idLight::ReadFromSnapshot( const idBitMsgDelta &msg ) {
|
|||
}
|
||||
}
|
||||
UnpackColor( msg.ReadLong(), baseColor );
|
||||
// lightParentEntityNum = msg.ReadBits( GENTITYNUM_BITS );
|
||||
// lightParentEntityNum = msg.ReadBits( GENTITYNUM_BITS );
|
||||
|
||||
/* // only helps prediction
|
||||
UnpackColor( msg.ReadLong(), fadeFrom );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -419,7 +419,7 @@ void idPathCorner::Event_RandomPath( void ) {
|
|||
===============================================================================
|
||||
|
||||
idDamagable
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -469,9 +469,9 @@ void idDamagable::Spawn( void ) {
|
|||
idStr broken;
|
||||
|
||||
health = spawnArgs.GetInt( "health", "5" );
|
||||
spawnArgs.GetInt( "count", "1", count );
|
||||
spawnArgs.GetInt( "count", "1", count );
|
||||
nextTriggerTime = 0;
|
||||
|
||||
|
||||
// make sure the model gets cached
|
||||
spawnArgs.GetString( "broken", "", broken );
|
||||
if ( broken.Length() && !renderModelManager->CheckModel( broken ) ) {
|
||||
|
@ -492,7 +492,7 @@ void idDamagable::BecomeBroken( idEntity *activator ) {
|
|||
int numStates;
|
||||
int cycle;
|
||||
float wait;
|
||||
|
||||
|
||||
if ( gameLocal.time < nextTriggerTime ) {
|
||||
return;
|
||||
}
|
||||
|
@ -605,7 +605,7 @@ void idDamagable::Event_RestoreDamagable( void ) {
|
|||
===============================================================================
|
||||
|
||||
idExplodable
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -655,7 +655,7 @@ void idExplodable::Event_Explode( idEntity *activator ) {
|
|||
===============================================================================
|
||||
|
||||
idSpring
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -692,7 +692,7 @@ void idSpring::Think( void ) {
|
|||
origin = ent2->GetPhysics()->GetOrigin();
|
||||
end = origin + p2 * axis;
|
||||
}
|
||||
|
||||
|
||||
gameRenderWorld->DebugLine( idVec4(1, 1, 0, 1), start, end, 0, true );
|
||||
}
|
||||
|
||||
|
@ -760,7 +760,7 @@ void idSpring::Spawn( void ) {
|
|||
===============================================================================
|
||||
|
||||
idForceField
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -998,7 +998,7 @@ void idAnimated::Spawn( void ) {
|
|||
float wait;
|
||||
const char *joint;
|
||||
|
||||
joint = spawnArgs.GetString( "sound_bone", "origin" );
|
||||
joint = spawnArgs.GetString( "sound_bone", "origin" );
|
||||
soundJoint = animator.GetJointHandle( joint );
|
||||
if ( soundJoint == INVALID_JOINT ) {
|
||||
gameLocal.Warning( "idAnimated '%s' at (%s): cannot find joint '%s' for sound playback", name.c_str(), GetPhysics()->GetOrigin().ToString(0), joint );
|
||||
|
@ -1047,7 +1047,7 @@ void idAnimated::Spawn( void ) {
|
|||
animator.CycleAnim( ANIMCHANNEL_ALL, anim2, gameLocal.time, 0 );
|
||||
} else if ( anim ) {
|
||||
// init joints to the first frame of the animation
|
||||
animator.SetFrame( ANIMCHANNEL_ALL, anim, 1, gameLocal.time, 0 );
|
||||
animator.SetFrame( ANIMCHANNEL_ALL, anim, 1, gameLocal.time, 0 );
|
||||
|
||||
if ( !num_anims ) {
|
||||
blendFrames = 0;
|
||||
|
@ -1108,7 +1108,7 @@ bool idAnimated::StartRagdoll( void ) {
|
|||
|
||||
// start using the AF
|
||||
af.StartFromCurrentPose( spawnArgs.GetInt( "velocityTime", "0" ) );
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1151,7 +1151,7 @@ void idAnimated::PlayNextAnim( void ) {
|
|||
if ( g_debugCinematic.GetBool() ) {
|
||||
gameLocal.Printf( "%d: '%s' start anim '%s'\n", gameLocal.framenum, GetName(), animname );
|
||||
}
|
||||
|
||||
|
||||
spawnArgs.GetInt( "cycle", "1", cycle );
|
||||
if ( ( current_anim_index == num_anims ) && spawnArgs.GetBool( "loop_last_anim" ) ) {
|
||||
cycle = -1;
|
||||
|
@ -1303,7 +1303,7 @@ void idAnimated::Event_LaunchMissilesUpdate( int launchjoint, int targetjoint, i
|
|||
|
||||
animator.GetJointTransform( ( jointHandle_t )launchjoint, gameLocal.time, launchPos, axis );
|
||||
launchPos = renderEntity.origin + launchPos * renderEntity.axis;
|
||||
|
||||
|
||||
animator.GetJointTransform( ( jointHandle_t )targetjoint, gameLocal.time, targetPos, axis );
|
||||
targetPos = renderEntity.origin + targetPos * renderEntity.axis;
|
||||
|
||||
|
@ -1595,7 +1595,7 @@ void idStaticEntity::Event_Activate( idEntity *activator ) {
|
|||
|
||||
renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( spawnTime );
|
||||
renderEntity.shaderParms[5] = active;
|
||||
// this change should be a good thing, it will automatically turn on
|
||||
// this change should be a good thing, it will automatically turn on
|
||||
// lights etc.. when triggered so that does not have to be specifically done
|
||||
// with trigger parms.. it MIGHT break things so need to keep an eye on it
|
||||
renderEntity.shaderParms[ SHADERPARM_MODE ] = ( renderEntity.shaderParms[ SHADERPARM_MODE ] ) ? 0.0f : 1.0f;
|
||||
|
@ -2314,7 +2314,7 @@ void idBeam::Event_Activate( idEntity *activator ) {
|
|||
if ( IsHidden() ) {
|
||||
Show();
|
||||
} else {
|
||||
Hide();
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2467,7 +2467,7 @@ void idShaking::Spawn( void ) {
|
|||
physicsObj.SetAxis( GetPhysics()->GetAxis() );
|
||||
physicsObj.SetClipMask( MASK_SOLID );
|
||||
SetPhysics( &physicsObj );
|
||||
|
||||
|
||||
active = false;
|
||||
if ( !spawnArgs.GetBool( "start_off" ) ) {
|
||||
BeginShaking();
|
||||
|
@ -2596,7 +2596,7 @@ idEarthQuake::Event_Activate
|
|||
================
|
||||
*/
|
||||
void idEarthQuake::Event_Activate( idEntity *activator ) {
|
||||
|
||||
|
||||
if ( nextTriggerTime > gameLocal.time ) {
|
||||
return;
|
||||
}
|
||||
|
@ -2920,7 +2920,7 @@ void idFuncRadioChatter::Event_Activate( idEntity *activator ) {
|
|||
const char *sound;
|
||||
const idSoundShader *shader;
|
||||
int length;
|
||||
|
||||
|
||||
if ( activator->IsType( idPlayer::Type ) ) {
|
||||
player = static_cast<idPlayer *>( activator );
|
||||
} else {
|
||||
|
@ -2935,7 +2935,7 @@ void idFuncRadioChatter::Event_Activate( idEntity *activator ) {
|
|||
player->StartSoundShader( shader, SND_CHANNEL_RADIO, SSF_GLOBAL, false, &length );
|
||||
time = MS2SEC( length + 150 );
|
||||
}
|
||||
// we still put the hud up because this is used with no sound on
|
||||
// we still put the hud up because this is used with no sound on
|
||||
// certain frame commands when the chatter is triggered
|
||||
PostEventSec( &EV_ResetRadioHud, time, player );
|
||||
|
||||
|
@ -2973,8 +2973,8 @@ idPhantomObjects::idPhantomObjects
|
|||
idPhantomObjects::idPhantomObjects() {
|
||||
target = NULL;
|
||||
end_time = 0;
|
||||
throw_time = 0.0f;
|
||||
shake_time = 0.0f;
|
||||
throw_time = 0.0f;
|
||||
shake_time = 0.0f;
|
||||
shake_ang.Zero();
|
||||
speed = 0.0f;
|
||||
min_wait = 0;
|
||||
|
@ -3025,8 +3025,8 @@ void idPhantomObjects::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadInt( min_wait );
|
||||
savefile->ReadInt( max_wait );
|
||||
target.Restore( savefile );
|
||||
|
||||
savefile->ReadInt( num );
|
||||
|
||||
savefile->ReadInt( num );
|
||||
targetTime.SetGranularity( 1 );
|
||||
targetTime.SetNum( num );
|
||||
lastTargetPos.SetGranularity( 1 );
|
||||
|
@ -3087,7 +3087,7 @@ void idPhantomObjects::Event_Activate( idEntity *activator ) {
|
|||
} else {
|
||||
target = static_cast<idActor *>( activator );
|
||||
}
|
||||
|
||||
|
||||
end_time = gameLocal.time + SEC2MS( spawnArgs.GetFloat( "end_time", "0" ) );
|
||||
|
||||
targetTime.SetNum( targets.Num() );
|
||||
|
@ -3095,7 +3095,7 @@ void idPhantomObjects::Event_Activate( idEntity *activator ) {
|
|||
|
||||
const idVec3 &toPos = target.GetEntity()->GetEyePosition();
|
||||
|
||||
// calculate the relative times of all the objects
|
||||
// calculate the relative times of all the objects
|
||||
time = 0.0f;
|
||||
for( i = 0; i < targetTime.Num(); i++ ) {
|
||||
targetTime[ i ] = SEC2MS( time );
|
||||
|
@ -3153,7 +3153,7 @@ void idPhantomObjects::Think( void ) {
|
|||
if ( !ent ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ( ent->fl.hidden ) {
|
||||
// don't throw hidden objects
|
||||
continue;
|
||||
|
@ -3180,7 +3180,7 @@ void idPhantomObjects::Think( void ) {
|
|||
}
|
||||
|
||||
if ( time < 0.0f ) {
|
||||
idAI::PredictTrajectory( entPhys->GetOrigin(), lastTargetPos[ i ], speed, entPhys->GetGravity(),
|
||||
idAI::PredictTrajectory( entPhys->GetOrigin(), lastTargetPos[ i ], speed, entPhys->GetGravity(),
|
||||
entPhys->GetClipModel(), entPhys->GetClipMask(), 256.0f, ent, targetEnt, ai_debugTrajectory.GetBool() ? 1 : 0, vel );
|
||||
vel *= speed;
|
||||
entPhys->SetLinearVelocity( vel );
|
||||
|
@ -3285,7 +3285,7 @@ void idShockwave::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadFloat( height );
|
||||
savefile->ReadBool( playerDamaged );
|
||||
savefile->ReadFloat( playerDamageSize );
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3347,13 +3347,13 @@ void idShockwave::Think() {
|
|||
} else {
|
||||
zVal = height/2.0f;
|
||||
}
|
||||
|
||||
|
||||
//Expand in a sphere
|
||||
end = pos + idVec3( newSize, newSize, zVal );
|
||||
idBounds bounds( end );
|
||||
end = pos + idVec3( -newSize, -newSize, -zVal );
|
||||
bounds.AddPoint( end );
|
||||
|
||||
|
||||
if(g_debugShockwave.GetBool()) {
|
||||
gameRenderWorld->DebugBounds(colorRed, bounds, vec3_origin);
|
||||
}
|
||||
|
@ -3380,7 +3380,7 @@ void idShockwave::Think() {
|
|||
if(ent->IsType( idPlayer::Type )) {
|
||||
|
||||
if(ent->GetPhysics()->GetAbsBounds().IntersectsBounds(bounds)) {
|
||||
|
||||
|
||||
//For player damage we check the current radius and a specified player damage ring size
|
||||
if ( dist <= newSize && dist > newSize-playerDamageSize ) {
|
||||
|
||||
|
@ -3624,7 +3624,7 @@ void idFuncMountedWeapon::Spawn( void ) {
|
|||
spawnArgs.GetString( "snd_fire", "", fireSound );
|
||||
soundFireWeapon = declManager->FindSound( fireSound );
|
||||
|
||||
PostEventMS( &EV_PostSpawn, 0 );
|
||||
PostEventMS( &EV_PostSpawn, 0 );
|
||||
}
|
||||
|
||||
void idFuncMountedWeapon::Think( void ) {
|
||||
|
|
20
d3xp/Misc.h
20
d3xp/Misc.h
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -97,7 +97,7 @@ private:
|
|||
Bind to a mover to have the mover activate a trigger as it moves.
|
||||
When target by triggers, activating the trigger will toggle the
|
||||
activator on and off. Check "start_off" to have it spawn disabled.
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -288,7 +288,7 @@ private:
|
|||
|
||||
void PlayNextAnim( void );
|
||||
|
||||
void Event_Activate( idEntity *activator );
|
||||
void Event_Activate( idEntity *activator );
|
||||
void Event_Start( void );
|
||||
void Event_StartRagdoll( void );
|
||||
void Event_AnimDone( int animIndex );
|
||||
|
@ -486,7 +486,7 @@ public:
|
|||
void Save( idSaveGame *savefile ) const;
|
||||
void Restore( idRestoreGame *savefile );
|
||||
|
||||
void Event_Activate( idEntity *activator );
|
||||
void Event_Activate( idEntity *activator );
|
||||
|
||||
private:
|
||||
qhandle_t portal;
|
||||
|
@ -606,7 +606,7 @@ private:
|
|||
class idEarthQuake : public idEntity {
|
||||
public:
|
||||
CLASS_PROTOTYPE( idEarthQuake );
|
||||
|
||||
|
||||
idEarthQuake();
|
||||
|
||||
void Spawn( void );
|
||||
|
@ -641,7 +641,7 @@ private:
|
|||
class idFuncPortal : public idEntity {
|
||||
public:
|
||||
CLASS_PROTOTYPE( idFuncPortal );
|
||||
|
||||
|
||||
idFuncPortal();
|
||||
|
||||
void Spawn( void );
|
||||
|
@ -667,7 +667,7 @@ private:
|
|||
class idFuncAASPortal : public idEntity {
|
||||
public:
|
||||
CLASS_PROTOTYPE( idFuncAASPortal );
|
||||
|
||||
|
||||
idFuncAASPortal();
|
||||
|
||||
void Spawn( void );
|
||||
|
@ -692,7 +692,7 @@ private:
|
|||
class idFuncAASObstacle : public idEntity {
|
||||
public:
|
||||
CLASS_PROTOTYPE( idFuncAASObstacle );
|
||||
|
||||
|
||||
idFuncAASObstacle();
|
||||
|
||||
void Spawn( void );
|
||||
|
@ -744,7 +744,7 @@ private:
|
|||
class idPhantomObjects : public idEntity {
|
||||
public:
|
||||
CLASS_PROTOTYPE( idPhantomObjects );
|
||||
|
||||
|
||||
idPhantomObjects();
|
||||
|
||||
void Spawn( void );
|
||||
|
@ -834,7 +834,7 @@ private:
|
|||
int harc;
|
||||
int varc;
|
||||
|
||||
void Event_Touch( idEntity *other, trace_t *trace );
|
||||
void Event_Touch( idEntity *other, trace_t *trace );
|
||||
void Event_Activate( idEntity *activator );
|
||||
|
||||
public:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -35,7 +35,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
===============================================================================
|
||||
|
||||
idMoveable
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -556,7 +556,7 @@ void idMoveable::Event_Activate( idEntity *activator ) {
|
|||
Show();
|
||||
|
||||
if ( !spawnArgs.GetInt( "notPushable" ) ) {
|
||||
physicsObj.EnableImpact();
|
||||
physicsObj.EnableImpact();
|
||||
}
|
||||
|
||||
physicsObj.Activate();
|
||||
|
@ -622,7 +622,7 @@ void idMoveable::Event_EnableDamage( float enable ) {
|
|||
===============================================================================
|
||||
|
||||
idBarrel
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -1155,7 +1155,7 @@ void idExplodingBarrel::Killed( idEntity *inflictor, idEntity *attacker, int dam
|
|||
msg.Init( msgBuf, sizeof( msgBuf ) );
|
||||
msg.WriteLong( gameLocal.time );
|
||||
ServerSendEvent( EVENT_EXPLODE, &msg, false, -1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// do this before applying radius damage so the ent can trace to any damagable ents nearby
|
||||
|
@ -1168,7 +1168,7 @@ void idExplodingBarrel::Killed( idEntity *inflictor, idEntity *attacker, int dam
|
|||
}
|
||||
|
||||
ExplodingEffects( );
|
||||
|
||||
|
||||
//FIXME: need to precache all the debris stuff here and in the projectiles
|
||||
const idKeyValue *kv = spawnArgs.MatchPrefix( "def_debris" );
|
||||
// bool first = true;
|
||||
|
@ -1198,7 +1198,7 @@ void idExplodingBarrel::Killed( idEntity *inflictor, idEntity *attacker, int dam
|
|||
debris->Launch();
|
||||
debris->GetRenderEntity()->shaderParms[ SHADERPARM_TIME_OF_DEATH ] = ( gameLocal.time + 1500 ) * 0.001f;
|
||||
debris->UpdateVisuals();
|
||||
|
||||
|
||||
}
|
||||
kv = spawnArgs.MatchPrefix( "def_debris", kv );
|
||||
}
|
||||
|
@ -1224,7 +1224,7 @@ void idExplodingBarrel::Killed( idEntity *inflictor, idEntity *attacker, int dam
|
|||
idExplodingBarrel::Damage
|
||||
================
|
||||
*/
|
||||
void idExplodingBarrel::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir,
|
||||
void idExplodingBarrel::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir,
|
||||
const char *damageDefName, const float damageScale, const int location ) {
|
||||
|
||||
const idDict *damageDef = gameLocal.FindEntityDefDict( damageDefName );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -167,7 +167,7 @@ public:
|
|||
#endif
|
||||
|
||||
virtual void Think( void );
|
||||
virtual void Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir,
|
||||
virtual void Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &dir,
|
||||
const char *damageDefName, const float damageScale, const int location );
|
||||
virtual void Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location );
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -33,7 +33,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
// _D3XP : rename all gameLocal.time to gameLocal.slow.time for merge!
|
||||
|
||||
// a mover will update any gui entities in it's target list with
|
||||
// a mover will update any gui entities in it's target list with
|
||||
// a key/val pair of "mover" "state" from below.. guis can represent
|
||||
// realtime info like this
|
||||
// binary only
|
||||
|
@ -174,7 +174,7 @@ void idMover::Save( idSaveGame *savefile ) const {
|
|||
savefile->WriteInt( move.movetime );
|
||||
savefile->WriteInt( move.deceleration );
|
||||
savefile->WriteVec3( move.dir );
|
||||
|
||||
|
||||
savefile->WriteInt( rot.stage );
|
||||
savefile->WriteInt( rot.acceleration );
|
||||
savefile->WriteInt( rot.movetime );
|
||||
|
@ -182,7 +182,7 @@ void idMover::Save( idSaveGame *savefile ) const {
|
|||
savefile->WriteFloat( rot.rot.pitch );
|
||||
savefile->WriteFloat( rot.rot.yaw );
|
||||
savefile->WriteFloat( rot.rot.roll );
|
||||
|
||||
|
||||
savefile->WriteInt( move_thread );
|
||||
savefile->WriteInt( rotate_thread );
|
||||
|
||||
|
@ -243,7 +243,7 @@ void idMover::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadInt( move.movetime );
|
||||
savefile->ReadInt( move.deceleration );
|
||||
savefile->ReadVec3( move.dir );
|
||||
|
||||
|
||||
savefile->ReadInt( (int&)rot.stage );
|
||||
savefile->ReadInt( rot.acceleration );
|
||||
savefile->ReadInt( rot.movetime );
|
||||
|
@ -251,7 +251,7 @@ void idMover::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadFloat( rot.rot.pitch );
|
||||
savefile->ReadFloat( rot.rot.yaw );
|
||||
savefile->ReadFloat( rot.rot.roll );
|
||||
|
||||
|
||||
savefile->ReadInt( move_thread );
|
||||
savefile->ReadInt( rotate_thread );
|
||||
|
||||
|
@ -299,7 +299,7 @@ void idMover::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadInt( useAngles );
|
||||
|
||||
PostEventMS( &EV_PostRestore, 0, starttime, totaltime, accel, decel, useAngles );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -524,7 +524,7 @@ idMover::FindGuiTargets
|
|||
================
|
||||
*/
|
||||
void idMover::FindGuiTargets( void ) {
|
||||
gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" );
|
||||
gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -589,7 +589,7 @@ void idMover::Event_InitGuiTargets( void ) {
|
|||
/***********************************************************************
|
||||
|
||||
Translation control functions
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -782,7 +782,7 @@ void idMover::BeginMove( idThread *thread ) {
|
|||
/***********************************************************************
|
||||
|
||||
Rotation control functions
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -977,8 +977,8 @@ void idMover::BeginRotation( idThread *thread, bool stopwhendone ) {
|
|||
|
||||
/***********************************************************************
|
||||
|
||||
Script callable routines
|
||||
|
||||
Script callable routines
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -1702,7 +1702,7 @@ idElevator::Event_Touch
|
|||
===============
|
||||
*/
|
||||
void idElevator::Event_Touch( idEntity *other, trace_t *trace ) {
|
||||
|
||||
|
||||
if ( gameLocal.slow.time < lastTouchTime + 2000 ) {
|
||||
return;
|
||||
}
|
||||
|
@ -1764,7 +1764,7 @@ void idElevator::Think( void ) {
|
|||
MoveToPos( fi->pos );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
RunPhysics();
|
||||
Present();
|
||||
}
|
||||
|
@ -2440,7 +2440,7 @@ idMover_Binary::SetMoverState
|
|||
===============
|
||||
*/
|
||||
void idMover_Binary::SetMoverState( moverState_t newstate, int time ) {
|
||||
idVec3 delta;
|
||||
idVec3 delta;
|
||||
|
||||
moverState = newstate;
|
||||
move_thread = 0;
|
||||
|
@ -2520,7 +2520,7 @@ void idMover_Binary::Event_MatchActivateTeam( moverState_t newstate, int time )
|
|||
================
|
||||
idMover_Binary::BindTeam
|
||||
|
||||
All entities in a mover team will be bound
|
||||
All entities in a mover team will be bound
|
||||
================
|
||||
*/
|
||||
void idMover_Binary::BindTeam( idEntity *bindTo ) {
|
||||
|
@ -2654,10 +2654,10 @@ void idMover_Binary::Event_Reached_BinaryMover( void ) {
|
|||
// return to pos1 after a delay
|
||||
PostEventSec( &EV_Mover_ReturnToPos1, wait );
|
||||
}
|
||||
|
||||
|
||||
// fire targets
|
||||
ActivateTargets( moveMaster->GetActivator() );
|
||||
|
||||
|
||||
SetBlocked(false);
|
||||
} else if ( moverState == MOVER_2TO1 ) {
|
||||
// reached pos1
|
||||
|
@ -2911,7 +2911,7 @@ idMover_Binary::FindGuiTargets
|
|||
================
|
||||
*/
|
||||
void idMover_Binary::FindGuiTargets( void ) {
|
||||
gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" );
|
||||
gameLocal.GetTargets( spawnArgs, guiTargets, "guiTarget" );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3309,7 +3309,7 @@ void idDoor::Spawn( void ) {
|
|||
// if "start_open", reverse position 1 and 2
|
||||
if ( start_open ) {
|
||||
// post it after EV_SpawnBind
|
||||
PostEventMS( &EV_Door_StartOpen, 1 );
|
||||
PostEventMS( &EV_Door_StartOpen, 1 );
|
||||
}
|
||||
|
||||
if ( spawnArgs.GetFloat( "time", "1", time ) ) {
|
||||
|
@ -3534,7 +3534,7 @@ void idDoor::Use( idEntity *other, idEntity *activator ) {
|
|||
}
|
||||
ActivateTargets( activator );
|
||||
Use_BinaryMover( activator );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3647,7 +3647,7 @@ void idDoor::CalcTriggerBounds( float size, idBounds &bounds ) {
|
|||
|
||||
// find the bounds of everything on the team
|
||||
bounds = GetPhysics()->GetAbsBounds();
|
||||
|
||||
|
||||
fl.takedamage = true;
|
||||
for( other = activateChain; other != NULL; other = other->GetActivateChain() ) {
|
||||
if ( other->IsType( idDoor::Type ) ) {
|
||||
|
@ -3938,13 +3938,13 @@ void idDoor::Event_Activate( idEntity *activator ) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( syncLock.Length() ) {
|
||||
if ( syncLock.Length() ) {
|
||||
idEntity *sync = gameLocal.FindEntity( syncLock );
|
||||
if ( sync && sync->IsType( idDoor::Type ) ) {
|
||||
if ( static_cast<idDoor *>( sync )->IsOpen() ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ActivateTargets( activator );
|
||||
|
@ -4246,7 +4246,7 @@ void idPlat::SpawnPlatTrigger( idVec3 &pos ) {
|
|||
tmin[1] = ( bounds[0][1] + bounds[1][1] ) * 0.5f;
|
||||
tmax[1] = tmin[1] + 1;
|
||||
}
|
||||
|
||||
|
||||
trigger = new idClipModel( idTraceModel( idBounds( tmin, tmax ) ) );
|
||||
trigger->Link( gameLocal.clip, this, 255, GetPhysics()->GetOrigin(), mat3_identity );
|
||||
trigger->SetContents( CONTENTS_TRIGGER );
|
||||
|
@ -4486,7 +4486,7 @@ void idRotater::Event_Activate( idEntity *activator ) {
|
|||
spawnArgs.GetFloat( "speed", "100", speed );
|
||||
spawnArgs.GetBool( "x_axis", "0", x_axis );
|
||||
spawnArgs.GetBool( "y_axis", "0", y_axis );
|
||||
|
||||
|
||||
// set the axis of rotation
|
||||
if ( x_axis ) {
|
||||
delta[2] = speed;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -157,7 +157,7 @@ private:
|
|||
void VectorForDir( float dir, idVec3 &vec );
|
||||
idCurve_Spline<idVec3> *GetSpline( idEntity *splineEntity ) const;
|
||||
|
||||
void Event_SetCallback( void );
|
||||
void Event_SetCallback( void );
|
||||
void Event_TeamBlocked( idEntity *blockedPart, idEntity *blockingEntity );
|
||||
void Event_StopMoving( void );
|
||||
void Event_StopRotating( void );
|
||||
|
@ -489,7 +489,7 @@ public:
|
|||
idMover_Periodic( void );
|
||||
|
||||
void Spawn( void );
|
||||
|
||||
|
||||
void Save( idSaveGame *savefile ) const;
|
||||
void Restore( idRestoreGame *savefile );
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -122,10 +122,10 @@ idMultiplayerGame::idMultiplayerGame() {
|
|||
|
||||
flagMsgOn = true;
|
||||
|
||||
player_blue_flag = -1;
|
||||
player_red_flag = -1;
|
||||
player_blue_flag = -1;
|
||||
player_red_flag = -1;
|
||||
#endif
|
||||
|
||||
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
@ -181,13 +181,13 @@ void idMultiplayerGame::Reset() {
|
|||
assert( !scoreBoard && !spectateGui && !guiChat && !mainGui && !mapList );
|
||||
|
||||
#ifdef CTF
|
||||
// CTF uses its own scoreboard
|
||||
if ( IsGametypeFlagBased() )
|
||||
scoreBoard = uiManager->FindGui( "guis/ctfscoreboard.gui", true, false, true );
|
||||
else
|
||||
// CTF uses its own scoreboard
|
||||
if ( IsGametypeFlagBased() )
|
||||
scoreBoard = uiManager->FindGui( "guis/ctfscoreboard.gui", true, false, true );
|
||||
else
|
||||
#endif
|
||||
scoreBoard = uiManager->FindGui( "guis/scoreboard.gui", true, false, true );
|
||||
|
||||
|
||||
spectateGui = uiManager->FindGui( "guis/spectate.gui", true, false, true );
|
||||
guiChat = uiManager->FindGui( "guis/chat.gui", true, false, true );
|
||||
mainGui = uiManager->FindGui( "guis/mpmain.gui", true, false, true );
|
||||
|
@ -228,7 +228,7 @@ void idMultiplayerGame::SpawnPlayer( int clientNum ) {
|
|||
idPlayer *p = static_cast< idPlayer * >( gameLocal.entities[ clientNum ] );
|
||||
p->spawnedTime = gameLocal.time;
|
||||
|
||||
if ( IsGametypeTeamBased() ) { /* CTF */
|
||||
if ( IsGametypeTeamBased() ) { /* CTF */
|
||||
SwitchToTeam( clientNum, -1, p->team );
|
||||
}
|
||||
p->tourneyRank = 0;
|
||||
|
@ -292,7 +292,7 @@ idMultiplayerGame::ClearGuis
|
|||
*/
|
||||
void idMultiplayerGame::ClearGuis() {
|
||||
int i;
|
||||
|
||||
|
||||
for ( i = 0; i < MAX_CLIENTS; i++ ) {
|
||||
scoreBoard->SetStateString( va( "player%i",i+1 ), "" );
|
||||
scoreBoard->SetStateString( va( "player%i_score", i+1 ), "" );
|
||||
|
@ -313,11 +313,11 @@ void idMultiplayerGame::ClearGuis() {
|
|||
scoreBoard->SetStateInt( va( "rank%i", i+1 ), 0 );
|
||||
player->hud->SetStateInt( "rank_self", 0 );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifdef CTF
|
||||
ClearHUDStatus();
|
||||
#endif
|
||||
ClearHUDStatus();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CTF
|
||||
|
@ -327,23 +327,23 @@ idMultiplayerGame::ClearHUDStatus
|
|||
================
|
||||
*/
|
||||
void idMultiplayerGame::ClearHUDStatus( void ) {
|
||||
int i;
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < MAX_CLIENTS; i++ ) {
|
||||
|
||||
for ( i = 0; i < MAX_CLIENTS; i++ ) {
|
||||
|
||||
idPlayer *player = static_cast<idPlayer *>( gameLocal.entities[ i ] );
|
||||
if ( !player || !player->hud ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
player->hud->SetStateInt( "red_flagstatus", 0 );
|
||||
player->hud->SetStateInt( "blue_flagstatus", 0 );
|
||||
if ( IsGametypeFlagBased())
|
||||
player->hud->SetStateInt( "self_team", player->team );
|
||||
else
|
||||
player->hud->SetStateInt( "self_team", -1 ); // Invisible.
|
||||
}
|
||||
|
||||
|
||||
player->hud->SetStateInt( "red_flagstatus", 0 );
|
||||
player->hud->SetStateInt( "blue_flagstatus", 0 );
|
||||
if ( IsGametypeFlagBased())
|
||||
player->hud->SetStateInt( "self_team", player->team );
|
||||
else
|
||||
player->hud->SetStateInt( "self_team", -1 ); // Invisible.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -358,9 +358,9 @@ Gets number of captures in CTF game.
|
|||
*/
|
||||
int idMultiplayerGame::GetFlagPoints( int team )
|
||||
{
|
||||
assert( team <= 1 );
|
||||
|
||||
return teamPoints[ team ];
|
||||
assert( team <= 1 );
|
||||
|
||||
return teamPoints[ team ];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -523,7 +523,7 @@ void idMultiplayerGame::UpdateScoreboard( idUserInterface *scoreBoard, idPlayer
|
|||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
iline++;
|
||||
if ( !playerState[ i ].ingame ) {
|
||||
scoreBoard->SetStateString( va( "player%i", iline ), common->GetLanguageDict()->GetString( "#str_04244" ) );
|
||||
|
@ -595,9 +595,9 @@ void idMultiplayerGame::UpdateScoreboard( idUserInterface *scoreBoard, idPlayer
|
|||
} else if ( gameLocal.gameType != GAME_CTF ) {
|
||||
#else
|
||||
} else {
|
||||
#endif
|
||||
#endif
|
||||
livesinfo = va( "%s: %i", common->GetLanguageDict()->GetString( "#str_01982" ), gameLocal.serverInfo.GetInt( "si_fragLimit" ) );
|
||||
}
|
||||
}
|
||||
if ( gameLocal.serverInfo.GetInt( "si_timeLimit" ) > 0 ) {
|
||||
timeinfo = va( "%s: %i", common->GetLanguageDict()->GetString( "#str_01983" ), gameLocal.serverInfo.GetInt( "si_timeLimit" ) );
|
||||
} else {
|
||||
|
@ -610,7 +610,7 @@ void idMultiplayerGame::UpdateScoreboard( idUserInterface *scoreBoard, idPlayer
|
|||
scoreBoard->Redraw( gameLocal.time );
|
||||
}
|
||||
|
||||
#ifdef CTF
|
||||
#ifdef CTF
|
||||
/*
|
||||
================
|
||||
idMultiplayerGame::UpdateCTFScoreboard
|
||||
|
@ -622,197 +622,197 @@ void idMultiplayerGame::UpdateCTFScoreboard( idUserInterface *scoreBoard, idPlay
|
|||
idEntity *ent;
|
||||
int value;
|
||||
|
||||
// The display lines
|
||||
int ilines[2] = {0,0};
|
||||
// The display lines
|
||||
int ilines[2] = {0,0};
|
||||
|
||||
// The team strings
|
||||
char redTeam[] = "red";
|
||||
char blueTeam[] = "blue";
|
||||
char *curTeam = NULL;
|
||||
// The team strings
|
||||
char redTeam[] = "red";
|
||||
char blueTeam[] = "blue";
|
||||
char *curTeam = NULL;
|
||||
|
||||
/* Word "frags" */
|
||||
scoreBoard->SetStateString( "scoretext", gameLocal.gameType == GAME_LASTMAN ? common->GetLanguageDict()->GetString( "#str_04242" ) : common->GetLanguageDict()->GetString( "#str_04243" ) );
|
||||
|
||||
// Blank the flag carrier on the scoreboard. We update these in the loop below if necessary.
|
||||
if ( this->player_blue_flag == -1 )
|
||||
// Blank the flag carrier on the scoreboard. We update these in the loop below if necessary.
|
||||
if ( this->player_blue_flag == -1 )
|
||||
scoreBoard->SetStateInt( "player_blue_flag", 0 );
|
||||
|
||||
if ( this->player_red_flag == -1 )
|
||||
scoreBoard->SetStateInt( "player_red_flag", 0 );
|
||||
|
||||
if ( this->player_red_flag == -1 )
|
||||
scoreBoard->SetStateInt( "player_red_flag", 0 );
|
||||
|
||||
if ( gameState != WARMUP ) {
|
||||
for ( i = 0; i < numRankedPlayers; i++ ) {
|
||||
|
||||
idPlayer *player = rankedPlayers[ i ];
|
||||
assert( player );
|
||||
idPlayer *player = rankedPlayers[ i ];
|
||||
assert( player );
|
||||
|
||||
if ( player->team == 0 )
|
||||
curTeam = redTeam;
|
||||
else
|
||||
curTeam = blueTeam;
|
||||
|
||||
// Increase the appropriate iline
|
||||
assert( player->team <= 1 );
|
||||
ilines[ player->team ]++;
|
||||
if ( player->team == 0 )
|
||||
curTeam = redTeam;
|
||||
else
|
||||
curTeam = blueTeam;
|
||||
|
||||
// Increase the appropriate iline
|
||||
assert( player->team <= 1 );
|
||||
ilines[ player->team ]++;
|
||||
|
||||
|
||||
// Update the flag status
|
||||
if ( this->player_blue_flag == player->entityNumber )
|
||||
scoreBoard->SetStateInt( "player_blue_flag", ilines[ player->team ] );
|
||||
|
||||
if ( player->team == 1 && this->player_red_flag == player->entityNumber )
|
||||
|
||||
if ( player->team == 1 && this->player_red_flag == player->entityNumber )
|
||||
scoreBoard->SetStateInt( "player_red_flag", ilines[ player->team ] );
|
||||
|
||||
|
||||
|
||||
/* Player Name */
|
||||
scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), player->GetUserInfo()->GetString( "ui_name" ) );
|
||||
|
||||
if ( IsGametypeTeamBased() ) {
|
||||
|
||||
|
||||
/* Player Name */
|
||||
scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), player->GetUserInfo()->GetString( "ui_name" ) );
|
||||
|
||||
if ( IsGametypeTeamBased() ) {
|
||||
|
||||
value = idMath::ClampInt( MP_PLAYER_MINFRAGS, MP_PLAYER_MAXFRAGS, playerState[ rankedPlayers[ i ]->entityNumber ].fragCount );
|
||||
scoreBoard->SetStateInt( va( "player%i_%s_score", ilines[ player->team ], curTeam ), value );
|
||||
|
||||
/* Team score and score, blanked */
|
||||
scoreBoard->SetStateString( va( "player%i_%s_tscore", ilines[ player->team ], curTeam ), "" );
|
||||
//scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), "" );
|
||||
}
|
||||
/* Team score and score, blanked */
|
||||
scoreBoard->SetStateString( va( "player%i_%s_tscore", ilines[ player->team ], curTeam ), "" );
|
||||
//scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), "" );
|
||||
}
|
||||
|
||||
/* Wins */
|
||||
/* Wins */
|
||||
value = idMath::ClampInt( 0, MP_PLAYER_MAXWINS, playerState[ rankedPlayers[ i ]->entityNumber ].wins );
|
||||
scoreBoard->SetStateInt( va( "player%i_%s_wins", ilines[ player->team ], curTeam ), value );
|
||||
scoreBoard->SetStateInt( va( "player%i_%s_wins", ilines[ player->team ], curTeam ), value );
|
||||
|
||||
/* Ping */
|
||||
scoreBoard->SetStateInt( va( "player%i_%s_ping", ilines[ player->team ], curTeam ), playerState[ rankedPlayers[ i ]->entityNumber ].ping );
|
||||
/* Ping */
|
||||
scoreBoard->SetStateInt( va( "player%i_%s_ping", ilines[ player->team ], curTeam ), playerState[ rankedPlayers[ i ]->entityNumber ].ping );
|
||||
}
|
||||
}
|
||||
|
||||
for ( i = 0; i < MAX_CLIENTS; i++ ) {
|
||||
|
||||
ent = gameLocal.entities[ i ];
|
||||
if ( !ent || !ent->IsType( idPlayer::Type ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( gameState != WARMUP ) {
|
||||
// check he's not covered by ranks already
|
||||
for ( j = 0; j < numRankedPlayers; j++ ) {
|
||||
if ( ent == rankedPlayers[ j ] ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( j != numRankedPlayers ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
player = static_cast< idPlayer * >( ent );
|
||||
|
||||
if ( player->spectating )
|
||||
continue;
|
||||
|
||||
if ( player->team == 0 )
|
||||
curTeam = redTeam;
|
||||
else
|
||||
curTeam = blueTeam;
|
||||
|
||||
ilines[ player->team ]++;
|
||||
for ( i = 0; i < MAX_CLIENTS; i++ ) {
|
||||
|
||||
ent = gameLocal.entities[ i ];
|
||||
if ( !ent || !ent->IsType( idPlayer::Type ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( gameState != WARMUP ) {
|
||||
// check he's not covered by ranks already
|
||||
for ( j = 0; j < numRankedPlayers; j++ ) {
|
||||
if ( ent == rankedPlayers[ j ] ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( j != numRankedPlayers ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
player = static_cast< idPlayer * >( ent );
|
||||
|
||||
if ( player->spectating )
|
||||
continue;
|
||||
|
||||
if ( player->team == 0 )
|
||||
curTeam = redTeam;
|
||||
else
|
||||
curTeam = blueTeam;
|
||||
|
||||
ilines[ player->team ]++;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ( !playerState[ i ].ingame ) {
|
||||
|
||||
/* "New Player" on player's name location */
|
||||
scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04244" ) );
|
||||
|
||||
/* "Connecting" on player's score location */
|
||||
scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04245" ) );
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
/* Player's name in player's name location */
|
||||
if ( !player->spectating )
|
||||
scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), gameLocal.userInfo[ i ].GetString( "ui_name" ) );
|
||||
|
||||
if ( gameState == WARMUP ) {
|
||||
|
||||
if ( player->spectating ) {
|
||||
|
||||
/* "Spectating" on player's score location */
|
||||
scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04246" ) );
|
||||
|
||||
} else {
|
||||
|
||||
/* Display "ready" in player's score location if they're ready. Display nothing if not. No room for 'not ready'. */
|
||||
scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), player->IsReady() ? common->GetLanguageDict()->GetString( "#str_04247" ) : "" );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Clear remaining slots
|
||||
for ( i = 0; i < 2; i++ )
|
||||
{
|
||||
if ( i )
|
||||
curTeam = blueTeam;
|
||||
else
|
||||
curTeam = redTeam;
|
||||
|
||||
for ( j = ilines[ i ]+1; j <= 8; j++ )
|
||||
{
|
||||
scoreBoard->SetStateString( va( "player%i_%s", j, curTeam ), "" );
|
||||
scoreBoard->SetStateString( va( "player%i_%s_score", j, curTeam ), "" );
|
||||
scoreBoard->SetStateString( va( "player%i_%s_wins", j, curTeam ), "" );
|
||||
scoreBoard->SetStateString( va( "player%i_%s_ping", j, curTeam ), "" );
|
||||
scoreBoard->SetStateInt( "rank_self", 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Don't display "CTF" -- if this scoreboard comes up, it should be apparent.
|
||||
|
||||
|
||||
if ( !playerState[ i ].ingame ) {
|
||||
|
||||
/* "New Player" on player's name location */
|
||||
scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04244" ) );
|
||||
|
||||
/* "Connecting" on player's score location */
|
||||
scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04245" ) );
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
/* Player's name in player's name location */
|
||||
if ( !player->spectating )
|
||||
scoreBoard->SetStateString( va( "player%i_%s", ilines[ player->team ], curTeam ), gameLocal.userInfo[ i ].GetString( "ui_name" ) );
|
||||
|
||||
if ( gameState == WARMUP ) {
|
||||
|
||||
if ( player->spectating ) {
|
||||
|
||||
/* "Spectating" on player's score location */
|
||||
scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), common->GetLanguageDict()->GetString( "#str_04246" ) );
|
||||
|
||||
} else {
|
||||
|
||||
/* Display "ready" in player's score location if they're ready. Display nothing if not. No room for 'not ready'. */
|
||||
scoreBoard->SetStateString( va( "player%i_%s_score", ilines[ player->team ], curTeam ), player->IsReady() ? common->GetLanguageDict()->GetString( "#str_04247" ) : "" );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Clear remaining slots
|
||||
for ( i = 0; i < 2; i++ )
|
||||
{
|
||||
if ( i )
|
||||
curTeam = blueTeam;
|
||||
else
|
||||
curTeam = redTeam;
|
||||
|
||||
for ( j = ilines[ i ]+1; j <= 8; j++ )
|
||||
{
|
||||
scoreBoard->SetStateString( va( "player%i_%s", j, curTeam ), "" );
|
||||
scoreBoard->SetStateString( va( "player%i_%s_score", j, curTeam ), "" );
|
||||
scoreBoard->SetStateString( va( "player%i_%s_wins", j, curTeam ), "" );
|
||||
scoreBoard->SetStateString( va( "player%i_%s_ping", j, curTeam ), "" );
|
||||
scoreBoard->SetStateInt( "rank_self", 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Don't display "CTF" -- if this scoreboard comes up, it should be apparent.
|
||||
|
||||
if ( gameLocal.gameType == GAME_CTF ) {
|
||||
|
||||
int captureLimit = gameLocal.serverInfo.GetInt( "si_fragLimit" );
|
||||
|
||||
int captureLimit = gameLocal.serverInfo.GetInt( "si_fragLimit" );
|
||||
|
||||
if ( captureLimit > MP_CTF_MAXPOINTS )
|
||||
captureLimit = MP_CTF_MAXPOINTS;
|
||||
|
||||
int timeLimit = gameLocal.serverInfo.GetInt( "si_timeLimit" );
|
||||
int timeLimit = gameLocal.serverInfo.GetInt( "si_timeLimit" );
|
||||
|
||||
/* Prints "Capture Limit: %i" at the bottom of the scoreboard, left */
|
||||
if ( captureLimit )
|
||||
scoreBoard->SetStateString( "gameinfo_red", va( common->GetLanguageDict()->GetString( "#str_11108" ), captureLimit) );
|
||||
else
|
||||
scoreBoard->SetStateString( "gameinfo_red", "" );
|
||||
/* Prints "Capture Limit: %i" at the bottom of the scoreboard, left */
|
||||
if ( captureLimit )
|
||||
scoreBoard->SetStateString( "gameinfo_red", va( common->GetLanguageDict()->GetString( "#str_11108" ), captureLimit) );
|
||||
else
|
||||
scoreBoard->SetStateString( "gameinfo_red", "" );
|
||||
|
||||
/* Prints "Time Limit: %i" at the bottom of the scoreboard, right */
|
||||
if ( timeLimit )
|
||||
scoreBoard->SetStateString( "gameinfo_blue", va( common->GetLanguageDict()->GetString( "#str_11109" ), timeLimit) );
|
||||
else
|
||||
scoreBoard->SetStateString( "gameinfo_blue", "" );
|
||||
/* Prints "Time Limit: %i" at the bottom of the scoreboard, right */
|
||||
if ( timeLimit )
|
||||
scoreBoard->SetStateString( "gameinfo_blue", va( common->GetLanguageDict()->GetString( "#str_11109" ), timeLimit) );
|
||||
else
|
||||
scoreBoard->SetStateString( "gameinfo_blue", "" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Set team scores
|
||||
scoreBoard->SetStateInt( "red_team_score", GetFlagPoints( 0 ) );
|
||||
scoreBoard->SetStateInt( "blue_team_score", GetFlagPoints( 1 ) );
|
||||
|
||||
// Set team scores
|
||||
scoreBoard->SetStateInt( "red_team_score", GetFlagPoints( 0 ) );
|
||||
scoreBoard->SetStateInt( "blue_team_score", GetFlagPoints( 1 ) );
|
||||
|
||||
// Handle flag status changed event
|
||||
scoreBoard->HandleNamedEvent( "BlueFlagStatusChange" );
|
||||
scoreBoard->HandleNamedEvent( "RedFlagStatusChange" );
|
||||
|
||||
scoreBoard->HandleNamedEvent( "RedFlagStatusChange" );
|
||||
|
||||
scoreBoard->Redraw( gameLocal.time );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -844,7 +844,7 @@ const char *idMultiplayerGame::GameTime() {
|
|||
if ( ms < 0 ) {
|
||||
ms = 0;
|
||||
}
|
||||
|
||||
|
||||
s = ms / 1000;
|
||||
m = s / 60;
|
||||
s -= m * 60;
|
||||
|
@ -1006,7 +1006,7 @@ idPlayer *idMultiplayerGame::FragLimitHit() {
|
|||
idMultiplayerGame::TimeLimitHit
|
||||
================
|
||||
*/
|
||||
bool idMultiplayerGame::TimeLimitHit() {
|
||||
bool idMultiplayerGame::TimeLimitHit() {
|
||||
int timeLimit = gameLocal.serverInfo.GetInt( "si_timeLimit" );
|
||||
if ( timeLimit ) {
|
||||
if ( gameLocal.time >= matchStartedTime + timeLimit * 60000 ) {
|
||||
|
@ -1174,7 +1174,7 @@ void idMultiplayerGame::UpdateWinsLosses( idPlayer *winner ) {
|
|||
PlayGlobalSound( player->entityNumber, SND_YOULOSE );
|
||||
}
|
||||
} else if ( gameLocal.gameType == GAME_TOURNEY ) {
|
||||
if ( player == winner ) {
|
||||
if ( player == winner ) {
|
||||
playerState[ i ].wins++;
|
||||
PlayGlobalSound( player->entityNumber, SND_YOUWIN );
|
||||
} else if ( i == currentTourneyPlayer[ 0 ] || i == currentTourneyPlayer[ 1 ] ) {
|
||||
|
@ -1210,7 +1210,7 @@ void idMultiplayerGame::UpdateWinsLosses( idPlayer *winner ) {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if ( winner ) {
|
||||
lastWinner = winner->entityNumber;
|
||||
} else {
|
||||
|
@ -1310,7 +1310,7 @@ void idMultiplayerGame::PlayerDeath( idPlayer *dead, idPlayer *killer, bool tele
|
|||
if ( killer ) {
|
||||
if ( gameLocal.gameType == GAME_LASTMAN ) {
|
||||
playerState[ dead->entityNumber ].fragCount--;
|
||||
|
||||
|
||||
} else if ( IsGametypeTeamBased() ) { /* CTF */
|
||||
if ( killer == dead || killer->team == dead->team ) {
|
||||
// suicide or teamkill
|
||||
|
@ -1357,7 +1357,7 @@ void idMultiplayerGame::PlayerStats( int clientNum, char *data, const int len )
|
|||
}
|
||||
|
||||
// find which team this player is on
|
||||
ent = gameLocal.entities[ clientNum ];
|
||||
ent = gameLocal.entities[ clientNum ];
|
||||
if ( ent && ent->IsType( idPlayer::Type ) ) {
|
||||
team = static_cast< idPlayer * >(ent)->team;
|
||||
} else {
|
||||
|
@ -1418,7 +1418,7 @@ void idMultiplayerGame::NewState( gameState_t news, idPlayer *player ) {
|
|||
teamPoints[0] = 0;
|
||||
teamPoints[1] = 0;
|
||||
|
||||
ClearHUDStatus();
|
||||
ClearHUDStatus();
|
||||
#endif
|
||||
|
||||
PlayGlobalSound( -1, SND_FIGHT );
|
||||
|
@ -1628,7 +1628,7 @@ void idMultiplayerGame::CycleTourneyPlayers( ) {
|
|||
if ( lastWinner != -1 ) {
|
||||
idEntity *ent = gameLocal.entities[ lastWinner ];
|
||||
if ( ent && ent->IsType( idPlayer::Type ) ) {
|
||||
currentTourneyPlayer[ 0 ] = lastWinner;
|
||||
currentTourneyPlayer[ 0 ] = lastWinner;
|
||||
}
|
||||
}
|
||||
FillTourneySlots( );
|
||||
|
@ -1669,7 +1669,7 @@ void idMultiplayerGame::ExecuteVote( void ) {
|
|||
if ( needRestart ) {
|
||||
cmdSystem->BufferCommandText( CMD_EXEC_APPEND, "nextMap" );
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
case VOTE_FRAGLIMIT:
|
||||
si_fragLimit.SetInteger( atoi( voteValue ) );
|
||||
|
@ -1900,7 +1900,7 @@ void idMultiplayerGame::Run() {
|
|||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
player = FragLimitHit();
|
||||
if ( player ) {
|
||||
// delay between detecting frag limit and ending game. let the death anims play
|
||||
|
@ -1944,7 +1944,7 @@ void idMultiplayerGame::Run() {
|
|||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
player = FragLeader();
|
||||
if ( player ) {
|
||||
if ( !fragLimitTimeout ) {
|
||||
|
@ -2557,10 +2557,10 @@ void idMultiplayerGame::UpdateHud( idPlayer *player, idUserInterface *hud ) {
|
|||
}
|
||||
|
||||
#ifdef CTF
|
||||
if ( IsGametypeFlagBased() )
|
||||
hud->SetStateInt( "self_team", player->team );
|
||||
else
|
||||
hud->SetStateInt( "self_team", -1 ); /* Disable */
|
||||
if ( IsGametypeFlagBased() )
|
||||
hud->SetStateInt( "self_team", player->team );
|
||||
else
|
||||
hud->SetStateInt( "self_team", -1 ); /* Disable */
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -2576,14 +2576,14 @@ void idMultiplayerGame::DrawScoreBoard( idPlayer *player ) {
|
|||
scoreBoard->Activate( true, gameLocal.time );
|
||||
playerState[ player->entityNumber ].scoreBoardUp = true;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CTF
|
||||
if ( IsGametypeFlagBased() )
|
||||
UpdateCTFScoreboard( scoreBoard, player );
|
||||
else
|
||||
if ( IsGametypeFlagBased() )
|
||||
UpdateCTFScoreboard( scoreBoard, player );
|
||||
else
|
||||
#endif
|
||||
UpdateScoreboard( scoreBoard, player );
|
||||
|
||||
|
||||
} else {
|
||||
if ( playerState[ player->entityNumber ].scoreBoardUp ) {
|
||||
scoreBoard->Activate( false, gameLocal.time );
|
||||
|
@ -2611,11 +2611,11 @@ idMultiplayerGame::AddChatLine
|
|||
void idMultiplayerGame::AddChatLine( const char *fmt, ... ) {
|
||||
idStr temp;
|
||||
va_list argptr;
|
||||
|
||||
|
||||
va_start( argptr, fmt );
|
||||
vsprintf( temp, fmt, argptr );
|
||||
va_end( argptr );
|
||||
|
||||
|
||||
gameLocal.Printf( "%s\n", temp.c_str() );
|
||||
|
||||
chatHistory[ chatHistoryIndex % NUM_CHAT_NOTIFY ].line = temp;
|
||||
|
@ -2704,10 +2704,10 @@ void idMultiplayerGame::WriteToSnapshot( idBitMsgDelta &msg ) const {
|
|||
}
|
||||
|
||||
#ifdef CTF
|
||||
msg.WriteShort( teamPoints[0] );
|
||||
msg.WriteShort( teamPoints[1] );
|
||||
msg.WriteShort( player_red_flag );
|
||||
msg.WriteShort( player_blue_flag );
|
||||
msg.WriteShort( teamPoints[0] );
|
||||
msg.WriteShort( teamPoints[1] );
|
||||
msg.WriteShort( player_red_flag );
|
||||
msg.WriteShort( player_blue_flag );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -2742,14 +2742,14 @@ void idMultiplayerGame::ReadFromSnapshot( const idBitMsgDelta &msg ) {
|
|||
playerState[i].ingame = msg.ReadBits( 1 ) != 0;
|
||||
}
|
||||
|
||||
#ifdef CTF
|
||||
teamPoints[0] = msg.ReadShort();
|
||||
teamPoints[1] = msg.ReadShort();
|
||||
#ifdef CTF
|
||||
teamPoints[0] = msg.ReadShort();
|
||||
teamPoints[1] = msg.ReadShort();
|
||||
|
||||
player_red_flag = msg.ReadShort();
|
||||
player_blue_flag = msg.ReadShort();
|
||||
player_red_flag = msg.ReadShort();
|
||||
player_blue_flag = msg.ReadShort();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
@ -2880,8 +2880,8 @@ void idMultiplayerGame::PrintMessageEvent( int to, msg_evt_t evt, int parm1, int
|
|||
break;
|
||||
|
||||
case MSG_FLAGTAKEN :
|
||||
if ( gameLocal.GetLocalPlayer() == NULL )
|
||||
break;
|
||||
if ( gameLocal.GetLocalPlayer() == NULL )
|
||||
break;
|
||||
|
||||
if ( parm2 < 0 || parm2 >= MAX_CLIENTS )
|
||||
break;
|
||||
|
@ -2894,8 +2894,8 @@ void idMultiplayerGame::PrintMessageEvent( int to, msg_evt_t evt, int parm1, int
|
|||
break;
|
||||
|
||||
case MSG_FLAGDROP :
|
||||
if ( gameLocal.GetLocalPlayer() == NULL )
|
||||
break;
|
||||
if ( gameLocal.GetLocalPlayer() == NULL )
|
||||
break;
|
||||
|
||||
if ( gameLocal.GetLocalPlayer()->team != parm1 ) {
|
||||
AddChatLine( common->GetLanguageDict()->GetString( "#str_11103" ) ); // your team
|
||||
|
@ -2905,8 +2905,8 @@ void idMultiplayerGame::PrintMessageEvent( int to, msg_evt_t evt, int parm1, int
|
|||
break;
|
||||
|
||||
case MSG_FLAGRETURN :
|
||||
if ( gameLocal.GetLocalPlayer() == NULL )
|
||||
break;
|
||||
if ( gameLocal.GetLocalPlayer() == NULL )
|
||||
break;
|
||||
|
||||
if ( parm2 >= 0 && parm2 < MAX_CLIENTS ) {
|
||||
if ( gameLocal.GetLocalPlayer()->team != parm1 ) {
|
||||
|
@ -2915,13 +2915,13 @@ void idMultiplayerGame::PrintMessageEvent( int to, msg_evt_t evt, int parm1, int
|
|||
AddChatLine( common->GetLanguageDict()->GetString( "#str_11121" ), gameLocal.userInfo[ parm2 ].GetString( "ui_name" ) ); // enemy
|
||||
}
|
||||
} else {
|
||||
AddChatLine( common->GetLanguageDict()->GetString( "#str_11105" ), parm1 ? common->GetLanguageDict()->GetString( "#str_11110" ) : common->GetLanguageDict()->GetString( "#str_11111" ) );
|
||||
AddChatLine( common->GetLanguageDict()->GetString( "#str_11105" ), parm1 ? common->GetLanguageDict()->GetString( "#str_11110" ) : common->GetLanguageDict()->GetString( "#str_11111" ) );
|
||||
}
|
||||
break;
|
||||
|
||||
case MSG_FLAGCAPTURE :
|
||||
if ( gameLocal.GetLocalPlayer() == NULL )
|
||||
break;
|
||||
if ( gameLocal.GetLocalPlayer() == NULL )
|
||||
break;
|
||||
|
||||
if ( parm2 < 0 || parm2 >= MAX_CLIENTS )
|
||||
break;
|
||||
|
@ -2930,8 +2930,8 @@ void idMultiplayerGame::PrintMessageEvent( int to, msg_evt_t evt, int parm1, int
|
|||
AddChatLine( common->GetLanguageDict()->GetString( "#str_11122" ), gameLocal.userInfo[ parm2 ].GetString( "ui_name" ) ); // your team
|
||||
} else {
|
||||
AddChatLine( common->GetLanguageDict()->GetString( "#str_11123" ), gameLocal.userInfo[ parm2 ].GetString( "ui_name" ) ); // enemy
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// AddChatLine( common->GetLanguageDict()->GetString( "#str_11106" ), parm1 ? common->GetLanguageDict()->GetString( "#str_11110" ) : common->GetLanguageDict()->GetString( "#str_11111" ) );
|
||||
break;
|
||||
|
||||
|
@ -3017,11 +3017,11 @@ void idMultiplayerGame::CheckRespawns( idPlayer *spectator ) {
|
|||
}
|
||||
} else {
|
||||
if ( gameLocal.gameType == GAME_DM || // CTF : 3wave sboily, was DM really included before?
|
||||
IsGametypeTeamBased() )
|
||||
{
|
||||
IsGametypeTeamBased() )
|
||||
{
|
||||
if ( gameState == WARMUP || gameState == COUNTDOWN || gameState == GAMEON ) {
|
||||
p->ServerSpectate( false );
|
||||
}
|
||||
}
|
||||
} else if ( gameLocal.gameType == GAME_TOURNEY ) {
|
||||
if ( i == currentTourneyPlayer[ 0 ] || i == currentTourneyPlayer[ 1 ] ) {
|
||||
if ( gameState == WARMUP || gameState == COUNTDOWN || gameState == GAMEON ) {
|
||||
|
@ -3336,7 +3336,7 @@ void idMultiplayerGame::ClientCallVote( vote_flags_t voteIndex, const char *vote
|
|||
idBitMsg outMsg;
|
||||
byte msgBuf[ MAX_GAME_MESSAGE_SIZE ];
|
||||
|
||||
// send
|
||||
// send
|
||||
outMsg.Init( msgBuf, sizeof( msgBuf ) );
|
||||
outMsg.WriteByte( GAME_RELIABLE_MESSAGE_CALLVOTE );
|
||||
outMsg.WriteByte( voteIndex );
|
||||
|
@ -3424,7 +3424,7 @@ void idMultiplayerGame::ServerCallVote( int clientNum, const idBitMsg &msg ) {
|
|||
if ( vote_timeLimit == gameLocal.serverInfo.GetInt( "si_timeLimit" ) ) {
|
||||
gameLocal.ServerSendChatMessage( clientNum, "server", common->GetLanguageDict()->GetString( "#str_04270" ) );
|
||||
common->DPrintf( "client %d: already at the voted Time Limit\n", clientNum );
|
||||
return;
|
||||
return;
|
||||
}
|
||||
if ( vote_timeLimit < si_timeLimit.GetMinValue() || vote_timeLimit > si_timeLimit.GetMaxValue() ) {
|
||||
gameLocal.ServerSendChatMessage( clientNum, "server", common->GetLanguageDict()->GetString( "#str_04269" ) );
|
||||
|
@ -3439,7 +3439,7 @@ void idMultiplayerGame::ServerCallVote( int clientNum, const idBitMsg &msg ) {
|
|||
if ( vote_fragLimit == gameLocal.serverInfo.GetInt( "si_fragLimit" ) ) {
|
||||
gameLocal.ServerSendChatMessage( clientNum, "server", common->GetLanguageDict()->GetString( "#str_04267" ) );
|
||||
common->DPrintf( "client %d: already at the voted Frag Limit\n", clientNum );
|
||||
return;
|
||||
return;
|
||||
}
|
||||
if ( vote_fragLimit < si_fragLimit.GetMinValue() || vote_fragLimit > si_fragLimit.GetMaxValue() ) {
|
||||
gameLocal.ServerSendChatMessage( clientNum, "server", common->GetLanguageDict()->GetString( "#str_04266" ) );
|
||||
|
@ -3619,7 +3619,7 @@ void idMultiplayerGame::MapRestart( void ) {
|
|||
teamPoints[0] = 0;
|
||||
teamPoints[1] = 0;
|
||||
|
||||
ClearHUDStatus();
|
||||
ClearHUDStatus();
|
||||
#endif
|
||||
|
||||
#ifdef CTF
|
||||
|
@ -3627,7 +3627,7 @@ void idMultiplayerGame::MapRestart( void ) {
|
|||
if ( g_balanceTDM.GetBool() && lastGameType != GAME_TDM && lastGameType != GAME_CTF && gameLocal.mpGame.IsGametypeTeamBased() ) {
|
||||
#else
|
||||
if ( g_balanceTDM.GetBool() && lastGameType != GAME_TDM && gameLocal.gameType == GAME_TDM ) {
|
||||
#endif
|
||||
#endif
|
||||
for ( clientNum = 0; clientNum < gameLocal.numClients; clientNum++ ) {
|
||||
if ( gameLocal.entities[ clientNum ] && gameLocal.entities[ clientNum ]->IsType( idPlayer::Type ) ) {
|
||||
if ( static_cast< idPlayer* >( gameLocal.entities[ clientNum ] )->BalanceTDM() ) {
|
||||
|
@ -3650,7 +3650,7 @@ void idMultiplayerGame::SwitchToTeam( int clientNum, int oldteam, int newteam )
|
|||
idEntity *ent;
|
||||
int i;
|
||||
|
||||
assert( IsGametypeTeamBased() ); /* CTF */
|
||||
assert( IsGametypeTeamBased() ); /* CTF */
|
||||
assert( oldteam != newteam );
|
||||
assert( !gameLocal.isClient );
|
||||
|
||||
|
@ -3662,16 +3662,16 @@ void idMultiplayerGame::SwitchToTeam( int clientNum, int oldteam, int newteam )
|
|||
if ( i == clientNum ) {
|
||||
continue;
|
||||
}
|
||||
ent = gameLocal.entities[ i ];
|
||||
ent = gameLocal.entities[ i ];
|
||||
if ( ent && ent->IsType( idPlayer::Type ) && static_cast< idPlayer * >(ent)->team == newteam ) {
|
||||
playerState[ clientNum ].teamFragCount = playerState[ i ].teamFragCount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( i == gameLocal.numClients ) {
|
||||
// alone on this team
|
||||
playerState[ clientNum ].teamFragCount = 0;
|
||||
|
||||
|
||||
}
|
||||
#ifdef CTF
|
||||
if ( ( gameState == GAMEON || ( IsGametypeFlagBased() && gameState == SUDDENDEATH ) ) && oldteam != -1 ) {
|
||||
|
@ -3686,9 +3686,9 @@ void idMultiplayerGame::SwitchToTeam( int clientNum, int oldteam, int newteam )
|
|||
}
|
||||
p->Kill( true, true );
|
||||
#ifdef CTF
|
||||
if ( IsGametypeFlagBased() )
|
||||
p->DropFlag();
|
||||
#endif
|
||||
if ( IsGametypeFlagBased() )
|
||||
p->DropFlag();
|
||||
#endif
|
||||
CheckAbortGame();
|
||||
}
|
||||
#ifdef CTF
|
||||
|
@ -3710,7 +3710,7 @@ void idMultiplayerGame::ProcessChatMessage( int clientNum, bool team, const char
|
|||
const char *prefix = NULL;
|
||||
int send_to; // 0 - all, 1 - specs, 2 - team
|
||||
int i;
|
||||
idEntity *ent;
|
||||
idEntity *ent;
|
||||
idPlayer *p;
|
||||
idStr prefixed_name;
|
||||
|
||||
|
@ -3761,7 +3761,7 @@ void idMultiplayerGame::ProcessChatMessage( int clientNum, bool team, const char
|
|||
}
|
||||
} else {
|
||||
for ( i = 0; i < gameLocal.numClients; i++ ) {
|
||||
ent = gameLocal.entities[ i ];
|
||||
ent = gameLocal.entities[ i ];
|
||||
if ( !ent || !ent->IsType( idPlayer::Type ) ) {
|
||||
continue;
|
||||
}
|
||||
|
@ -3801,7 +3801,7 @@ void idMultiplayerGame::Precache( void ) {
|
|||
return;
|
||||
}
|
||||
gameLocal.FindEntityDefDict( "player_doommarine", false );;
|
||||
|
||||
|
||||
// skins
|
||||
idStr str = cvarSystem->GetCVarString( "mod_validSkins" );
|
||||
idStr skin;
|
||||
|
@ -3881,7 +3881,7 @@ idMultiplayerGame::ToggleTeam
|
|||
void idMultiplayerGame::ToggleTeam( void ) {
|
||||
bool team;
|
||||
assert( gameLocal.isClient || gameLocal.localClientNum == 0 );
|
||||
|
||||
|
||||
team = ( idStr::Icmp( cvarSystem->GetCVarString( "ui_team" ), "Red" ) == 0 );
|
||||
if ( team ) {
|
||||
cvarSystem->SetCVarString( "ui_team", "Blue" );
|
||||
|
@ -4082,7 +4082,7 @@ void idMultiplayerGame::ServerWriteInitialReliableMessages( int clientNum ) {
|
|||
outMsg.WriteShort( startFragLimit );
|
||||
// send the powerup states and the spectate states
|
||||
for( i = 0; i < gameLocal.numClients; i++ ) {
|
||||
ent = gameLocal.entities[ i ];
|
||||
ent = gameLocal.entities[ i ];
|
||||
if ( i != clientNum && ent && ent->IsType( idPlayer::Type ) ) {
|
||||
outMsg.WriteShort( i );
|
||||
outMsg.WriteShort( static_cast< idPlayer * >( ent )->inventory.powerups );
|
||||
|
@ -4144,7 +4144,7 @@ void idMultiplayerGame::ClientReadWarmupTime( const idBitMsg &msg ) {
|
|||
/*
|
||||
#ifdef CTF
|
||||
|
||||
Threewave note:
|
||||
Threewave note:
|
||||
The below IsGametype...() functions were implemented for CTF,
|
||||
but we did not #ifdef CTF them, because doing so would clutter
|
||||
the codebase substantially. Please consider them part of the merged
|
||||
|
@ -4158,52 +4158,52 @@ idMultiplayerGame::IsGametypeTeamBased
|
|||
*/
|
||||
bool idMultiplayerGame::IsGametypeTeamBased( void ) /* CTF */
|
||||
{
|
||||
switch ( gameLocal.gameType )
|
||||
{
|
||||
case GAME_SP:
|
||||
case GAME_DM:
|
||||
case GAME_TOURNEY:
|
||||
case GAME_LASTMAN:
|
||||
return false;
|
||||
switch ( gameLocal.gameType )
|
||||
{
|
||||
case GAME_SP:
|
||||
case GAME_DM:
|
||||
case GAME_TOURNEY:
|
||||
case GAME_LASTMAN:
|
||||
return false;
|
||||
#ifdef CTF
|
||||
case GAME_CTF:
|
||||
case GAME_CTF:
|
||||
#endif
|
||||
case GAME_TDM:
|
||||
return true;
|
||||
case GAME_TDM:
|
||||
return true;
|
||||
|
||||
default:
|
||||
assert( !"Add support for your new gametype here." );
|
||||
}
|
||||
default:
|
||||
assert( !"Add support for your new gametype here." );
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
idMultiplayerGame::IsGametypeFlagBased
|
||||
idMultiplayerGame::IsGametypeFlagBased
|
||||
================
|
||||
*/
|
||||
bool idMultiplayerGame::IsGametypeFlagBased( void ) {
|
||||
switch ( gameLocal.gameType )
|
||||
{
|
||||
case GAME_SP:
|
||||
case GAME_DM:
|
||||
case GAME_TOURNEY:
|
||||
case GAME_LASTMAN:
|
||||
case GAME_TDM:
|
||||
return false;
|
||||
switch ( gameLocal.gameType )
|
||||
{
|
||||
case GAME_SP:
|
||||
case GAME_DM:
|
||||
case GAME_TOURNEY:
|
||||
case GAME_LASTMAN:
|
||||
case GAME_TDM:
|
||||
return false;
|
||||
|
||||
#ifdef CTF
|
||||
case GAME_CTF:
|
||||
return true;
|
||||
case GAME_CTF:
|
||||
return true;
|
||||
#endif
|
||||
|
||||
default:
|
||||
assert( !"Add support for your new gametype here." );
|
||||
}
|
||||
default:
|
||||
assert( !"Add support for your new gametype here." );
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
#ifdef CTF
|
||||
|
||||
|
@ -4213,8 +4213,8 @@ idMultiplayerGame::GetTeamFlag
|
|||
================
|
||||
*/
|
||||
idItemTeam * idMultiplayerGame::GetTeamFlag( int team ) {
|
||||
assert( team == 0 || team == 1 );
|
||||
|
||||
assert( team == 0 || team == 1 );
|
||||
|
||||
if ( !IsGametypeFlagBased() || ( team != 0 && team != 1 ) ) /* CTF */
|
||||
return NULL;
|
||||
|
||||
|
@ -4263,24 +4263,24 @@ idMultiplayerGame::GetFlagStatus
|
|||
================
|
||||
*/
|
||||
flagStatus_t idMultiplayerGame::GetFlagStatus( int team ) {
|
||||
//assert( IsGametypeFlagBased() );
|
||||
//assert( IsGametypeFlagBased() );
|
||||
|
||||
idItemTeam *teamFlag = GetTeamFlag( team );
|
||||
//assert( teamFlag != NULL );
|
||||
idItemTeam *teamFlag = GetTeamFlag( team );
|
||||
//assert( teamFlag != NULL );
|
||||
|
||||
if ( teamFlag != NULL ) {
|
||||
if ( teamFlag->carried == false && teamFlag->dropped == false )
|
||||
return FLAGSTATUS_INBASE;
|
||||
return FLAGSTATUS_INBASE;
|
||||
|
||||
if ( teamFlag->carried == true )
|
||||
if ( teamFlag->carried == true )
|
||||
return FLAGSTATUS_TAKEN;
|
||||
|
||||
if ( teamFlag->carried == false && teamFlag->dropped == true )
|
||||
return FLAGSTATUS_STRAY;
|
||||
return FLAGSTATUS_STRAY;
|
||||
}
|
||||
|
||||
//assert( !"Invalid flag state." );
|
||||
return FLAGSTATUS_NONE;
|
||||
//assert( !"Invalid flag state." );
|
||||
return FLAGSTATUS_NONE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -4355,7 +4355,7 @@ void idMultiplayerGame::ReloadScoreboard() {
|
|||
|
||||
#ifdef _D3XP
|
||||
idStr idMultiplayerGame::GetBestGametype( const char* map, const char* gametype ) {
|
||||
|
||||
|
||||
int num = declManager->GetNumDecls( DECL_MAPDEF );
|
||||
int i, j;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -51,7 +51,7 @@ typedef enum {
|
|||
GAME_TDM,
|
||||
GAME_LASTMAN,
|
||||
#ifdef CTF
|
||||
GAME_CTF,
|
||||
GAME_CTF,
|
||||
GAME_COUNT,
|
||||
#endif
|
||||
} gameType_t;
|
||||
|
@ -60,10 +60,10 @@ typedef enum {
|
|||
|
||||
// Used by the UI
|
||||
typedef enum {
|
||||
FLAGSTATUS_INBASE = 0,
|
||||
FLAGSTATUS_TAKEN = 1,
|
||||
FLAGSTATUS_STRAY = 2,
|
||||
FLAGSTATUS_NONE = 3
|
||||
FLAGSTATUS_INBASE = 0,
|
||||
FLAGSTATUS_TAKEN = 1,
|
||||
FLAGSTATUS_STRAY = 2,
|
||||
FLAGSTATUS_NONE = 3
|
||||
} flagStatus_t;
|
||||
|
||||
#endif
|
||||
|
@ -119,7 +119,7 @@ typedef enum {
|
|||
SND_TWO,
|
||||
SND_ONE,
|
||||
SND_SUDDENDEATH,
|
||||
#ifdef CTF
|
||||
#ifdef CTF
|
||||
SND_FLAG_CAPTURED_YOURS,
|
||||
SND_FLAG_CAPTURED_THEIRS,
|
||||
SND_FLAG_RETURN,
|
||||
|
@ -147,7 +147,7 @@ public:
|
|||
// checks rules and updates state of the mp game
|
||||
void Run( void );
|
||||
|
||||
// draws mp hud, scoredboard, etc..
|
||||
// draws mp hud, scoredboard, etc..
|
||||
bool Draw( int clientNum );
|
||||
|
||||
// updates a player vote
|
||||
|
@ -266,7 +266,7 @@ public:
|
|||
void ProcessVoiceChat( int clientNum, bool team, int index );
|
||||
|
||||
void Precache( void );
|
||||
|
||||
|
||||
// throttle UI switch rates
|
||||
void ThrottleUserInfo( void );
|
||||
void ToggleSpectate( void );
|
||||
|
@ -285,17 +285,17 @@ public:
|
|||
void ClientReadWarmupTime( const idBitMsg &msg );
|
||||
|
||||
void ServerClientConnect( int clientNum );
|
||||
#ifdef CTF
|
||||
void ClearHUDStatus( void );
|
||||
int GetFlagPoints( int team ); // Team points in CTF
|
||||
#ifdef CTF
|
||||
void ClearHUDStatus( void );
|
||||
int GetFlagPoints( int team ); // Team points in CTF
|
||||
void SetFlagMsg( bool b ); // allow flag event messages to be sent
|
||||
bool IsFlagMsgOn( void ); // should flag event messages go through?
|
||||
void ClearGuis( void );
|
||||
void ClearGuis( void );
|
||||
|
||||
int player_red_flag; // Ent num of red flag carrier for HUD
|
||||
int player_blue_flag; // Ent num of blue flag carrier for HUD
|
||||
int player_red_flag; // Ent num of red flag carrier for HUD
|
||||
int player_blue_flag; // Ent num of blue flag carrier for HUD
|
||||
|
||||
#endif
|
||||
#endif
|
||||
void PlayerStats( int clientNum, char *data, const int len );
|
||||
|
||||
private:
|
||||
|
@ -383,15 +383,15 @@ private:
|
|||
// updates the passed gui with current score information
|
||||
void UpdateRankColor( idUserInterface *gui, const char *mask, int i, const idVec3 &vec );
|
||||
void UpdateScoreboard( idUserInterface *scoreBoard, idPlayer *player );
|
||||
#ifdef CTF
|
||||
void UpdateCTFScoreboard( idUserInterface *scoreBoard, idPlayer *player );
|
||||
#ifdef CTF
|
||||
void UpdateCTFScoreboard( idUserInterface *scoreBoard, idPlayer *player );
|
||||
#endif
|
||||
|
||||
#ifndef CTF
|
||||
// We declare this publically above so we can call it during a map restart.
|
||||
// We declare this publically above so we can call it during a map restart.
|
||||
void ClearGuis( void );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
void DrawScoreBoard( idPlayer *player );
|
||||
void UpdateHud( idPlayer *player, idUserInterface *hud );
|
||||
bool Warmup( void );
|
||||
|
@ -436,18 +436,18 @@ private:
|
|||
#ifdef CTF
|
||||
void FindTeamFlags( void );
|
||||
#endif
|
||||
|
||||
|
||||
public:
|
||||
|
||||
#ifdef CTF
|
||||
#ifdef CTF
|
||||
idItemTeam * GetTeamFlag( int team );
|
||||
flagStatus_t GetFlagStatus( int team );
|
||||
flagStatus_t GetFlagStatus( int team );
|
||||
void TeamScoreCTF( int team, int delta );
|
||||
void PlayerScoreCTF( int playerIdx, int delta );
|
||||
// returns entityNum to team flag carrier, -1 if no flag carrier
|
||||
int GetFlagCarrier( int team );
|
||||
void UpdateScoreboardFlagStatus( void );
|
||||
|
||||
void UpdateScoreboardFlagStatus( void );
|
||||
|
||||
void SetBestGametype( const char * map );
|
||||
void ReloadScoreboard();
|
||||
#endif
|
||||
|
@ -460,7 +460,7 @@ public:
|
|||
bool IsGametypeFlagBased( void );
|
||||
bool IsGametypeTeamBased( void );
|
||||
/* #endif CTF */
|
||||
|
||||
|
||||
};
|
||||
|
||||
ID_INLINE idMultiplayerGame::gameState_t idMultiplayerGame::GetGameState( void ) const {
|
||||
|
@ -480,4 +480,3 @@ ID_INLINE bool idMultiplayerGame::IsInGame( int clientNum ) {
|
|||
}
|
||||
|
||||
#endif /* !__MULTIPLAYERGAME_H__ */
|
||||
|
||||
|
|
288
d3xp/Player.cpp
288
d3xp/Player.cpp
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -131,9 +131,9 @@ const int MAX_INVENTORY_ITEMS = 20;
|
|||
|
||||
|
||||
#ifdef _D3XP
|
||||
idVec3 idPlayer::colorBarTable[ 8 ] = {
|
||||
idVec3 idPlayer::colorBarTable[ 8 ] = {
|
||||
#else
|
||||
idVec3 idPlayer::colorBarTable[ 5 ] = {
|
||||
idVec3 idPlayer::colorBarTable[ 5 ] = {
|
||||
#endif
|
||||
idVec3( 0.25f, 0.25f, 0.25f ),
|
||||
idVec3( 1.00f, 0.00f, 0.00f ),
|
||||
|
@ -169,7 +169,7 @@ void idInventory::Clear( void ) {
|
|||
|
||||
// set to -1 so that the gun knows to have a full clip the first time we get it and at the start of the level
|
||||
memset( clip, -1, sizeof( clip ) );
|
||||
|
||||
|
||||
items.DeleteContents( true );
|
||||
memset(pdasViewed, 0, 4 * sizeof( pdasViewed[0] ) );
|
||||
pdas.Clear();
|
||||
|
@ -218,7 +218,7 @@ void idInventory::GivePowerUp( idPlayer *player, int powerup, int msec ) {
|
|||
case MEGAHEALTH:
|
||||
def = gameLocal.FindEntityDef( "powerup_megahealth", false );
|
||||
break;
|
||||
case ADRENALINE:
|
||||
case ADRENALINE:
|
||||
def = gameLocal.FindEntityDef( "powerup_adrenaline", false );
|
||||
break;
|
||||
#ifdef _D3XP
|
||||
|
@ -266,7 +266,7 @@ void idInventory::GetPersistantData( idDict &dict ) {
|
|||
// armor
|
||||
dict.SetInt( "armor", armor );
|
||||
|
||||
// don't bother with powerups, maxhealth, maxarmor, or the clip
|
||||
// don't bother with powerups, maxhealth, maxarmor, or the clip
|
||||
|
||||
// ammo
|
||||
for( i = 0; i < AMMO_NUMTYPES; i++ ) {
|
||||
|
@ -502,7 +502,7 @@ void idInventory::Save( idSaveGame *savefile ) const {
|
|||
savefile->WriteInt( pdasViewed[1] );
|
||||
savefile->WriteInt( pdasViewed[2] );
|
||||
savefile->WriteInt( pdasViewed[3] );
|
||||
|
||||
|
||||
savefile->WriteInt( selPDA );
|
||||
savefile->WriteInt( selVideo );
|
||||
savefile->WriteInt( selEMail );
|
||||
|
@ -610,7 +610,7 @@ void idInventory::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadInt( pdasViewed[1] );
|
||||
savefile->ReadInt( pdasViewed[2] );
|
||||
savefile->ReadInt( pdasViewed[3] );
|
||||
|
||||
|
||||
savefile->ReadInt( selPDA );
|
||||
savefile->ReadInt( selVideo );
|
||||
savefile->ReadInt( selEMail );
|
||||
|
@ -691,7 +691,7 @@ void idInventory::Restore( idRestoreGame *savefile ) {
|
|||
for(i = 0; i < AMMO_NUMTYPES; i++) {
|
||||
savefile->ReadInt(rechargeAmmo[i].ammo);
|
||||
savefile->ReadInt(rechargeAmmo[i].rechargeTime);
|
||||
|
||||
|
||||
idStr name;
|
||||
savefile->ReadString(name);
|
||||
strcpy(rechargeAmmo[i].ammoName, name);
|
||||
|
@ -796,7 +796,7 @@ void idInventory::AddPickupName( const char *name, const char *icon, idPlayer* o
|
|||
msg.WriteString( name, MAX_EVENT_PARAM_SIZE );
|
||||
owner->ServerSendEvent( idPlayer::EVENT_PICKUPNAME, &msg, false, -1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -820,7 +820,7 @@ bool idInventory::Give( idPlayer *owner, const idDict &spawnArgs, const char *st
|
|||
|
||||
#ifdef _D3XP
|
||||
if ( !idStr::Icmp( statname, "ammo_bloodstone" ) ) {
|
||||
i = AmmoIndexForAmmoClass( statname );
|
||||
i = AmmoIndexForAmmoClass( statname );
|
||||
max = MaxAmmoForAmmoClass( owner, statname );
|
||||
|
||||
if(max <= 0) {
|
||||
|
@ -848,7 +848,7 @@ bool idInventory::Give( idPlayer *owner, const idDict &spawnArgs, const char *st
|
|||
return false;
|
||||
}
|
||||
amount = atoi( value );
|
||||
if ( amount ) {
|
||||
if ( amount ) {
|
||||
ammo[ i ] += amount;
|
||||
if ( ( max > 0 ) && ( ammo[ i ] > max ) ) {
|
||||
ammo[ i ] = max;
|
||||
|
@ -948,7 +948,7 @@ bool idInventory::Give( idPlayer *owner, const idDict &spawnArgs, const char *st
|
|||
if ( owner->GetUserInfo()->GetBool( "ui_autoSwitch" ) && idealWeapon && i != owner->weapon_bloodstone_active1 && i != owner->weapon_bloodstone_active2 && i != owner->weapon_bloodstone_active3) {
|
||||
assert( !gameLocal.isClient );
|
||||
*idealWeapon = i;
|
||||
}
|
||||
}
|
||||
if ( owner->hud && updateHud && lastGiveTime + 1000 < gameLocal.time ) {
|
||||
owner->hud->SetStateInt( "newWeapon", i );
|
||||
owner->hud->HandleNamedEvent( "newWeapon" );
|
||||
|
@ -1043,7 +1043,7 @@ int idInventory::HasAmmo( const char *weapon_classname, bool includeClip, idPlay
|
|||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef _D3XP
|
||||
/*
|
||||
===============
|
||||
|
@ -1051,7 +1051,7 @@ idInventory::HasEmptyClipCannotRefill
|
|||
===============
|
||||
*/
|
||||
bool idInventory::HasEmptyClipCannotRefill(const char *weapon_classname, idPlayer* owner) {
|
||||
|
||||
|
||||
int clipSize = clip[owner->SlotForWeapon(weapon_classname)];
|
||||
if(clipSize) {
|
||||
return false;
|
||||
|
@ -1257,9 +1257,9 @@ idPlayer::idPlayer() {
|
|||
forcedReady = false;
|
||||
wantSpectate = false;
|
||||
|
||||
#ifdef CTF
|
||||
#ifdef CTF
|
||||
carryingFlag = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
lastHitToggle = false;
|
||||
|
||||
|
@ -1349,7 +1349,7 @@ idPlayer::idPlayer() {
|
|||
talkCursor = 0;
|
||||
focusVehicle = NULL;
|
||||
cursor = NULL;
|
||||
|
||||
|
||||
oldMouseX = 0;
|
||||
oldMouseY = 0;
|
||||
|
||||
|
@ -1678,7 +1678,7 @@ void idPlayer::Init( void ) {
|
|||
|
||||
// execute the script so the script object's constructor takes effect immediately
|
||||
scriptThread->Execute();
|
||||
|
||||
|
||||
forceScoreBoard = false;
|
||||
forcedReady = false;
|
||||
|
||||
|
@ -1759,11 +1759,11 @@ void idPlayer::Spawn( void ) {
|
|||
if ( hud ) {
|
||||
hud->Activate( true, gameLocal.time );
|
||||
#ifdef CTF
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() ) {
|
||||
hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints(0) );
|
||||
hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints(1) );
|
||||
}
|
||||
#endif
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() ) {
|
||||
hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints(0) );
|
||||
hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints(1) );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// load cursor
|
||||
|
@ -1876,7 +1876,7 @@ void idPlayer::Spawn( void ) {
|
|||
} else {
|
||||
hiddenWeapon = false;
|
||||
}
|
||||
|
||||
|
||||
if ( hud ) {
|
||||
UpdateHudWeapon();
|
||||
hud->StateChanged( gameLocal.time );
|
||||
|
@ -1986,7 +1986,7 @@ idPlayer::~idPlayer() {
|
|||
enviroSuitLight.GetEntity()->ProcessEvent( &EV_Remove );
|
||||
}
|
||||
// have to do this here, idMultiplayerGame::DisconnectClient() is too late
|
||||
if ( gameLocal.isMultiplayer && gameLocal.mpGame.IsGametypeFlagBased() ) {
|
||||
if ( gameLocal.isMultiplayer && gameLocal.mpGame.IsGametypeFlagBased() ) {
|
||||
ReturnFlag();
|
||||
}
|
||||
#endif
|
||||
|
@ -2040,8 +2040,8 @@ void idPlayer::Save( idSaveGame *savefile ) const {
|
|||
savefile->WriteInt( hudPowerup );
|
||||
savefile->WriteInt( lastHudPowerup );
|
||||
savefile->WriteInt( hudPowerupDuration );
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
savefile->WriteInt( heartRate );
|
||||
|
@ -2300,8 +2300,8 @@ void idPlayer::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadInt( hudPowerup );
|
||||
savefile->ReadInt( lastHudPowerup );
|
||||
savefile->ReadInt( hudPowerupDuration );
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
savefile->ReadInt( heartRate );
|
||||
|
@ -2540,17 +2540,17 @@ void idPlayer::PrepareForRestart( void ) {
|
|||
ClearPowerUps();
|
||||
Spectate( true );
|
||||
forceRespawn = true;
|
||||
|
||||
|
||||
#ifdef CTF
|
||||
// Confirm reset hud states
|
||||
DropFlag();
|
||||
DropFlag();
|
||||
|
||||
if ( hud ) {
|
||||
hud->SetStateInt( "red_flagstatus", 0 );
|
||||
hud->SetStateInt( "blue_flagstatus", 0 );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// we will be restarting program, clear the client entities from program-related things first
|
||||
ShutdownThreads();
|
||||
|
||||
|
@ -2565,7 +2565,7 @@ idPlayer::Restart
|
|||
*/
|
||||
void idPlayer::Restart( void ) {
|
||||
idActor::Restart();
|
||||
|
||||
|
||||
// client needs to setup the animation script object again
|
||||
if ( gameLocal.isClient ) {
|
||||
Init();
|
||||
|
@ -2604,7 +2604,7 @@ void idPlayer::ServerSpectate( bool spectate ) {
|
|||
}
|
||||
#ifdef CTF
|
||||
// drop the flag if player was carrying it
|
||||
if ( spectate && gameLocal.isMultiplayer && gameLocal.mpGame.IsGametypeFlagBased() &&
|
||||
if ( spectate && gameLocal.isMultiplayer && gameLocal.mpGame.IsGametypeFlagBased() &&
|
||||
carryingFlag )
|
||||
{
|
||||
DropFlag();
|
||||
|
@ -2649,7 +2649,7 @@ Chooses a spawn location and spawns the player
|
|||
void idPlayer::SpawnFromSpawnSpot( void ) {
|
||||
idVec3 spawn_origin;
|
||||
idAngles spawn_angles;
|
||||
|
||||
|
||||
SelectInitialSpawnPoint( spawn_origin, spawn_angles );
|
||||
SpawnToPoint( spawn_origin, spawn_angles );
|
||||
}
|
||||
|
@ -2935,7 +2935,7 @@ bool idPlayer::UserInfoChanged( bool canModify ) {
|
|||
if ( canModify && spec ) {
|
||||
userInfo->Set( "ui_spectate", "Play" );
|
||||
modifiedInfo |= true;
|
||||
} else if ( spectating ) {
|
||||
} else if ( spectating ) {
|
||||
// allow player to leaving spectator mode if they were in it when si_spectators got turned off
|
||||
forceRespawn = true;
|
||||
}
|
||||
|
@ -2989,7 +2989,7 @@ void idPlayer::UpdateHudAmmo( idUserInterface *_hud ) {
|
|||
// show infinite ammo
|
||||
_hud->SetStateString( "player_ammo", "" );
|
||||
_hud->SetStateString( "player_totalammo", "" );
|
||||
} else {
|
||||
} else {
|
||||
// show remaining ammo
|
||||
#ifdef _D3XP
|
||||
_hud->SetStateString( "player_totalammo", va( "%i", ammoamount ) );
|
||||
|
@ -3004,7 +3004,7 @@ void idPlayer::UpdateHudAmmo( idUserInterface *_hud ) {
|
|||
#else
|
||||
_hud->SetStateString( "player_allammo", va( "%i/%i", inclip, ammoamount - inclip ) );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
_hud->SetStateBool( "player_ammo_empty", ( ammoamount == 0 ) );
|
||||
_hud->SetStateBool( "player_clip_empty", ( weapon.GetEntity()->ClipSize() ? inclip == 0 : false ) );
|
||||
|
@ -3059,7 +3059,7 @@ void idPlayer::UpdateHudStats( idUserInterface *_hud ) {
|
|||
_hud->SetStateInt( "player_stamina", staminapercentage );
|
||||
_hud->SetStateInt( "player_armor", inventory.armor );
|
||||
_hud->SetStateInt( "player_hr", heartRate );
|
||||
|
||||
|
||||
_hud->SetStateInt( "player_nostamina", ( max_stamina == 0 ) ? 1 : 0 );
|
||||
|
||||
_hud->HandleNamedEvent( "updateArmorHealthAir" );
|
||||
|
@ -3080,7 +3080,7 @@ void idPlayer::UpdateHudStats( idUserInterface *_hud ) {
|
|||
healthTake = false;
|
||||
}
|
||||
|
||||
if ( inventory.ammoPulse ) {
|
||||
if ( inventory.ammoPulse ) {
|
||||
_hud->HandleNamedEvent( "ammoPulse" );
|
||||
inventory.ammoPulse = false;
|
||||
}
|
||||
|
@ -3092,28 +3092,28 @@ void idPlayer::UpdateHudStats( idUserInterface *_hud ) {
|
|||
_hud->HandleNamedEvent( "weaponPulse" );
|
||||
inventory.weaponPulse = false;
|
||||
}
|
||||
if ( inventory.armorPulse ) {
|
||||
if ( inventory.armorPulse ) {
|
||||
_hud->HandleNamedEvent( "armorPulse" );
|
||||
inventory.armorPulse = false;
|
||||
}
|
||||
|
||||
#ifdef CTF
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && _hud )
|
||||
{
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && _hud )
|
||||
{
|
||||
_hud->SetStateInt( "red_flagstatus", gameLocal.mpGame.GetFlagStatus( 0 ) );
|
||||
_hud->SetStateInt( "blue_flagstatus", gameLocal.mpGame.GetFlagStatus( 1 ) );
|
||||
|
||||
_hud->SetStateInt( "red_team_score", gameLocal.mpGame.GetFlagPoints( 0 ) );
|
||||
_hud->SetStateInt( "blue_team_score", gameLocal.mpGame.GetFlagPoints( 1 ) );
|
||||
|
||||
_hud->HandleNamedEvent( "RedFlagStatusChange" );
|
||||
_hud->HandleNamedEvent( "BlueFlagStatusChange" );
|
||||
}
|
||||
|
||||
_hud->HandleNamedEvent( "selfTeam" );
|
||||
|
||||
_hud->HandleNamedEvent( "RedFlagStatusChange" );
|
||||
_hud->HandleNamedEvent( "BlueFlagStatusChange" );
|
||||
}
|
||||
|
||||
_hud->HandleNamedEvent( "selfTeam" );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
UpdateHudAmmo( _hud );
|
||||
}
|
||||
|
@ -3233,9 +3233,9 @@ void idPlayer::EnterCinematic( void ) {
|
|||
if ( hud ) {
|
||||
hud->HandleNamedEvent( "radioChatterDown" );
|
||||
}
|
||||
|
||||
|
||||
physicsObj.SetLinearVelocity( vec3_origin );
|
||||
|
||||
|
||||
SetState( "EnterCinematic" );
|
||||
UpdateScript();
|
||||
|
||||
|
@ -3430,7 +3430,7 @@ void idPlayer::CacheWeapons( void ) {
|
|||
if ( !inventory.weapons ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for( w = 0; w < MAX_WEAPONS; w++ ) {
|
||||
if ( inventory.weapons & ( 1 << w ) ) {
|
||||
weap = spawnArgs.GetString( va( "def_weapon%d", w ) );
|
||||
|
@ -3503,11 +3503,11 @@ bool idPlayer::Give( const char *statname, const char *value ) {
|
|||
} else {
|
||||
bool ret = inventory.Give( this, spawnArgs, statname, value, &idealWeapon, true );
|
||||
if(!idStr::Icmp( statname, "ammo_bloodstone" ) ) {
|
||||
//int i = inventory.AmmoIndexForAmmoClass( statname );
|
||||
//int i = inventory.AmmoIndexForAmmoClass( statname );
|
||||
//int max = inventory.MaxAmmoForAmmoClass( this, statname );
|
||||
//if(hud && inventory.ammo[ i ] >= max) {
|
||||
if(hud) {
|
||||
|
||||
|
||||
//Force an update of the bloodstone ammount
|
||||
int ammoRequired;
|
||||
ammo_t ammo_i = inventory.AmmoIndexForWeaponClass( "weapon_bloodstone_passive", &ammoRequired );
|
||||
|
@ -3536,7 +3536,7 @@ adds health to the player health pool
|
|||
===============
|
||||
*/
|
||||
void idPlayer::GiveHealthPool( float amt ) {
|
||||
|
||||
|
||||
if ( AI_DEAD ) {
|
||||
return;
|
||||
}
|
||||
|
@ -3569,7 +3569,7 @@ bool idPlayer::GiveItem( idItem *item ) {
|
|||
}
|
||||
|
||||
item->GetAttributes( attr );
|
||||
|
||||
|
||||
gave = false;
|
||||
numPickup = inventory.pickupItemNames.Num();
|
||||
for( i = 0; i < attr.GetNumKeyVals(); i++ ) {
|
||||
|
@ -3643,7 +3643,7 @@ float idPlayer::PowerUpModifier( int type ) {
|
|||
}
|
||||
}
|
||||
}*/
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
return mod;
|
||||
|
@ -3696,7 +3696,7 @@ bool idPlayer::GivePowerUp( int powerup, int time ) {
|
|||
StartSoundShader( declManager->FindSound( sound ), SND_CHANNEL_DEMONIC, 0, false, NULL );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ( baseSkinName.Length() ) {
|
||||
powerUpSkin = declManager->FindSkin( baseSkinName + "_berserk" );
|
||||
|
@ -3813,7 +3813,7 @@ bool idPlayer::GivePowerUp( int powerup, int time ) {
|
|||
if(gameLocal.isMultiplayer && !gameLocal.isClient) {
|
||||
inventory.AddPickupName("#str_00100631", "", this);
|
||||
}
|
||||
|
||||
|
||||
if ( baseSkinName.Length() ) {
|
||||
powerUpSkin = declManager->FindSkin( baseSkinName + "_haste" );
|
||||
}
|
||||
|
@ -3877,7 +3877,7 @@ void idPlayer::ClearPowerup( int i ) {
|
|||
break;
|
||||
}
|
||||
case ENVIROSUIT: {
|
||||
|
||||
|
||||
hudPowerup = -1;
|
||||
|
||||
// Turn off the envirosuit sound
|
||||
|
@ -3978,7 +3978,7 @@ void idPlayer::UpdatePowerUps( void ) {
|
|||
#ifndef ID_DEMO_BUILD
|
||||
if ( !gameLocal.inCinematic && influenceActive == 0 && g_skill.GetInteger() == 3 && gameLocal.time > nextHealthTake && !AI_DEAD && health > g_healthTakeLimit.GetInteger() ) {
|
||||
assert( !gameLocal.isClient ); // healthPool never be set on client
|
||||
|
||||
|
||||
#ifdef _D3XP
|
||||
if(!PowerUpActive(INVULNERABILITY)) {
|
||||
#endif
|
||||
|
@ -4388,13 +4388,13 @@ void idPlayer::NextBestWeapon( void ) {
|
|||
}
|
||||
|
||||
#ifdef _D3XP
|
||||
//Some weapons will report having ammo but the clip is empty and
|
||||
//Some weapons will report having ammo but the clip is empty and
|
||||
//will not have enough to fill the clip (i.e. Double Barrel Shotgun with 1 round left)
|
||||
//We need to skip these weapons because they cannot be used
|
||||
if(inventory.HasEmptyClipCannotRefill(weap, this)) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -4425,13 +4425,13 @@ void idPlayer::NextWeapon( void ) {
|
|||
if ( !inventory.weapons ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
w = idealWeapon;
|
||||
while( 1 ) {
|
||||
w++;
|
||||
if ( w >= MAX_WEAPONS ) {
|
||||
w = 0;
|
||||
}
|
||||
}
|
||||
weap = spawnArgs.GetString( va( "def_weapon%d", w ) );
|
||||
if ( !spawnArgs.GetBool( va( "weapon%d_cycle", w ) ) ) {
|
||||
continue;
|
||||
|
@ -4542,7 +4542,7 @@ void idPlayer::SelectWeapon( int num, bool force ) {
|
|||
} else {
|
||||
weapon.GetEntity()->RaiseWeapon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
weap = spawnArgs.GetString( va( "def_weapon%d", num ) );
|
||||
if ( !weap[ 0 ] ) {
|
||||
|
@ -4578,7 +4578,7 @@ void idPlayer::SelectWeapon( int num, bool force ) {
|
|||
}
|
||||
|
||||
for(int i = 0; i < weaponToggle->toggleList.Num(); i++) {
|
||||
|
||||
|
||||
//Is it available
|
||||
if(inventory.weapons & ( 1 << weaponToggle->toggleList[weaponToggleIndex])) {
|
||||
break;
|
||||
|
@ -4632,11 +4632,11 @@ void idPlayer::DropWeapon( bool died ) {
|
|||
int inclip, ammoavailable;
|
||||
|
||||
assert( !gameLocal.isClient );
|
||||
|
||||
|
||||
if ( spectating || weaponGone || weapon.GetEntity() == NULL ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( ( !died && !weapon.GetEntity()->IsReady() ) || weapon.GetEntity()->IsReloading() ) {
|
||||
return;
|
||||
}
|
||||
|
@ -4644,7 +4644,7 @@ void idPlayer::DropWeapon( bool died ) {
|
|||
// inclip is which amount is in clip right now
|
||||
ammoavailable = weapon.GetEntity()->AmmoAvailable();
|
||||
inclip = weapon.GetEntity()->AmmoInClip();
|
||||
|
||||
|
||||
// don't drop a grenade if we have none left
|
||||
if ( !idStr::Icmp( idWeapon::GetAmmoNameForNum( weapon.GetEntity()->GetAmmoType() ), "ammo_grenades" ) && ( ammoavailable - inclip <= 0 ) ) {
|
||||
return;
|
||||
|
@ -4811,7 +4811,7 @@ void idPlayer::Weapon_Combat( void ) {
|
|||
SetState( newstate );
|
||||
UpdateScript();
|
||||
}
|
||||
weaponCatchup = false;
|
||||
weaponCatchup = false;
|
||||
} else {
|
||||
if ( weapon.GetEntity()->IsReady() ) {
|
||||
weapon.GetEntity()->PutAway();
|
||||
|
@ -4834,7 +4834,7 @@ void idPlayer::Weapon_Combat( void ) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
weaponGone = false; // if you drop and re-get weap, you may miss the = false above
|
||||
weaponGone = false; // if you drop and re-get weap, you may miss the = false above
|
||||
if ( weapon.GetEntity()->IsHolstered() ) {
|
||||
if ( !weapon.GetEntity()->AmmoAvailable() ) {
|
||||
// weapons can switch automatically if they have no more ammo
|
||||
|
@ -5008,7 +5008,7 @@ void idPlayer::UpdateWeapon( void ) {
|
|||
if ( hiddenWeapon && tipUp && usercmd.buttons & BUTTON_ATTACK ) {
|
||||
HideTip();
|
||||
}
|
||||
|
||||
|
||||
if ( g_dragEntity.GetBool() ) {
|
||||
StopFiring();
|
||||
weapon.GetEntity()->LowerWeapon();
|
||||
|
@ -5016,12 +5016,12 @@ void idPlayer::UpdateWeapon( void ) {
|
|||
} else if ( ActiveGui() ) {
|
||||
// gui handling overrides weapon use
|
||||
Weapon_GUI();
|
||||
} else if ( focusCharacter && ( focusCharacter->health > 0 ) ) {
|
||||
} else if ( focusCharacter && ( focusCharacter->health > 0 ) ) {
|
||||
Weapon_NPC();
|
||||
} else {
|
||||
Weapon_Combat();
|
||||
}
|
||||
|
||||
|
||||
if ( hiddenWeapon ) {
|
||||
weapon.GetEntity()->LowerWeapon();
|
||||
}
|
||||
|
@ -5063,7 +5063,7 @@ void idPlayer::SpectateFreeFly( bool force ) {
|
|||
idAngles angle = player->viewAngles;
|
||||
angle[ 2 ] = 0;
|
||||
SetViewAngles( angle );
|
||||
} else {
|
||||
} else {
|
||||
SelectInitialSpawnPoint( spawn_origin, spawn_angles );
|
||||
spawn_origin[ 2 ] += pm_normalviewheight.GetFloat();
|
||||
spawn_origin[ 2 ] += SPECTATE_RAISE;
|
||||
|
@ -5257,7 +5257,7 @@ bool idPlayer::Collide( const trace_t &collision, const idVec3 &velocity ) {
|
|||
================
|
||||
idPlayer::UpdateLocation
|
||||
|
||||
Searches nearby locations
|
||||
Searches nearby locations
|
||||
================
|
||||
*/
|
||||
void idPlayer::UpdateLocation( void ) {
|
||||
|
@ -5440,7 +5440,7 @@ void idPlayer::UpdateFocus( void ) {
|
|||
} else {
|
||||
ui = focusGUIrenderEntity->gui[ 2 ];
|
||||
}
|
||||
|
||||
|
||||
if ( ui == NULL ) {
|
||||
continue;
|
||||
}
|
||||
|
@ -5504,7 +5504,7 @@ void idPlayer::UpdateFocus( void ) {
|
|||
// clamp the mouse to the corner
|
||||
ev = sys->GenerateMouseMoveEvent( -2000, -2000 );
|
||||
command = focusUI->HandleEvent( &ev, gameLocal.time );
|
||||
HandleGuiCommands( focusGUIent, command );
|
||||
HandleGuiCommands( focusGUIent, command );
|
||||
|
||||
// move to an absolute position
|
||||
ev = sys->GenerateMouseMoveEvent( pt.x * SCREEN_WIDTH, pt.y * SCREEN_HEIGHT );
|
||||
|
@ -5747,7 +5747,7 @@ void idPlayer::BobCycle( const idVec3 &pushVelocity ) {
|
|||
// add angles based on velocity
|
||||
delta = velocity * viewaxis[0];
|
||||
viewBobAngles.pitch += delta * pm_runpitch.GetFloat();
|
||||
|
||||
|
||||
delta = velocity * viewaxis[1];
|
||||
viewBobAngles.roll -= delta * pm_runroll.GetFloat();
|
||||
|
||||
|
@ -5943,10 +5943,10 @@ Being at less than 25% stamina adds 5 beats per second up to ZEROSTAMINA_HEARTRA
|
|||
All heartrates are target rates.. the heart rate will start falling as soon as there have been no adjustments for 5 seconds
|
||||
Once it starts falling it always tries to get to DEF_HEARTRATE
|
||||
|
||||
The exception to the above rule is upon death at which point the rate is set to DYING_HEARTRATE and starts falling
|
||||
The exception to the above rule is upon death at which point the rate is set to DYING_HEARTRATE and starts falling
|
||||
immediately to zero
|
||||
|
||||
Heart rate volumes go from zero ( -40 db for DEF_HEARTRATE to 5 db for MAX_HEARTRATE ) the volume is
|
||||
Heart rate volumes go from zero ( -40 db for DEF_HEARTRATE to 5 db for MAX_HEARTRATE ) the volume is
|
||||
scaled linearly based on the actual rate
|
||||
|
||||
Exception to the above rule is once the player is dead, the dying heart rate starts at either the current volume if
|
||||
|
@ -5963,7 +5963,7 @@ void idPlayer::AdjustHeartRate( int target, float timeInSecs, float delay, bool
|
|||
return;
|
||||
}
|
||||
|
||||
lastHeartAdjust = gameLocal.time;
|
||||
lastHeartAdjust = gameLocal.time;
|
||||
|
||||
heartInfo.Init( gameLocal.time + delay * 1000, timeInSecs * 1000, heartRate, target );
|
||||
}
|
||||
|
@ -6017,7 +6017,7 @@ void idPlayer::SetCurrentHeartRate( void ) {
|
|||
pct = 0.0f;
|
||||
}
|
||||
pct *= ((float)deathVol - (float)zeroVol);
|
||||
}
|
||||
}
|
||||
|
||||
pct += (float)zeroVol;
|
||||
|
||||
|
@ -6039,7 +6039,7 @@ void idPlayer::SetCurrentHeartRate( void ) {
|
|||
idPlayer::UpdateAir
|
||||
==============
|
||||
*/
|
||||
void idPlayer::UpdateAir( void ) {
|
||||
void idPlayer::UpdateAir( void ) {
|
||||
if ( health <= 0 ) {
|
||||
return;
|
||||
}
|
||||
|
@ -6089,7 +6089,7 @@ void idPlayer::UpdateAir( void ) {
|
|||
lastAirDamage = gameLocal.time;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
if ( airless ) {
|
||||
StartSound( "snd_recompress", SND_CHANNEL_ANY, SSF_GLOBAL, false, NULL );
|
||||
|
@ -6112,13 +6112,13 @@ void idPlayer::UpdateAir( void ) {
|
|||
}
|
||||
|
||||
void idPlayer::UpdatePowerupHud() {
|
||||
|
||||
|
||||
if ( health <= 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(lastHudPowerup != hudPowerup) {
|
||||
|
||||
|
||||
if(hudPowerup == -1) {
|
||||
//The powerup hud should be turned off
|
||||
if ( hud ) {
|
||||
|
@ -6138,7 +6138,7 @@ void idPlayer::UpdatePowerupHud() {
|
|||
if(PowerUpActive(hudPowerup)) {
|
||||
int remaining = inventory.powerupEndTime[ hudPowerup ] - gameLocal.time;
|
||||
int filledbar = idMath::ClampInt( 0, hudPowerupDuration, remaining );
|
||||
|
||||
|
||||
if ( hud ) {
|
||||
hud->SetStateInt( "player_powerup", 100 * filledbar / hudPowerupDuration );
|
||||
hud->SetStateInt( "player_poweruptime", remaining / 1000 );
|
||||
|
@ -6708,7 +6708,7 @@ void idPlayer::PerformImpulse( int impulse ) {
|
|||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool idPlayer::HandleESC( void ) {
|
||||
|
@ -6796,7 +6796,7 @@ void idPlayer::AdjustSpeed( void ) {
|
|||
speed = pm_walkspeed.GetFloat() * ( 1.0f - bobFrac ) + pm_runspeed.GetFloat() * bobFrac;
|
||||
} else {
|
||||
rate = pm_staminarate.GetFloat();
|
||||
|
||||
|
||||
// increase 25% faster when not moving
|
||||
if ( ( usercmd.forwardmove == 0 ) && ( usercmd.rightmove == 0 ) && ( !physicsObj.OnLadder() || ( usercmd.upmove == 0 ) ) ) {
|
||||
rate *= 1.25f;
|
||||
|
@ -6904,7 +6904,7 @@ void idPlayer::AdjustBodyAngles( void ) {
|
|||
upBlend = -frac;
|
||||
}
|
||||
|
||||
animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 0, downBlend );
|
||||
animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 0, downBlend );
|
||||
animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 1, forwardBlend );
|
||||
animator.CurrentAnim( ANIMCHANNEL_TORSO )->SetSyncedAnimWeight( 2, upBlend );
|
||||
|
||||
|
@ -6930,7 +6930,7 @@ void idPlayer::InitAASLocation( void ) {
|
|||
|
||||
num = gameLocal.NumAAS();
|
||||
aasLocation.SetGranularity( 1 );
|
||||
aasLocation.SetNum( num );
|
||||
aasLocation.SetNum( num );
|
||||
for( i = 0; i < aasLocation.Num(); i++ ) {
|
||||
aasLocation[ i ].areaNum = 0;
|
||||
aasLocation[ i ].pos = origin;
|
||||
|
@ -6962,7 +6962,7 @@ void idPlayer::SetAASLocation( void ) {
|
|||
if ( !GetFloorPos( 64.0f, origin ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for( i = 0; i < aasLocation.Num(); i++ ) {
|
||||
aas = gameLocal.GetAAS( i );
|
||||
if ( !aas ) {
|
||||
|
@ -7114,7 +7114,7 @@ void idPlayer::Move( void ) {
|
|||
|
||||
if ( AI_JUMP ) {
|
||||
// bounce the view weapon
|
||||
loggedAccel_t *acc = &loggedAccel[currentLoggedAccel&(NUM_LOGGED_ACCELS-1)];
|
||||
loggedAccel_t *acc = &loggedAccel[currentLoggedAccel&(NUM_LOGGED_ACCELS-1)];
|
||||
currentLoggedAccel++;
|
||||
acc->time = gameLocal.time;
|
||||
acc->dir[2] = 200;
|
||||
|
@ -7171,7 +7171,7 @@ void idPlayer::UpdateHud( void ) {
|
|||
inventory.pickupItemNames.RemoveIndex( 0 );
|
||||
if (inventory.nextItemNum == 1 ) {
|
||||
inventory.onePickupTime = gameLocal.time;
|
||||
} else if ( inventory.nextItemNum > count ) { //_D3XP
|
||||
} else if ( inventory.nextItemNum > count ) { //_D3XP
|
||||
inventory.nextItemNum = 1;
|
||||
inventory.nextItemPickup = inventory.onePickupTime + 2000;
|
||||
} else {
|
||||
|
@ -7412,7 +7412,7 @@ void idPlayer::Think( void ) {
|
|||
|
||||
// update GUIs, Items, and character interactions
|
||||
UpdateFocus();
|
||||
|
||||
|
||||
UpdateLocation();
|
||||
|
||||
// update player script
|
||||
|
@ -7420,7 +7420,7 @@ void idPlayer::Think( void ) {
|
|||
|
||||
// service animations
|
||||
if ( !spectating && !af.IsActive() && !gameLocal.inCinematic ) {
|
||||
UpdateConditions();
|
||||
UpdateConditions();
|
||||
UpdateAnimState();
|
||||
CheckBlink();
|
||||
}
|
||||
|
@ -7449,7 +7449,7 @@ void idPlayer::Think( void ) {
|
|||
#ifdef _D3XP
|
||||
UpdatePowerupHud();
|
||||
#endif
|
||||
|
||||
|
||||
UpdateHud();
|
||||
|
||||
UpdatePowerUps();
|
||||
|
@ -7517,7 +7517,7 @@ void idPlayer::Think( void ) {
|
|||
if ( !g_stopTime.GetBool() ) {
|
||||
UpdateAnimation();
|
||||
|
||||
Present();
|
||||
Present();
|
||||
|
||||
UpdateDamageEffects();
|
||||
|
||||
|
@ -7727,7 +7727,7 @@ idPlayer::LookAtKiller
|
|||
*/
|
||||
void idPlayer::LookAtKiller( idEntity *inflictor, idEntity *attacker ) {
|
||||
idVec3 dir;
|
||||
|
||||
|
||||
if ( attacker && attacker != this ) {
|
||||
dir = attacker->GetPhysics()->GetOrigin() - GetPhysics()->GetOrigin();
|
||||
} else if ( inflictor && inflictor != this ) {
|
||||
|
@ -7826,7 +7826,7 @@ void idPlayer::Killed( idEntity *inflictor, idEntity *attacker, int damage, cons
|
|||
|
||||
#ifdef CTF
|
||||
// drop the flag if player was carrying it
|
||||
if ( gameLocal.isMultiplayer && gameLocal.mpGame.IsGametypeFlagBased() &&
|
||||
if ( gameLocal.isMultiplayer && gameLocal.mpGame.IsGametypeFlagBased() &&
|
||||
carryingFlag )
|
||||
{
|
||||
DropFlag();
|
||||
|
@ -7871,7 +7871,7 @@ void idPlayer::GetAIAimTargets( const idVec3 &lastSightPos, idVec3 &headPos, idV
|
|||
idVec3 offset;
|
||||
idMat3 axis;
|
||||
idVec3 origin;
|
||||
|
||||
|
||||
origin = lastSightPos - physicsObj.GetOrigin();
|
||||
|
||||
GetJointWorldTransform( chestJoint, gameLocal.time, offset, axis );
|
||||
|
@ -7893,18 +7893,18 @@ void idPlayer::DamageFeedback( idEntity *victim, idEntity *inflictor, int &damag
|
|||
damage *= PowerUpModifier( BERSERK );
|
||||
if ( damage && ( victim != this ) && ( victim->IsType( idActor::Type ) || victim->IsType( idDamagable::Type ) ) ) {
|
||||
|
||||
idPlayer *victimPlayer = NULL;
|
||||
|
||||
/* No damage feedback sound for hitting friendlies in CTF */
|
||||
idPlayer *victimPlayer = NULL;
|
||||
|
||||
/* No damage feedback sound for hitting friendlies in CTF */
|
||||
if ( victim->IsType( idPlayer::Type ) ) {
|
||||
victimPlayer = static_cast<idPlayer*>(victim);
|
||||
victimPlayer = static_cast<idPlayer*>(victim);
|
||||
}
|
||||
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && victimPlayer && this->team == victimPlayer->team ) {
|
||||
/* Do nothing ... */
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && victimPlayer && this->team == victimPlayer->team ) {
|
||||
/* Do nothing ... */
|
||||
}
|
||||
else {
|
||||
SetLastHitTime( gameLocal.time );
|
||||
SetLastHitTime( gameLocal.time );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7930,7 +7930,7 @@ void idPlayer::CalcDamagePoints( idEntity *inflictor, idEntity *attacker, const
|
|||
if ( !gameLocal.isMultiplayer ) {
|
||||
if ( inflictor != gameLocal.world ) {
|
||||
switch ( g_skill.GetInteger() ) {
|
||||
case 0:
|
||||
case 0:
|
||||
damage *= 0.80f;
|
||||
if ( damage < 1 ) {
|
||||
damage = 1;
|
||||
|
@ -8037,7 +8037,7 @@ void idPlayer::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
|
|||
int armorSave;
|
||||
int knockback;
|
||||
idVec3 damage_from;
|
||||
idVec3 localDamageVector;
|
||||
idVec3 localDamageVector;
|
||||
float attackerPushScale;
|
||||
#ifdef _D3XP
|
||||
SetTimeState ts( timeGroup );
|
||||
|
@ -8047,7 +8047,7 @@ void idPlayer::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
|
|||
if ( gameLocal.isClient ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( !fl.takedamage || noclip || spectating || gameLocal.inCinematic ) {
|
||||
return;
|
||||
}
|
||||
|
@ -8082,7 +8082,7 @@ void idPlayer::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
|
|||
}
|
||||
|
||||
CalcDamagePoints( inflictor, attacker, &damageDef->dict, damageScale, location, &damage, &armorSave );
|
||||
|
||||
|
||||
// determine knockback
|
||||
damageDef->dict.GetInt( "knockback", "20", knockback );
|
||||
|
||||
|
@ -8125,7 +8125,7 @@ void idPlayer::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
|
|||
}
|
||||
lastArmorPulse = gameLocal.time;
|
||||
}
|
||||
|
||||
|
||||
if ( damageDef->dict.GetBool( "burn" ) ) {
|
||||
StartSound( "snd_burn", SND_CHANNEL_BODY3, 0, false, NULL );
|
||||
} else if ( damageDef->dict.GetBool( "no_air" ) ) {
|
||||
|
@ -8135,14 +8135,14 @@ void idPlayer::Damage( idEntity *inflictor, idEntity *attacker, const idVec3 &di
|
|||
}
|
||||
|
||||
if ( g_debugDamage.GetInteger() ) {
|
||||
gameLocal.Printf( "client:%i health:%i damage:%i armor:%i\n",
|
||||
gameLocal.Printf( "client:%i health:%i damage:%i armor:%i\n",
|
||||
entityNumber, health, damage, armorSave );
|
||||
}
|
||||
|
||||
// move the world direction vector to local coordinates
|
||||
damage_from = dir;
|
||||
damage_from.Normalize();
|
||||
|
||||
|
||||
viewAxis.ProjectVector( damage_from, localDamageVector );
|
||||
|
||||
// add to the damage inflicted on a player this frame
|
||||
|
@ -8583,7 +8583,7 @@ idPlayer::GetEyePosition
|
|||
*/
|
||||
idVec3 idPlayer::GetEyePosition( void ) const {
|
||||
idVec3 org;
|
||||
|
||||
|
||||
// use the smoothed origin if spectating another player in multiplayer
|
||||
if ( gameLocal.isClient && entityNumber != gameLocal.localClientNum ) {
|
||||
org = smoothedOrigin;
|
||||
|
@ -8635,7 +8635,7 @@ void idPlayer::CalculateFirstPersonView( void ) {
|
|||
|
||||
ang = viewBobAngles + playerView.AngleOffset();
|
||||
ang.yaw += viewAxis[ 0 ].ToYaw();
|
||||
|
||||
|
||||
jointHandle_t joint = animator.GetJointHandle( "camera" );
|
||||
animator.GetJointTransform( joint, gameLocal.time, origin, axis );
|
||||
firstPersonViewOrigin = ( origin + modelOffset ) * ( viewAxis * physicsObj.GetGravityAxis() ) + physicsObj.GetOrigin() + viewBob;
|
||||
|
@ -8725,7 +8725,7 @@ void idPlayer::CalculateRenderView( void ) {
|
|||
// allow the right player view weapons
|
||||
renderView->viewID = entityNumber + 1;
|
||||
}
|
||||
|
||||
|
||||
// field of view
|
||||
gameLocal.CalcFov( CalcFov( true ), renderView->fov_x, renderView->fov_y );
|
||||
}
|
||||
|
@ -8961,17 +8961,17 @@ void idPlayer::Event_StopFxFov( void ) {
|
|||
|
||||
/*
|
||||
==================
|
||||
idPlayer::StartFxFov
|
||||
idPlayer::StartFxFov
|
||||
==================
|
||||
*/
|
||||
void idPlayer::StartFxFov( float duration ) {
|
||||
void idPlayer::StartFxFov( float duration ) {
|
||||
fxFov = true;
|
||||
PostEventSec( &EV_Player_StopFxFov, duration );
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
idPlayer::Event_EnableWeapon
|
||||
idPlayer::Event_EnableWeapon
|
||||
==================
|
||||
*/
|
||||
void idPlayer::Event_EnableWeapon( void ) {
|
||||
|
@ -8998,7 +8998,7 @@ void idPlayer::Event_DisableWeapon( void ) {
|
|||
#ifdef _D3XP
|
||||
/*
|
||||
==================
|
||||
idPlayer::Event_GiveInventoryItem
|
||||
idPlayer::Event_GiveInventoryItem
|
||||
==================
|
||||
*/
|
||||
void idPlayer::Event_GiveInventoryItem( const char* name ) {
|
||||
|
@ -9007,7 +9007,7 @@ void idPlayer::Event_GiveInventoryItem( const char* name ) {
|
|||
|
||||
/*
|
||||
==================
|
||||
idPlayer::Event_RemoveInventoryItem
|
||||
idPlayer::Event_RemoveInventoryItem
|
||||
==================
|
||||
*/
|
||||
void idPlayer::Event_RemoveInventoryItem( const char* name ) {
|
||||
|
@ -9016,7 +9016,7 @@ void idPlayer::Event_RemoveInventoryItem( const char* name ) {
|
|||
|
||||
/*
|
||||
==================
|
||||
idPlayer::Event_GetIdealWeapon
|
||||
idPlayer::Event_GetIdealWeapon
|
||||
==================
|
||||
*/
|
||||
void idPlayer::Event_GetIdealWeapon( void ) {
|
||||
|
@ -9032,7 +9032,7 @@ void idPlayer::Event_GetIdealWeapon( void ) {
|
|||
|
||||
/*
|
||||
==================
|
||||
idPlayer::Event_SetPowerupTime
|
||||
idPlayer::Event_SetPowerupTime
|
||||
==================
|
||||
*/
|
||||
void idPlayer::Event_SetPowerupTime( int powerup, int time ) {
|
||||
|
@ -9045,7 +9045,7 @@ void idPlayer::Event_SetPowerupTime( int powerup, int time ) {
|
|||
|
||||
/*
|
||||
==================
|
||||
idPlayer::Event_IsPowerupActive
|
||||
idPlayer::Event_IsPowerupActive
|
||||
==================
|
||||
*/
|
||||
void idPlayer::Event_IsPowerupActive( int powerup ) {
|
||||
|
@ -9331,14 +9331,14 @@ void idPlayer::ClientPredictionThink( void ) {
|
|||
if ( !isLagged ) {
|
||||
// don't allow client to move when lagged
|
||||
Move();
|
||||
}
|
||||
}
|
||||
|
||||
// update GUIs, Items, and character interactions
|
||||
UpdateFocus();
|
||||
|
||||
// service animations
|
||||
if ( !spectating && !af.IsActive() ) {
|
||||
UpdateConditions();
|
||||
UpdateConditions();
|
||||
UpdateAnimState();
|
||||
CheckBlink();
|
||||
}
|
||||
|
@ -9543,8 +9543,8 @@ void idPlayer::WriteToSnapshot( idBitMsgDelta &msg ) const {
|
|||
msg.WriteBits( isLagged, 1 );
|
||||
msg.WriteBits( isChatting, 1 );
|
||||
#ifdef CTF
|
||||
/* Needed for the scoreboard */
|
||||
msg.WriteBits( carryingFlag, 1 );
|
||||
/* Needed for the scoreboard */
|
||||
msg.WriteBits( carryingFlag, 1 );
|
||||
#endif
|
||||
#ifdef _D3XP
|
||||
msg.WriteBits( enviroSuitLight.GetSpawnId(), 32 );
|
||||
|
@ -9788,7 +9788,7 @@ bool idPlayer::ClientReceiveEvent( int event, int time, const idBitMsg &msg ) {
|
|||
GivePowerUp( powerup, 0 );
|
||||
} else {
|
||||
ClearPowerup( powerup );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#ifdef _D3XP
|
||||
|
@ -9841,7 +9841,7 @@ idPlayer::Show
|
|||
*/
|
||||
void idPlayer::Show( void ) {
|
||||
idWeapon *weap;
|
||||
|
||||
|
||||
idActor::Show();
|
||||
weap = weapon.GetEntity();
|
||||
if ( weap ) {
|
||||
|
@ -9882,7 +9882,7 @@ void idPlayer::ShowTip( const char *title, const char *tip, bool autoHide ) {
|
|||
}
|
||||
hud->SetStateString( "tip", tip );
|
||||
hud->SetStateString( "tiptitle", title );
|
||||
hud->HandleNamedEvent( "tipWindowUp" );
|
||||
hud->HandleNamedEvent( "tipWindowUp" );
|
||||
if ( autoHide ) {
|
||||
PostEventSec( &EV_Player_HideTip, 5.0f );
|
||||
}
|
||||
|
@ -9895,7 +9895,7 @@ idPlayer::HideTip
|
|||
===============
|
||||
*/
|
||||
void idPlayer::HideTip( void ) {
|
||||
hud->HandleNamedEvent( "tipWindowDown" );
|
||||
hud->HandleNamedEvent( "tipWindowDown" );
|
||||
tipUp = false;
|
||||
}
|
||||
|
||||
|
@ -10040,11 +10040,11 @@ void idPlayer::DrawPlayerIcons( void ) {
|
|||
}
|
||||
|
||||
#ifdef CTF
|
||||
// Never draw icons for hidden players.
|
||||
if ( this->IsHidden() )
|
||||
return;
|
||||
#endif
|
||||
|
||||
// Never draw icons for hidden players.
|
||||
if ( this->IsHidden() )
|
||||
return;
|
||||
#endif
|
||||
|
||||
playerIcon.Draw( this, headJoint );
|
||||
}
|
||||
|
||||
|
@ -10085,7 +10085,7 @@ void idPlayer::DropFlag( void ) {
|
|||
idEntity * entity = gameLocal.mpGame.GetTeamFlag( 1 - this->latchedTeam );
|
||||
if ( entity ) {
|
||||
idItemTeam * item = static_cast<idItemTeam*>(entity);
|
||||
|
||||
|
||||
if ( item->carried && !item->dropped ) {
|
||||
item->Drop( health <= 0 );
|
||||
carryingFlag = false;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -33,7 +33,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
===============================================================================
|
||||
|
||||
Player entity.
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -59,7 +59,7 @@ const int MAX_WEAPONS = 16;
|
|||
#endif
|
||||
|
||||
const int DEAD_HEARTRATE = 0; // fall to as you die
|
||||
const int LOWHEALTH_HEARTRATE_ADJ = 20; //
|
||||
const int LOWHEALTH_HEARTRATE_ADJ = 20; //
|
||||
const int DYING_HEARTRATE = 30; // used for volumen calc when dying/dead
|
||||
const int BASE_HEARTRATE = 70; // default
|
||||
const int ZEROSTAMINA_HEARTRATE = 115; // no stamina
|
||||
|
@ -91,7 +91,7 @@ struct idLevelTriggerInfo {
|
|||
|
||||
// powerups - the "type" in item .def must match
|
||||
enum {
|
||||
BERSERK = 0,
|
||||
BERSERK = 0,
|
||||
INVISIBILITY,
|
||||
MEGAHEALTH,
|
||||
ADRENALINE,
|
||||
|
@ -349,10 +349,10 @@ public:
|
|||
int tourneyLine; // client side - our spot in the wait line. 0 means no info.
|
||||
int spawnedTime; // when client first enters the game
|
||||
|
||||
#ifdef CTF
|
||||
#ifdef CTF
|
||||
bool carryingFlag; // is the player carrying the flag?
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
idEntityPtr<idEntity> teleportEntity; // while being teleported, this is set to the entity we'll use for exit
|
||||
int teleportKiller; // entity number of an entity killing us at teleporter exit
|
||||
bool lastManOver; // can't respawn in last man anymore (srv only)
|
||||
|
@ -469,7 +469,7 @@ public:
|
|||
bool GiveItem( idItem *item );
|
||||
void GiveItem( const char *name );
|
||||
void GiveHealthPool( float amt );
|
||||
|
||||
|
||||
bool GiveInventoryItem( idDict *item );
|
||||
void RemoveInventoryItem( idDict *item );
|
||||
bool GiveInventoryItem( const char *name );
|
||||
|
@ -680,7 +680,7 @@ private:
|
|||
int focusTime;
|
||||
idAFEntity_Vehicle * focusVehicle;
|
||||
idUserInterface * cursor;
|
||||
|
||||
|
||||
// full screen guis track mouse movements directly
|
||||
int oldMouseX;
|
||||
int oldMouseY;
|
||||
|
@ -837,4 +837,3 @@ ID_INLINE void idPlayer::SetSelfSmooth( bool b ) {
|
|||
}
|
||||
|
||||
#endif /* !__GAME_PLAYER_H__ */
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -195,4 +195,3 @@ void idPlayerIcon::UpdateIcon( idPlayer *player, const idVec3 &origin, const idM
|
|||
renderEnt.axis = axis;
|
||||
gameRenderWorld->UpdateEntityDef( iconHandle, &renderEnt );
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -41,7 +41,7 @@ typedef enum {
|
|||
|
||||
class idPlayerIcon {
|
||||
public:
|
||||
|
||||
|
||||
public:
|
||||
idPlayerIcon();
|
||||
~idPlayerIcon();
|
||||
|
@ -64,4 +64,3 @@ public:
|
|||
|
||||
|
||||
#endif /* !_PLAYERICON_H_ */
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -168,7 +168,7 @@ void idPlayerView::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadInt( dvFinishTime );
|
||||
savefile->ReadMaterial( dvMaterial );
|
||||
savefile->ReadInt( kickFinishTime );
|
||||
savefile->ReadAngles( kickAngles );
|
||||
savefile->ReadAngles( kickAngles );
|
||||
savefile->ReadBool( bfgVision );
|
||||
|
||||
savefile->ReadMaterial( tunnelMaterial );
|
||||
|
@ -310,7 +310,7 @@ void idPlayerView::DamageImpulse( idVec3 localKickDir, const idDict *damageDef )
|
|||
blob->x += ( gameLocal.random.RandomInt()&63 ) - 32;
|
||||
blob->y = damageDef->GetFloat( "blob_y" );
|
||||
blob->y += ( gameLocal.random.RandomInt()&63 ) - 32;
|
||||
|
||||
|
||||
float scale = ( 256 + ( ( gameLocal.random.RandomInt()&63 ) - 32 ) ) / 256.0f;
|
||||
blob->w = damageDef->GetFloat( "blob_width" ) * g_blobSize.GetFloat() * scale;
|
||||
blob->h = damageDef->GetFloat( "blob_height" ) * g_blobSize.GetFloat() * scale;
|
||||
|
@ -392,7 +392,7 @@ void idPlayerView::WeaponFireFeedback( const idDict *weaponDef ) {
|
|||
kickAngles = angles;
|
||||
int finish = gameLocal.slow.time + g_kickTime.GetFloat() * recoilTime;
|
||||
kickFinishTime = finish;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -429,7 +429,7 @@ idMat3 idPlayerView::ShakeAxis() const {
|
|||
===================
|
||||
idPlayerView::AngleOffset
|
||||
|
||||
kickVector, a world space direction that the attack should
|
||||
kickVector, a world space direction that the attack should
|
||||
===================
|
||||
*/
|
||||
idAngles idPlayerView::AngleOffset() const {
|
||||
|
@ -530,7 +530,7 @@ void idPlayerView::SingleView( idUserInterface *hud, const renderView_t *view )
|
|||
if ( blob->finishTime <= gameLocal.slow.time ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
blob->y += blob->driftAmount;
|
||||
|
||||
float fade = (float)( blob->finishTime - gameLocal.slow.time ) / ( blob->finishTime - blob->startFadeTime );
|
||||
|
@ -577,7 +577,7 @@ void idPlayerView::SingleView( idUserInterface *hud, const renderView_t *view )
|
|||
renderSystem->SetColor4( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
renderSystem->DrawStretchPic( 0.0f, 0.0f, 640.0f, 480.0f, 0.0f, 0.0f, 1.0f, 1.0f, bfgMaterial );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// test a single material drawn over everything
|
||||
|
@ -690,7 +690,7 @@ void idPlayerView::RenderPlayerView( idUserInterface *hud ) {
|
|||
if ( net_clientLagOMeter.GetBool() && lagoMaterial && gameLocal.isClient ) {
|
||||
renderSystem->SetColor4( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
renderSystem->DrawStretchPic( 10.0f, 380.0f, 64.0f, 64.0f, 0.0f, 0.0f, 1.0f, 1.0f, lagoMaterial );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _D3XP
|
||||
|
@ -1263,7 +1263,7 @@ void FullscreenFX_Warp::HighQuality() {
|
|||
p.center.y = center.y;
|
||||
p.center.z = p.center.x / 640.f;
|
||||
p.center.w = 1 - ( p.center.y / 480.f );
|
||||
|
||||
|
||||
// draw it
|
||||
DrawWarp( p, interp );
|
||||
}
|
||||
|
@ -1690,7 +1690,7 @@ void FullscreenFXManager::Initialize( idPlayerView *pv ) {
|
|||
renderSystem->CaptureRenderToImage( "_accum" );
|
||||
renderSystem->UnCrop();
|
||||
|
||||
renderSystem->CropRenderSize( 512, 256, true );
|
||||
renderSystem->CropRenderSize( 512, 256, true );
|
||||
renderSystem->CaptureRenderToImage( "_scratch" );
|
||||
renderSystem->UnCrop();
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -393,9 +393,9 @@ public:
|
|||
const idMaterial * dvMaterial; // material to take the double vision screen shot
|
||||
|
||||
int kickFinishTime; // view kick will be stopped at this time
|
||||
idAngles kickAngles;
|
||||
idAngles kickAngles;
|
||||
|
||||
bool bfgVision; //
|
||||
bool bfgVision; //
|
||||
|
||||
const idMaterial * tunnelMaterial; // health tunnel vision
|
||||
const idMaterial * armorMaterial; // armor damage view effect
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -25,7 +25,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
|
||||
#include "../idlib/precompiled.h"
|
||||
#pragma hdrstop
|
||||
|
||||
|
@ -335,7 +335,7 @@ void idProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVec3
|
|||
endthrust = spawnArgs.GetFloat( "thrust_end" );
|
||||
|
||||
spawnArgs.GetVector( "velocity", "0 0 0", velocity );
|
||||
|
||||
|
||||
speed = velocity.Length() * launchPower;
|
||||
|
||||
damagePower = dmgPower;
|
||||
|
@ -510,11 +510,11 @@ void idProjectile::Think( void ) {
|
|||
if ( gameLocal.time < lightEndTime ) {
|
||||
float frac = ( float )( gameLocal.time - lightStartTime ) / ( float )( lightEndTime - lightStartTime );
|
||||
color.Lerp( lightColor, color, frac );
|
||||
}
|
||||
}
|
||||
renderLight.shaderParms[SHADERPARM_RED] = color.x;
|
||||
renderLight.shaderParms[SHADERPARM_GREEN] = color.y;
|
||||
renderLight.shaderParms[SHADERPARM_BLUE] = color.z;
|
||||
}
|
||||
}
|
||||
gameRenderWorld->UpdateLightDef( lightDefHandle, &renderLight );
|
||||
} else {
|
||||
lightDefHandle = gameRenderWorld->AddLightDef( &renderLight );
|
||||
|
@ -897,9 +897,9 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
|
|||
|
||||
if ( fxname && *fxname ) {
|
||||
SetModel( fxname );
|
||||
renderEntity.shaderParms[SHADERPARM_RED] =
|
||||
renderEntity.shaderParms[SHADERPARM_GREEN] =
|
||||
renderEntity.shaderParms[SHADERPARM_BLUE] =
|
||||
renderEntity.shaderParms[SHADERPARM_RED] =
|
||||
renderEntity.shaderParms[SHADERPARM_GREEN] =
|
||||
renderEntity.shaderParms[SHADERPARM_BLUE] =
|
||||
renderEntity.shaderParms[SHADERPARM_ALPHA] = 1.0f;
|
||||
renderEntity.shaderParms[SHADERPARM_TIMEOFFSET] = -MS2SEC( gameLocal.time );
|
||||
renderEntity.shaderParms[SHADERPARM_DIVERSITY] = gameLocal.random.CRandomFloat();
|
||||
|
@ -910,13 +910,13 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
|
|||
// explosion light
|
||||
light_shader = spawnArgs.GetString( "mtr_explode_light_shader" );
|
||||
|
||||
#ifdef CTF
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") )
|
||||
{
|
||||
light_shader = "lights/midnight_grenade";
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CTF
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") )
|
||||
{
|
||||
light_shader = "lights/midnight_grenade";
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( *light_shader ) {
|
||||
renderLight.shader = declManager->FindMaterial( light_shader, false );
|
||||
renderLight.pointLight = true;
|
||||
|
@ -925,16 +925,16 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
|
|||
renderLight.lightRadius[2] = spawnArgs.GetFloat( "explode_light_radius" );
|
||||
|
||||
#ifdef CTF
|
||||
// Midnight ctf
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") )
|
||||
{
|
||||
renderLight.lightRadius[0] =
|
||||
renderLight.lightRadius[1] =
|
||||
renderLight.lightRadius[2] = spawnArgs.GetFloat( "explode_light_radius" ) * 2;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Midnight ctf
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") )
|
||||
{
|
||||
renderLight.lightRadius[0] =
|
||||
renderLight.lightRadius[1] =
|
||||
renderLight.lightRadius[2] = spawnArgs.GetFloat( "explode_light_radius" ) * 2;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
spawnArgs.GetVector( "explode_light_color", "1 1 1", lightColor );
|
||||
renderLight.shaderParms[SHADERPARM_RED] = lightColor.x;
|
||||
renderLight.shaderParms[SHADERPARM_GREEN] = lightColor.y;
|
||||
|
@ -943,13 +943,13 @@ void idProjectile::Explode( const trace_t &collision, idEntity *ignore ) {
|
|||
renderLight.shaderParms[SHADERPARM_TIMEOFFSET] = -MS2SEC( gameLocal.time );
|
||||
|
||||
#ifdef CTF
|
||||
// Midnight ctf
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") )
|
||||
{
|
||||
light_fadetime = 3.0f;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
// Midnight ctf
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && gameLocal.serverInfo.GetBool("si_midnight") )
|
||||
{
|
||||
light_fadetime = 3.0f;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
light_fadetime = spawnArgs.GetFloat( "explode_light_fadetime", "0.5" );
|
||||
lightStartTime = gameLocal.time;
|
||||
lightEndTime = gameLocal.time + SEC2MS( light_fadetime );
|
||||
|
@ -1099,7 +1099,7 @@ void idProjectile::Event_Touch( idEntity *other, trace_t *trace ) {
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef CTF
|
||||
#ifdef CTF
|
||||
// Projectiles do not collide with flags
|
||||
if ( other->IsType( idItemTeam::Type ) )
|
||||
return;
|
||||
|
@ -1141,7 +1141,7 @@ void idProjectile::CatchProjectile( idEntity* o, const char* reflectName ) {
|
|||
|
||||
const idDict *damageDef = gameLocal.FindEntityDefDict( s, false );
|
||||
if ( damageDef ) {
|
||||
spawnArgs.Set( "def_damage", s );
|
||||
spawnArgs.Set( "def_damage", s );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1267,7 +1267,7 @@ void idProjectile::WriteToSnapshot( idBitMsgDelta &msg ) const {
|
|||
|
||||
msg.WriteDeltaFloat( 0.0f, velocity[0], RB_VELOCITY_EXPONENT_BITS, RB_VELOCITY_MANTISSA_BITS );
|
||||
msg.WriteDeltaFloat( 0.0f, velocity[1], RB_VELOCITY_EXPONENT_BITS, RB_VELOCITY_MANTISSA_BITS );
|
||||
msg.WriteDeltaFloat( 0.0f, velocity[2], RB_VELOCITY_EXPONENT_BITS, RB_VELOCITY_MANTISSA_BITS );
|
||||
msg.WriteDeltaFloat( 0.0f, velocity[2], RB_VELOCITY_EXPONENT_BITS, RB_VELOCITY_MANTISSA_BITS );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1519,7 +1519,7 @@ void idGuidedProjectile::Think( void ) {
|
|||
int i;
|
||||
|
||||
if ( state == LAUNCHED && !unGuided ) {
|
||||
|
||||
|
||||
GetSeekPos( seekPos );
|
||||
|
||||
if ( rndUpdateTime < gameLocal.time ) {
|
||||
|
@ -1595,7 +1595,7 @@ void idGuidedProjectile::Launch( const idVec3 &start, const idVec3 &dir, const i
|
|||
gameLocal.clip.TracePoint( tr, start, end, MASK_SHOT_RENDERMODEL | CONTENTS_BODY, owner.GetEntity() );
|
||||
if ( tr.fraction < 1.0f ) {
|
||||
enemy = gameLocal.GetTraceEntity( tr );
|
||||
}
|
||||
}
|
||||
// ignore actors on the player's team
|
||||
if ( enemy.GetEntity() == NULL || !enemy.GetEntity()->IsType( idActor::Type ) || ( static_cast<idActor *>( enemy.GetEntity() )->team == player->team ) ) {
|
||||
enemy = player->EnemyWithMostHealth();
|
||||
|
@ -1746,13 +1746,13 @@ void idSoulCubeMissile::Think( void ) {
|
|||
if ( !gameLocal.smokeParticles->EmitSmoke( smokeKill, smokeKillTime, gameLocal.random.CRandomFloat(), orbitOrg, mat3_identity, timeGroup /*_D3XP*/ ) ) {
|
||||
smokeKillTime = gameLocal.time;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( accelTime && gameLocal.time < launchTime + accelTime * 1000 ) {
|
||||
pct = ( gameLocal.time - launchTime ) / ( accelTime * 1000 );
|
||||
speed = ( startingVelocity + ( startingVelocity + endingVelocity ) * pct ).Length();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
idGuidedProjectile::Think();
|
||||
GetSeekPos( seekPos );
|
||||
if ( ( seekPos - physicsObj.GetOrigin() ).Length() < 32.0f ) {
|
||||
|
@ -1789,7 +1789,7 @@ void idSoulCubeMissile::GetSeekPos( idVec3 &out ) {
|
|||
if ( destOrg != vec3_zero ) {
|
||||
out = destOrg;
|
||||
return;
|
||||
}
|
||||
}
|
||||
idGuidedProjectile::GetSeekPos( out );
|
||||
}
|
||||
|
||||
|
@ -1835,7 +1835,7 @@ void idSoulCubeMissile::Launch( const idVec3 &start, const idVec3 &dir, const id
|
|||
launchTime = gameLocal.time;
|
||||
killPhase = false;
|
||||
UpdateVisuals();
|
||||
|
||||
|
||||
ownerEnt = owner.GetEntity();
|
||||
if ( ownerEnt && ownerEnt->IsType( idPlayer::Type ) ) {
|
||||
static_cast<idPlayer *>( ownerEnt )->SetSoulCubeProjectile( this );
|
||||
|
@ -2017,9 +2017,9 @@ void idBFGProjectile::Think( void ) {
|
|||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_BEAM_END_X ] = org.x;
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_BEAM_END_Y ] = org.y;
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_BEAM_END_Z ] = org.z;
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_RED ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_GREEN ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_BLUE ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_RED ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_GREEN ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_BLUE ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_ALPHA ] = 1.0f;
|
||||
if ( gameLocal.time > nextDamageTime ) {
|
||||
bool bfgVision = true;
|
||||
|
@ -2032,9 +2032,9 @@ void idBFGProjectile::Think( void ) {
|
|||
org.Normalize();
|
||||
beamTargets[i].target.GetEntity()->Damage( this, owner.GetEntity(), org, damageFreq, ( damagePower ) ? damagePower : 1.0f, INVALID_JOINT );
|
||||
} else {
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_RED ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_GREEN ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_BLUE ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_RED ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_GREEN ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_BLUE ] =
|
||||
beamTargets[i].renderEntity.shaderParms[ SHADERPARM_ALPHA ] = 0.0f;
|
||||
bfgVision = false;
|
||||
}
|
||||
|
@ -2078,7 +2078,7 @@ void idBFGProjectile::Launch( const idVec3 &start, const idVec3 &dir, const idVe
|
|||
idProjectile::Launch( start, dir, pushVelocity, 0.0f, power, dmgPower );
|
||||
|
||||
// dmgPower * radius is the target acquisition area
|
||||
// acquisition should make sure that monsters are not dormant
|
||||
// acquisition should make sure that monsters are not dormant
|
||||
// which will cut down on hitting monsters not actively fighting
|
||||
// but saves on the traces making sure they are visible
|
||||
// damage is not applied until the projectile explodes
|
||||
|
@ -2416,7 +2416,7 @@ void idDebris::Launch( void ) {
|
|||
|
||||
spawnArgs.GetVector( "velocity", "0 0 0", velocity );
|
||||
spawnArgs.GetAngles( "angular_velocity", "0 0 0", angular_velocity );
|
||||
|
||||
|
||||
linear_friction = spawnArgs.GetFloat( "linear_friction" );
|
||||
angular_friction = spawnArgs.GetFloat( "angular_friction" );
|
||||
contact_friction = spawnArgs.GetFloat( "contact_friction" );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -33,7 +33,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
===============================================================================
|
||||
|
||||
idProjectile
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -125,7 +125,7 @@ protected:
|
|||
FIZZLED = 3,
|
||||
EXPLODED = 4
|
||||
} projectileState_t;
|
||||
|
||||
|
||||
projectileState_t state;
|
||||
|
||||
private:
|
||||
|
@ -243,7 +243,7 @@ private:
|
|||
===============================================================================
|
||||
|
||||
idDebris
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -258,7 +258,7 @@ void idPVS::FrontPortalPVS( void ) const {
|
|||
}
|
||||
|
||||
for ( p = 0; p < area->numPortals; p++ ) {
|
||||
|
||||
|
||||
p2 = area->portals[p];
|
||||
|
||||
// if we the whole area is not at the front we need to check
|
||||
|
@ -456,7 +456,7 @@ void idPVS::AddPassageBoundaries( const idWinding &source, const idWinding &pass
|
|||
idPlane plane;
|
||||
|
||||
|
||||
// check all combinations
|
||||
// check all combinations
|
||||
for ( i = 0; i < source.GetNumPoints(); i++ ) {
|
||||
|
||||
l = (i + 1) % source.GetNumPoints();
|
||||
|
@ -623,7 +623,7 @@ void idPVS::CreatePassages( void ) const {
|
|||
}
|
||||
|
||||
p = &pvsPortals[(byteNum << 3) + bitNum];
|
||||
|
||||
|
||||
if ( p->areaNum == source->areaNum ) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -42,7 +42,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
/***********************************************************************
|
||||
|
||||
idSecurityCamera
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
const idEventDef EV_SecurityCam_ReverseSweep( "<reverseSweep>" );
|
||||
|
@ -71,7 +71,7 @@ void idSecurityCamera::Save( idSaveGame *savefile ) const {
|
|||
savefile->WriteBool( flipAxis );
|
||||
savefile->WriteFloat( scanDist );
|
||||
savefile->WriteFloat( scanFov );
|
||||
|
||||
|
||||
savefile->WriteFloat( sweepStart );
|
||||
savefile->WriteFloat( sweepEnd );
|
||||
savefile->WriteBool( negativeSweep );
|
||||
|
@ -81,7 +81,7 @@ void idSecurityCamera::Save( idSaveGame *savefile ) const {
|
|||
savefile->WriteFloat( scanFovCos );
|
||||
|
||||
savefile->WriteVec3( viewOffset );
|
||||
|
||||
|
||||
savefile->WriteInt( pvsArea );
|
||||
savefile->WriteStaticObject( physicsObj );
|
||||
savefile->WriteTraceModel( trm );
|
||||
|
@ -99,7 +99,7 @@ void idSecurityCamera::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadBool( flipAxis );
|
||||
savefile->ReadFloat( scanDist );
|
||||
savefile->ReadFloat( scanFov );
|
||||
|
||||
|
||||
savefile->ReadFloat( sweepStart );
|
||||
savefile->ReadFloat( sweepEnd );
|
||||
savefile->ReadBool( negativeSweep );
|
||||
|
@ -109,7 +109,7 @@ void idSecurityCamera::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadFloat( scanFovCos );
|
||||
|
||||
savefile->ReadVec3( viewOffset );
|
||||
|
||||
|
||||
savefile->ReadInt( pvsArea );
|
||||
savefile->ReadStaticObject( physicsObj );
|
||||
savefile->ReadTraceModel( trm );
|
||||
|
@ -190,24 +190,24 @@ void idSecurityCamera::Event_AddLight( void ) {
|
|||
float radius;
|
||||
idVec3 lightOffset;
|
||||
idLight *spotLight;
|
||||
|
||||
|
||||
dir = GetAxis();
|
||||
dir.NormalVectors( right, up );
|
||||
target = GetPhysics()->GetOrigin() + dir * scanDist;
|
||||
|
||||
|
||||
radius = tan( scanFov * idMath::PI / 360.0f );
|
||||
up = dir + up * radius;
|
||||
up.Normalize();
|
||||
up = GetPhysics()->GetOrigin() + up * scanDist;
|
||||
up -= target;
|
||||
|
||||
|
||||
right = dir + right * radius;
|
||||
right.Normalize();
|
||||
right = GetPhysics()->GetOrigin() + right * scanDist;
|
||||
right -= target;
|
||||
|
||||
spawnArgs.GetVector( "lightOffset", "0 0 0", lightOffset );
|
||||
|
||||
|
||||
args.Set( "origin", ( GetPhysics()->GetOrigin() + lightOffset ).ToString() );
|
||||
args.Set( "light_target", target.ToString() );
|
||||
args.Set( "light_right", right.ToString() );
|
||||
|
@ -393,7 +393,7 @@ void idSecurityCamera::Think( void ) {
|
|||
|
||||
SetAlertMode(LOSINGINTEREST);
|
||||
CancelEvents( &EV_SecurityCam_Alert );
|
||||
|
||||
|
||||
sightResume = spawnArgs.GetFloat( "sightResume", "1.5" );
|
||||
PostEventSec( &EV_SecurityCam_ContinueSweep, sightResume );
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ void idSecurityCamera::StartSweep( void ) {
|
|||
sweepStart = gameLocal.time;
|
||||
speed = SEC2MS( SweepSpeed() );
|
||||
sweepEnd = sweepStart + speed;
|
||||
PostEventMS( &EV_SecurityCam_Pause, speed );
|
||||
PostEventMS( &EV_SecurityCam_Pause, speed );
|
||||
StartSound( "snd_moving", SND_CHANNEL_BODY, 0, false, NULL );
|
||||
}
|
||||
|
||||
|
@ -463,7 +463,7 @@ void idSecurityCamera::Event_ContinueSweep( void ) {
|
|||
sweepStart = f;
|
||||
speed = MS2SEC( SweepSpeed() );
|
||||
sweepEnd = sweepStart + speed;
|
||||
PostEventMS( &EV_SecurityCam_Pause, speed * (1.0 - pct));
|
||||
PostEventMS( &EV_SecurityCam_Pause, speed * (1.0 - pct));
|
||||
StartSound( "snd_moving", SND_CHANNEL_BODY, 0, false, NULL );
|
||||
SetAlertMode(SCANNING);
|
||||
sweeping = true;
|
||||
|
@ -510,7 +510,7 @@ void idSecurityCamera::Event_Pause( void ) {
|
|||
sweeping = false;
|
||||
StopSound( SND_CHANNEL_ANY, false );
|
||||
StartSound( "snd_stop", SND_CHANNEL_BODY, 0, false, NULL );
|
||||
PostEventSec( &EV_SecurityCam_ReverseSweep, sweepWait );
|
||||
PostEventSec( &EV_SecurityCam_ReverseSweep, sweepWait );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -65,7 +65,7 @@ private:
|
|||
bool flipAxis;
|
||||
float scanDist;
|
||||
float scanFov;
|
||||
|
||||
|
||||
float sweepStart;
|
||||
float sweepEnd;
|
||||
bool negativeSweep;
|
||||
|
@ -75,7 +75,7 @@ private:
|
|||
float scanFovCos;
|
||||
|
||||
idVec3 viewOffset;
|
||||
|
||||
|
||||
int pvsArea;
|
||||
idPhysics_RigidBody physicsObj;
|
||||
idTraceModel trm;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -216,7 +216,7 @@ bool idSmokeParticles::EmitSmoke( const idDeclParticle *smoke, const int systemS
|
|||
}
|
||||
|
||||
// see how many particles we should emit this tic
|
||||
// FIXME: smoke.privateStartTime += stage->timeOffset;
|
||||
// FIXME: smoke.privateStartTime += stage->timeOffset;
|
||||
int finalParticleTime = stage->cycleMsec * stage->spawnBunching;
|
||||
int deltaMsec = gameLocal.time - systemStartTime;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -302,4 +302,3 @@ idSound::ShowEditingDialog
|
|||
void idSound::ShowEditingDialog( void ) {
|
||||
common->InitTool( EDITOR_SOUND, &spawnArgs );
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -602,7 +602,7 @@ idTarget_Give::Event_Activate
|
|||
================
|
||||
*/
|
||||
void idTarget_Give::Event_Activate( idEntity *activator ) {
|
||||
|
||||
|
||||
if ( spawnArgs.GetBool( "development" ) && developer.GetInteger() == 0 ) {
|
||||
return;
|
||||
}
|
||||
|
@ -913,7 +913,7 @@ idTarget_SetInfluence::Event_ClearFlash
|
|||
*/
|
||||
void idTarget_SetInfluence::Event_ClearFlash( float flash ) {
|
||||
idPlayer *player = gameLocal.GetLocalPlayer();
|
||||
player->playerView.Fade( vec4_zero , flash );
|
||||
player->playerView.Fade( vec4_zero , flash );
|
||||
}
|
||||
/*
|
||||
================
|
||||
|
@ -1073,7 +1073,7 @@ void idTarget_SetInfluence::Event_Activate( idEntity *activator ) {
|
|||
if ( parm && *parm ) {
|
||||
light->SetShader( parm );
|
||||
}
|
||||
|
||||
|
||||
color = light->spawnArgs.GetVector( "_color" );
|
||||
color = light->spawnArgs.GetVector( "color_demonic", color.ToString() );
|
||||
colorTo.Set( color.x, color.y, color.z, 1.0f );
|
||||
|
@ -1133,7 +1133,7 @@ void idTarget_SetInfluence::Event_Activate( idEntity *activator ) {
|
|||
if ( spawnArgs.GetBool( "effect_vision" ) ) {
|
||||
parm = spawnArgs.GetString( "mtrVision" );
|
||||
skin = spawnArgs.GetString( "skinVision" );
|
||||
player->SetInfluenceView( parm, skin, spawnArgs.GetInt( "visionRadius" ), this );
|
||||
player->SetInfluenceView( parm, skin, spawnArgs.GetInt( "visionRadius" ), this );
|
||||
}
|
||||
|
||||
parm = spawnArgs.GetString( "mtrWorld" );
|
||||
|
@ -1798,4 +1798,3 @@ void idTarget_FadeSoundClass::Event_RestoreVolume() {
|
|||
// restore volume
|
||||
gameSoundWorld->FadeSoundClasses( 0, fadeDB, fadeTime );
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -36,7 +36,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
===============================================================================
|
||||
|
||||
idTrigger
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -239,7 +239,7 @@ void idTrigger::Spawn( void ) {
|
|||
===============================================================================
|
||||
|
||||
idTrigger_Multi
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -325,7 +325,7 @@ void idTrigger_Multi::Spawn( void ) {
|
|||
spawnArgs.GetFloat( "random", "0", random );
|
||||
spawnArgs.GetFloat( "delay", "0", delay );
|
||||
spawnArgs.GetFloat( "random_delay", "0", random_delay );
|
||||
|
||||
|
||||
if ( random && ( random >= wait ) && ( wait >= 0 ) ) {
|
||||
random = wait - 1;
|
||||
gameLocal.Warning( "idTrigger_Multi '%s' at (%s) has random >= wait", name.c_str(), GetPhysics()->GetOrigin().ToString(0) );
|
||||
|
@ -515,7 +515,7 @@ void idTrigger_Multi::Event_Touch( idEntity *other, trace_t *trace ) {
|
|||
===============================================================================
|
||||
|
||||
idTrigger_EntityName
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -579,7 +579,7 @@ void idTrigger_EntityName::Spawn( void ) {
|
|||
spawnArgs.GetFloat( "random", "0", random );
|
||||
spawnArgs.GetFloat( "delay", "0", delay );
|
||||
spawnArgs.GetFloat( "random_delay", "0", random_delay );
|
||||
|
||||
|
||||
if ( random && ( random >= wait ) && ( wait >= 0 ) ) {
|
||||
random = wait - 1;
|
||||
gameLocal.Warning( "idTrigger_EntityName '%s' at (%s) has random >= wait", name.c_str(), GetPhysics()->GetOrigin().ToString(0) );
|
||||
|
@ -702,7 +702,7 @@ void idTrigger_EntityName::Event_Touch( idEntity *other, trace_t *trace ) {
|
|||
===============================================================================
|
||||
|
||||
idTrigger_Timer
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -846,7 +846,7 @@ void idTrigger_Timer::Event_Use( idEntity *activator ) {
|
|||
===============================================================================
|
||||
|
||||
idTrigger_Count
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -936,7 +936,7 @@ void idTrigger_Count::Event_TriggerAction( idEntity *activator ) {
|
|||
===============================================================================
|
||||
|
||||
idTrigger_Hurt
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -1076,7 +1076,7 @@ void idTrigger_Fade::Event_Trigger( idEntity *activator ) {
|
|||
===============================================================================
|
||||
|
||||
idTrigger_Touch
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -1158,7 +1158,7 @@ void idTrigger_Touch::TouchEntities( void ) {
|
|||
if ( !entity ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if ( !gameLocal.clip.ContentsModel( cm->GetOrigin(), cm, cm->GetAxis(), -1,
|
||||
clipModel->Handle(), clipModel->GetOrigin(), clipModel->GetAxis() ) ) {
|
||||
continue;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -86,11 +86,11 @@ public:
|
|||
void Save( idSaveGame *savefile ) const;
|
||||
void Restore( idRestoreGame *savefile );
|
||||
|
||||
#ifdef CTF
|
||||
#ifdef CTF
|
||||
protected:
|
||||
#else
|
||||
private:
|
||||
#endif
|
||||
#endif
|
||||
|
||||
float wait;
|
||||
float random;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -33,8 +33,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
/***********************************************************************
|
||||
|
||||
idWeapon
|
||||
|
||||
idWeapon
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
//
|
||||
|
@ -645,7 +645,7 @@ void idWeapon::Restore( idRestoreGame *savefile ) {
|
|||
for(int i = 0; i < lightCount; i++) {
|
||||
WeaponLight_t newLight;
|
||||
memset(&newLight, 0, sizeof(newLight));
|
||||
|
||||
|
||||
idStr name;
|
||||
savefile->ReadString( name );
|
||||
strcpy( newLight.name, name.c_str() );
|
||||
|
@ -730,7 +730,7 @@ void idWeapon::Clear( void ) {
|
|||
refSound.referenceSound->Free( true );
|
||||
}
|
||||
memset( &refSound, 0, sizeof( refSound_t ) );
|
||||
|
||||
|
||||
// setting diversity to 0 results in no random sound. -1 indicates random.
|
||||
refSound.diversity = -1.0f;
|
||||
|
||||
|
@ -1158,7 +1158,7 @@ void idWeapon::GetWeaponDef( const char *objectname, int ammoinclip ) {
|
|||
if ( !weaponDef->dict.GetString( "weapon_scriptobject", NULL, &objectType ) ) {
|
||||
gameLocal.Error( "No 'weapon_scriptobject' set on '%s'.", objectname );
|
||||
}
|
||||
|
||||
|
||||
// setup script object
|
||||
if ( !scriptObject.SetType( objectType ) ) {
|
||||
gameLocal.Error( "Script object '%s' not found on weapon '%s'.", objectType, objectname );
|
||||
|
@ -1295,7 +1295,7 @@ void idWeapon::UpdateGUI( void ) {
|
|||
if ( !renderEntity.gui[ 0 ] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( status == WP_HOLSTERED ) {
|
||||
return;
|
||||
}
|
||||
|
@ -1385,7 +1385,7 @@ idWeapon::MuzzleFlashLight
|
|||
================
|
||||
*/
|
||||
void idWeapon::MuzzleFlashLight( void ) {
|
||||
|
||||
|
||||
if ( !lightOn && ( !g_muzzleFlash.GetBool() || !muzzleFlash.lightRadius[0] ) ) {
|
||||
return;
|
||||
}
|
||||
|
@ -1432,7 +1432,7 @@ bool idWeapon::UpdateSkin( void ) {
|
|||
common->Warning( "Can't find function 'UpdateSkin' in object '%s'", scriptObject.GetTypeName() );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// use the frameCommandThread since it's safe to use outside of framecommands
|
||||
gameLocal.frameCommandThread->CallFunction( this, func, true );
|
||||
gameLocal.frameCommandThread->Execute();
|
||||
|
@ -1676,7 +1676,7 @@ void idWeapon::OwnerDied( void ) {
|
|||
idWeapon::BeginAttack
|
||||
================
|
||||
*/
|
||||
void idWeapon::BeginAttack( void ) {
|
||||
void idWeapon::BeginAttack( void ) {
|
||||
if ( status != WP_OUTOFAMMO ) {
|
||||
lastAttack = gameLocal.time;
|
||||
}
|
||||
|
@ -1991,7 +1991,7 @@ void idWeapon::MuzzleRise( idVec3 &origin, idMat3 &axis ) {
|
|||
if ( time > muzzle_kick_maxtime ) {
|
||||
time = muzzle_kick_maxtime;
|
||||
}
|
||||
|
||||
|
||||
amount = ( float )time / ( float )muzzle_kick_maxtime;
|
||||
ang = muzzle_kick_angles * amount;
|
||||
offset = muzzle_kick_offset * amount;
|
||||
|
@ -2042,7 +2042,7 @@ void idWeapon::DeconstructScriptObject( void ) {
|
|||
if ( !thread ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// don't bother calling the script object's destructor on map shutdown
|
||||
if ( gameLocal.GameState() == GAMESTATE_SHUTDOWN ) {
|
||||
return;
|
||||
|
@ -2156,7 +2156,7 @@ void idWeapon::PresentWeapon( bool showViewModel ) {
|
|||
|
||||
// hide offset is for dropping the gun when approaching a GUI or NPC
|
||||
// This is simpler to manage than doing the weapon put-away animation
|
||||
if ( gameLocal.time - hideStartTime < hideTime ) {
|
||||
if ( gameLocal.time - hideStartTime < hideTime ) {
|
||||
float frac = ( float )( gameLocal.time - hideStartTime ) / ( float )hideTime;
|
||||
if ( hideStart < hideEnd ) {
|
||||
frac = 1.0f - frac;
|
||||
|
@ -2689,7 +2689,7 @@ void idWeapon::WriteToSnapshot( idBitMsgDelta &msg ) const {
|
|||
idWeapon::ReadFromSnapshot
|
||||
================
|
||||
*/
|
||||
void idWeapon::ReadFromSnapshot( const idBitMsgDelta &msg ) {
|
||||
void idWeapon::ReadFromSnapshot( const idBitMsgDelta &msg ) {
|
||||
ammoClip = msg.ReadBits( ASYNC_PLAYER_INV_CLIP_BITS );
|
||||
worldModel.SetSpawnId( msg.ReadBits( 32 ) );
|
||||
bool snapLight = msg.ReadBits( 1 ) != 0;
|
||||
|
@ -2703,10 +2703,10 @@ void idWeapon::ReadFromSnapshot( const idBitMsgDelta &msg ) {
|
|||
idealState = "Fire";
|
||||
}
|
||||
|
||||
// immediately switch back to idle
|
||||
if ( WEAPON_NETFIRING && !isFiring ) {
|
||||
idealState = "Idle";
|
||||
}
|
||||
// immediately switch back to idle
|
||||
if ( WEAPON_NETFIRING && !isFiring ) {
|
||||
idealState = "Idle";
|
||||
}
|
||||
|
||||
WEAPON_NETFIRING = isFiring;
|
||||
}
|
||||
|
@ -2944,7 +2944,7 @@ idWeapon::Event_AmmoInClip
|
|||
*/
|
||||
void idWeapon::Event_AmmoInClip( void ) {
|
||||
int ammo = AmmoInClip();
|
||||
idThread::ReturnFloat( ammo );
|
||||
idThread::ReturnFloat( ammo );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2979,7 +2979,7 @@ idWeapon::Event_ClipSize
|
|||
===============
|
||||
*/
|
||||
void idWeapon::Event_ClipSize( void ) {
|
||||
idThread::ReturnFloat( clipSize );
|
||||
idThread::ReturnFloat( clipSize );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -3027,7 +3027,7 @@ idWeapon::Event_PlayAnim
|
|||
*/
|
||||
void idWeapon::Event_PlayAnim( int channel, const char *animname ) {
|
||||
int anim;
|
||||
|
||||
|
||||
anim = animator.GetAnim( animname );
|
||||
if ( !anim ) {
|
||||
gameLocal.Warning( "missing '%s' animation on '%s' (%s)", animname, name.c_str(), GetEntityDefName() );
|
||||
|
@ -3311,13 +3311,13 @@ void idWeapon::Event_LaunchProjectiles( int num_projectiles, float spread, float
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
// if this is a power ammo weapon ( currently only the bfg ) then make sure
|
||||
// if this is a power ammo weapon ( currently only the bfg ) then make sure
|
||||
// we only fire as much power as available in each clip
|
||||
if ( powerAmmo ) {
|
||||
// power comes in as a float from zero to max
|
||||
// if we use this on more than the bfg will need to define the max
|
||||
// in the .def as opposed to just in the script so proper calcs
|
||||
// can be done here.
|
||||
// can be done here.
|
||||
dmgPower = ( int )dmgPower + 1;
|
||||
if ( dmgPower > ammoClip ) {
|
||||
dmgPower = ammoClip;
|
||||
|
@ -3611,14 +3611,14 @@ void idWeapon::Event_LaunchProjectilesEllipse( int num_projectiles, float spread
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gives the player a powerup as if it were a weapon shot. It will use the ammo amount specified
|
||||
* as ammoRequired.
|
||||
*/
|
||||
void idWeapon::Event_LaunchPowerup( const char* powerup, float duration, int useAmmo ) {
|
||||
|
||||
if ( IsHidden() ) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
// check if we're out of ammo
|
||||
|
@ -3766,12 +3766,12 @@ void idWeapon::Event_Melee( void ) {
|
|||
&& !owner->PowerUpActive( BERSERK )
|
||||
&& ( (gameLocal.gameType != GAME_TDM ) || gameLocal.serverInfo.GetBool( "si_teamDamage" ) || ( owner->team != static_cast< idPlayer * >( ent )->team ) )
|
||||
) {
|
||||
|
||||
|
||||
#ifdef CTF /* Code is formed oddly for easy merge */
|
||||
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() )
|
||||
{ /* Do nothing ... */ }
|
||||
else
|
||||
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() )
|
||||
{ /* Do nothing ... */ }
|
||||
else
|
||||
#endif
|
||||
owner->StealWeapon( static_cast< idPlayer * >( ent ) );
|
||||
}
|
||||
|
@ -3934,5 +3934,5 @@ idWeapon::ClientPredictionThink
|
|||
===============
|
||||
*/
|
||||
void idWeapon::ClientPredictionThink( void ) {
|
||||
UpdateAnimation();
|
||||
UpdateAnimation();
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -33,7 +33,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
===============================================================================
|
||||
|
||||
Player Weapon
|
||||
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
|
@ -231,7 +231,7 @@ private:
|
|||
// the view weapon render entity parms
|
||||
idVec3 viewWeaponOrigin;
|
||||
idMat3 viewWeaponAxis;
|
||||
|
||||
|
||||
// the muzzle bone's position, used for launching projectiles and trailing smoke
|
||||
idVec3 muzzleOrigin;
|
||||
idMat3 muzzleAxis;
|
||||
|
@ -290,7 +290,7 @@ private:
|
|||
bool isFiring;
|
||||
|
||||
// zoom
|
||||
int zoomFov; // variable zoom fov per weapon
|
||||
int zoomFov; // variable zoom fov per weapon
|
||||
|
||||
// joints from models
|
||||
jointHandle_t barrelJointView;
|
||||
|
@ -318,8 +318,8 @@ private:
|
|||
int weaponSmokeStartTime; // set to gameLocal.time every weapon fire
|
||||
bool continuousSmoke; // if smoke is continuous ( chainsaw )
|
||||
const idDeclParticle * strikeSmoke; // striking something in melee
|
||||
int strikeSmokeStartTime; // timing
|
||||
idVec3 strikePos; // position of last melee strike
|
||||
int strikeSmokeStartTime; // timing
|
||||
idVec3 strikePos; // position of last melee strike
|
||||
idMat3 strikeAxis; // axis of last melee strike
|
||||
int nextStrikeFx; // used for sound and decal ( may use for strike smoke too )
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -163,7 +163,7 @@ int idAASLocal::BoundsReachableAreaNum( const idBounds &bounds, const int areaFl
|
|||
if ( !file ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return file->BoundsReachableAreaNum( bounds, areaFlags, TFL_INVALID );
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -196,7 +196,7 @@ void idAASLocal::ShowArea( const idVec3 &origin ) const {
|
|||
if ( aas_goalArea.GetInteger() ) {
|
||||
int travelTime;
|
||||
idReachability *reach;
|
||||
|
||||
|
||||
RouteToGoalArea( areaNum, org, aas_goalArea.GetInteger(), TFL_WALK|TFL_AIR, travelTime, &reach );
|
||||
gameLocal.Printf( "\rtt = %4d", travelTime );
|
||||
if ( reach ) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -1193,7 +1193,7 @@ bool idAASLocal::FindNearestGoal( aasGoal_t &goal, int areaNum, const idVec3 ori
|
|||
obstacles[k].expAbsBounds[0] = obstacles[k].absBounds[0] - file->GetSettings().boundingBoxes[0][1];
|
||||
obstacles[k].expAbsBounds[1] = obstacles[k].absBounds[1] - file->GetSettings().boundingBoxes[0][0];
|
||||
}
|
||||
|
||||
|
||||
badTravelFlags = ~travelFlags;
|
||||
SIMDProcessor->Memset( goalAreaTravelTimes, 0, file->GetNumAreas() * sizeof( unsigned short ) );
|
||||
|
||||
|
@ -1327,7 +1327,7 @@ bool idAASLocal::FindNearestGoal( aasGoal_t &goal, int areaNum, const idVec3 ori
|
|||
|
||||
// add travel time through the area
|
||||
t += AreaTravelTime( reach->toAreaNum, reach->end, nextArea->center );
|
||||
|
||||
|
||||
if ( !bestTravelTime || t < bestTravelTime ) {
|
||||
// if the area is not visible to the target
|
||||
if ( callback.TestArea( this, reach->toAreaNum ) ) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -221,7 +221,7 @@ idAASFindAttackPosition::idAASFindAttackPosition( const idAI *self, const idMat3
|
|||
this->gravityAxis = gravityAxis;
|
||||
|
||||
excludeBounds = idBounds( idVec3( -64.0, -64.0f, -8.0f ), idVec3( 64.0, 64.0f, 64.0f ) );
|
||||
excludeBounds.TranslateSelf( self->GetPhysics()->GetOrigin() );
|
||||
excludeBounds.TranslateSelf( self->GetPhysics()->GetOrigin() );
|
||||
|
||||
// setup PVS
|
||||
idBounds bounds( targetPos - idVec3( 16, 16, 0 ), targetPos + idVec3( 16, 16, 64 ) );
|
||||
|
@ -737,13 +737,13 @@ void idAI::Restore( idRestoreGame *savefile ) {
|
|||
memset(&newEmitter, 0, sizeof(newEmitter));
|
||||
|
||||
idStr name;
|
||||
savefile->ReadString( name );
|
||||
savefile->ReadString( name );
|
||||
|
||||
strcpy( newEmitter.name, name.c_str() );
|
||||
|
||||
savefile->ReadJoint( newEmitter.joint );
|
||||
savefile->ReadObject(reinterpret_cast<idClass *&>(newEmitter.particle));
|
||||
|
||||
|
||||
funcEmitters.Set(newEmitter.name, newEmitter);
|
||||
}
|
||||
|
||||
|
@ -751,7 +751,7 @@ void idAI::Restore( idRestoreGame *savefile ) {
|
|||
//if(harvestEnt.GetEntity()) {
|
||||
// harvestEnt.GetEntity()->SetParent(this);
|
||||
//}
|
||||
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -789,7 +789,7 @@ void idAI::Spawn( void ) {
|
|||
|
||||
spawnArgs.GetFloat( "melee_range", "64", melee_range );
|
||||
spawnArgs.GetFloat( "projectile_height_to_distance_ratio", "1", projectile_height_to_distance_ratio );
|
||||
|
||||
|
||||
spawnArgs.GetFloat( "turn_rate", "360", turnRate );
|
||||
|
||||
spawnArgs.GetBool( "talks", "0", talks );
|
||||
|
@ -921,7 +921,7 @@ void idAI::Spawn( void ) {
|
|||
|
||||
// move up to make sure the monster is at least an epsilon above the floor
|
||||
physicsObj.SetOrigin( GetPhysics()->GetOrigin() + idVec3( 0, 0, CM_CLIP_EPSILON ) );
|
||||
|
||||
|
||||
if ( num_cinematics ) {
|
||||
physicsObj.SetGravity( vec3_origin );
|
||||
} else {
|
||||
|
@ -1016,7 +1016,7 @@ void idAI::InitMuzzleFlash( void ) {
|
|||
|
||||
spawnArgs.GetString( "mtr_flashShader", "muzzleflash", &shader );
|
||||
spawnArgs.GetVector( "flashColor", "0 0 0", flashColor );
|
||||
float flashRadius = spawnArgs.GetFloat( "flashRadius" );
|
||||
float flashRadius = spawnArgs.GetFloat( "flashRadius" );
|
||||
flashTime = SEC2MS( spawnArgs.GetFloat( "flashTime", "0.25" ) );
|
||||
|
||||
memset( &worldMuzzleFlash, 0, sizeof ( worldMuzzleFlash ) );
|
||||
|
@ -1104,7 +1104,7 @@ void idAI::DormantEnd( void ) {
|
|||
// let our enemy know we're back on the trail
|
||||
enemyNode.AddToEnd( enemy.GetEntity()->enemyList );
|
||||
}
|
||||
|
||||
|
||||
if ( particles.Num() ) {
|
||||
for ( int i = 0; i < particles.Num(); i++ ) {
|
||||
particles[i].time = gameLocal.time;
|
||||
|
@ -1418,7 +1418,7 @@ idAI::ReachedPos
|
|||
bool idAI::ReachedPos( const idVec3 &pos, const moveCommand_t moveCommand ) const {
|
||||
if ( move.moveType == MOVETYPE_SLIDE ) {
|
||||
idBounds bnds( idVec3( -4, -4.0f, -8.0f ), idVec3( 4.0f, 4.0f, 64.0f ) );
|
||||
bnds.TranslateSelf( physicsObj.GetOrigin() );
|
||||
bnds.TranslateSelf( physicsObj.GetOrigin() );
|
||||
if ( bnds.ContainsPoint( pos ) ) {
|
||||
return true;
|
||||
}
|
||||
|
@ -1429,7 +1429,7 @@ bool idAI::ReachedPos( const idVec3 &pos, const moveCommand_t moveCommand ) cons
|
|||
}
|
||||
} else {
|
||||
idBounds bnds( idVec3( -16.0, -16.0f, -8.0f ), idVec3( 16.0, 16.0f, 64.0f ) );
|
||||
bnds.TranslateSelf( physicsObj.GetOrigin() );
|
||||
bnds.TranslateSelf( physicsObj.GetOrigin() );
|
||||
if ( bnds.ContainsPoint( pos ) ) {
|
||||
return true;
|
||||
}
|
||||
|
@ -2090,7 +2090,7 @@ idAI::WanderAround
|
|||
*/
|
||||
bool idAI::WanderAround( void ) {
|
||||
StopMove( MOVE_STATUS_DONE );
|
||||
|
||||
|
||||
move.moveDest = physicsObj.GetOrigin() + viewAxis[ 0 ] * physicsObj.GetGravityAxis() * 256.0f;
|
||||
if ( !NewWanderDir( move.moveDest ) ) {
|
||||
StopMove( MOVE_STATUS_DEST_UNREACHABLE );
|
||||
|
@ -2163,7 +2163,7 @@ bool idAI::StepDirection( float dir ) {
|
|||
if ( z <= ceilingPos.z ) {
|
||||
start.x = org.x;
|
||||
start.y = org.y;
|
||||
start.z = z;
|
||||
start.z = z;
|
||||
} else {
|
||||
start = ceilingPos;
|
||||
}
|
||||
|
@ -2250,7 +2250,7 @@ bool idAI::NewWanderDir( const idVec3 &dest ) {
|
|||
if ( gameLocal.random.RandomInt() & 1 ) {
|
||||
for( tdir = 0; tdir <= 315; tdir += 45 ) {
|
||||
if ( tdir != turnaround && StepDirection( tdir ) ) {
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -2303,7 +2303,7 @@ bool idAI::GetMovePos( idVec3 &seekPos ) {
|
|||
}
|
||||
return false;
|
||||
break;
|
||||
|
||||
|
||||
case MOVE_SLIDE_TO_POSITION :
|
||||
seekPos = org;
|
||||
return false;
|
||||
|
@ -2739,7 +2739,7 @@ void idAI::AnimMove( void ) {
|
|||
|
||||
AI_BLOCKED = false;
|
||||
|
||||
if ( move.moveCommand < NUM_NONMOVING_COMMANDS ){
|
||||
if ( move.moveCommand < NUM_NONMOVING_COMMANDS ){
|
||||
move.lastMoveOrigin.Zero();
|
||||
move.lastMoveTime = gameLocal.time;
|
||||
}
|
||||
|
@ -2861,7 +2861,7 @@ void idAI::SlideMove( void ) {
|
|||
|
||||
AI_BLOCKED = false;
|
||||
|
||||
if ( move.moveCommand < NUM_NONMOVING_COMMANDS ){
|
||||
if ( move.moveCommand < NUM_NONMOVING_COMMANDS ){
|
||||
move.lastMoveOrigin.Zero();
|
||||
move.lastMoveTime = gameLocal.time;
|
||||
}
|
||||
|
@ -2961,9 +2961,9 @@ idAI::AdjustFlyingAngles
|
|||
*/
|
||||
void idAI::AdjustFlyingAngles( void ) {
|
||||
idVec3 vel;
|
||||
float speed;
|
||||
float roll;
|
||||
float pitch;
|
||||
float speed;
|
||||
float roll;
|
||||
float pitch;
|
||||
|
||||
vel = physicsObj.GetLinearVelocity();
|
||||
|
||||
|
@ -3042,7 +3042,7 @@ void idAI::AdjustFlyHeight( idVec3 &vel, const idVec3 &goalPos ) {
|
|||
vel.z += addVel.z;
|
||||
goLower = true;
|
||||
}
|
||||
|
||||
|
||||
if ( ai_debugMove.GetBool() ) {
|
||||
gameRenderWorld->DebugBounds( goLower ? colorRed : colorGreen, physicsObj.GetBounds(), path.endPos, gameLocal.msec );
|
||||
}
|
||||
|
@ -3072,7 +3072,7 @@ idAI::FlySeekGoal
|
|||
*/
|
||||
void idAI::FlySeekGoal( idVec3 &vel, idVec3 &goalPos ) {
|
||||
idVec3 seekVel;
|
||||
|
||||
|
||||
// seek the goal position
|
||||
seekVel = Seek( vel, physicsObj.GetOrigin(), goalPos, AI_SEEK_PREDICTION );
|
||||
seekVel *= fly_seek_scale;
|
||||
|
@ -3403,7 +3403,7 @@ void idAI::Killed( idEntity *inflictor, idEntity *attacker, int damage, const id
|
|||
EndAttack();
|
||||
|
||||
if ( g_debugDamage.GetBool() ) {
|
||||
gameLocal.Printf( "Damage: joint: '%s', zone '%s'\n", animator.GetJointName( ( jointHandle_t )location ),
|
||||
gameLocal.Printf( "Damage: joint: '%s', zone '%s'\n", animator.GetJointName( ( jointHandle_t )location ),
|
||||
GetDamageGroup( location ) );
|
||||
}
|
||||
|
||||
|
@ -3503,7 +3503,7 @@ void idAI::Killed( idEntity *inflictor, idEntity *attacker, int damage, const id
|
|||
idEntity *temp;
|
||||
gameLocal.SpawnEntityDef( *harvestDef, &temp, false );
|
||||
harvestEnt = static_cast<idHarvestable *>(temp);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(harvestEnt.GetEntity()) {
|
||||
|
@ -3628,7 +3628,7 @@ void idAI::Activate( idEntity *activator ) {
|
|||
|
||||
// update the script in cinematics so that entities don't start anims or show themselves a frame late.
|
||||
if ( cinematic ) {
|
||||
UpdateAIScript();
|
||||
UpdateAIScript();
|
||||
|
||||
// make sure our model gets updated
|
||||
animator.ForceUpdate();
|
||||
|
@ -4046,7 +4046,7 @@ void idAI::CalculateAttackOffsets( void ) {
|
|||
return;
|
||||
}
|
||||
num = modelDef->NumAnims();
|
||||
|
||||
|
||||
// needs to be off while getting the offsets so that we account for the distance the monster moves in the attack anim
|
||||
animator.RemoveOriginOffset( false );
|
||||
|
||||
|
@ -4175,7 +4175,7 @@ idProjectile *idAI::CreateProjectile( const idVec3 &pos, const idVec3 &dir ) {
|
|||
clsname = projectileDef->GetString( "classname" );
|
||||
gameLocal.Error( "Could not spawn entityDef '%s'", clsname );
|
||||
}
|
||||
|
||||
|
||||
if ( !ent->IsType( idProjectile::Type ) ) {
|
||||
clsname = ent->GetClassname();
|
||||
gameLocal.Error( "'%s' is not an idProjectile", clsname );
|
||||
|
@ -4650,7 +4650,7 @@ idAI::UpdateMuzzleFlash
|
|||
================
|
||||
*/
|
||||
void idAI::UpdateMuzzleFlash( void ) {
|
||||
if ( worldMuzzleFlashHandle != -1 ) {
|
||||
if ( worldMuzzleFlashHandle != -1 ) {
|
||||
if ( gameLocal.time >= muzzleFlashEnd ) {
|
||||
gameRenderWorld->FreeLightDef( worldMuzzleFlashHandle );
|
||||
worldMuzzleFlashHandle = -1;
|
||||
|
@ -4841,7 +4841,7 @@ void idAI::TriggerParticles( const char *jointName ) {
|
|||
|
||||
#ifdef _D3XP
|
||||
void idAI::TriggerFX( const char* joint, const char* fx ) {
|
||||
|
||||
|
||||
if( !strcmp(joint, "origin") ) {
|
||||
idEntityFx::StartFx( fx, NULL, NULL, this, true );
|
||||
} else {
|
||||
|
@ -4903,14 +4903,14 @@ idEntity* idAI::StartEmitter( const char* name, const char* joint, const char* p
|
|||
axis[0] = -tmp;
|
||||
|
||||
ent->GetPhysics()->SetAxis(axis);*/
|
||||
|
||||
|
||||
axis = physicsObj.GetGravityAxis();
|
||||
ent->GetPhysics()->SetAxis(axis);
|
||||
|
||||
|
||||
|
||||
ent->GetPhysics()->GetClipModel()->SetOwner( this );
|
||||
|
||||
|
||||
|
||||
//Keep a reference to the emitter so we can track it
|
||||
funcEmitter_t newEmitter;
|
||||
strcpy(newEmitter.name, name);
|
||||
|
@ -4964,10 +4964,10 @@ bool idAI::UpdateAnimationControllers( void ) {
|
|||
idVec3 focusPos;
|
||||
idQuat jawQuat;
|
||||
idVec3 left;
|
||||
idVec3 dir;
|
||||
idVec3 orientationJointPos;
|
||||
idVec3 localDir;
|
||||
idAngles newLookAng;
|
||||
idVec3 dir;
|
||||
idVec3 orientationJointPos;
|
||||
idVec3 localDir;
|
||||
idAngles newLookAng;
|
||||
idAngles diff;
|
||||
idMat3 mat;
|
||||
idMat3 axis;
|
||||
|
@ -5022,7 +5022,7 @@ bool idAI::UpdateAnimationControllers( void ) {
|
|||
|
||||
idEntity *focusEnt = focusEntity.GetEntity();
|
||||
if ( !allowJointMod || !allowEyeFocus || ( gameLocal.time >= focusTime ) ) {
|
||||
focusPos = GetEyePosition() + orientationJointAxis[ 0 ] * 512.0f;
|
||||
focusPos = GetEyePosition() + orientationJointAxis[ 0 ] * 512.0f;
|
||||
} else if ( focusEnt == NULL ) {
|
||||
// keep looking at last position until focusTime is up
|
||||
focusPos = currentFocusPos;
|
||||
|
@ -5056,7 +5056,7 @@ bool idAI::UpdateAnimationControllers( void ) {
|
|||
newLookAng.roll = 0.0f;
|
||||
|
||||
diff = newLookAng - lookAng;
|
||||
|
||||
|
||||
if ( eyeAng != diff ) {
|
||||
eyeAng = diff;
|
||||
eyeAng.Clamp( eyeMin, eyeMax );
|
||||
|
@ -5105,7 +5105,7 @@ bool idAI::UpdateAnimationControllers( void ) {
|
|||
// lean into turns
|
||||
AdjustFlyingAngles();
|
||||
}
|
||||
|
||||
|
||||
if ( headEnt ) {
|
||||
idAnimator *headAnimator = headEnt->GetAnimator();
|
||||
|
||||
|
@ -5253,7 +5253,7 @@ void idCombatNode::DrawDebugInfo( void ) {
|
|||
idPlayer *player = gameLocal.GetLocalPlayer();
|
||||
idVec4 color;
|
||||
idBounds bounds( idVec3( -16, -16, 0 ), idVec3( 16, 16, 0 ) );
|
||||
|
||||
|
||||
for( ent = gameLocal.spawnedEntities.Next(); ent != NULL; ent = ent->spawnNode.Next() ) {
|
||||
if ( !ent->IsType( idCombatNode::Type ) ) {
|
||||
continue;
|
||||
|
@ -5315,7 +5315,7 @@ bool idCombatNode::EntityInView( idActor *actor, const idVec3 &pos ) {
|
|||
const idMat3 &axis = GetPhysics()->GetAxis();
|
||||
idVec3 dir = pos - org;
|
||||
float dist = dir * axis[ 0 ];
|
||||
|
||||
|
||||
if ( ( dist < min_dist ) || ( dist > max_dist ) ) {
|
||||
return false;
|
||||
}
|
||||
|
|
16
d3xp/ai/AI.h
16
d3xp/ai/AI.h
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -70,7 +70,7 @@ typedef enum {
|
|||
|
||||
MOVE_TO_ENEMY = NUM_NONMOVING_COMMANDS,
|
||||
MOVE_TO_ENEMYHEIGHT,
|
||||
MOVE_TO_ENTITY,
|
||||
MOVE_TO_ENTITY,
|
||||
MOVE_OUT_OF_RANGE,
|
||||
MOVE_TO_ATTACK_POSITION,
|
||||
MOVE_TO_COVER,
|
||||
|
@ -112,9 +112,9 @@ typedef struct obstaclePath_s {
|
|||
idVec3 seekPos; // seek position avoiding obstacles
|
||||
idEntity * firstObstacle; // if != NULL the first obstacle along the path
|
||||
idVec3 startPosOutsideObstacles; // start position outside obstacles
|
||||
idEntity * startPosObstacle; // if != NULL the obstacle containing the start position
|
||||
idEntity * startPosObstacle; // if != NULL the obstacle containing the start position
|
||||
idVec3 seekPosOutsideObstacles; // seek position outside obstacles
|
||||
idEntity * seekPosObstacle; // if != NULL the obstacle containing the seek position
|
||||
idEntity * seekPosObstacle; // if != NULL the obstacle containing the seek position
|
||||
} obstaclePath_t;
|
||||
|
||||
// path prediction
|
||||
|
@ -333,7 +333,7 @@ protected:
|
|||
bool allowHiddenMovement; // allows character to still move around while hidden
|
||||
bool disableGravity; // disables gravity and allows vertical movement by the animation
|
||||
bool af_push_moveables; // allow the articulated figure to push moveable objects
|
||||
|
||||
|
||||
// weapon/attack vars
|
||||
bool lastHitCheckResult;
|
||||
int lastHitCheckTime;
|
||||
|
@ -385,7 +385,7 @@ protected:
|
|||
// special fx
|
||||
float shrivel_rate;
|
||||
int shrivel_start;
|
||||
|
||||
|
||||
bool restartParticles; // should smoke emissions restart
|
||||
bool useBoneAxis; // use the bone vs the model axis
|
||||
idList<particleEmitter_t> particles; // particle data
|
||||
|
@ -689,8 +689,8 @@ protected:
|
|||
void Event_AllowHiddenMovement( int enable );
|
||||
void Event_TriggerParticles( const char *jointName );
|
||||
void Event_FindActorsInBounds( const idVec3 &mins, const idVec3 &maxs );
|
||||
void Event_CanReachPosition( const idVec3 &pos );
|
||||
void Event_CanReachEntity( idEntity *ent );
|
||||
void Event_CanReachPosition( const idVec3 &pos );
|
||||
void Event_CanReachEntity( idEntity *ent );
|
||||
void Event_CanReachEnemy( void );
|
||||
void Event_GetReachableEntityPosition( idEntity *ent );
|
||||
#ifdef _D3XP
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -108,10 +108,10 @@ void idAI_Vagary::Event_ChooseObjectToThrow( const idVec3 &mins, const idVec3 &m
|
|||
continue;
|
||||
}
|
||||
|
||||
if ( PredictTrajectory( entPhys->GetOrigin() + offsetVec, enemyEyePos, speed, entPhys->GetGravity(),
|
||||
if ( PredictTrajectory( entPhys->GetOrigin() + offsetVec, enemyEyePos, speed, entPhys->GetGravity(),
|
||||
entPhys->GetClipModel(), entPhys->GetClipMask(), MAX_WORLD_SIZE, NULL, enemyEnt, ai_debugTrajectory.GetBool() ? 4000 : 0, vel ) ) {
|
||||
idThread::ReturnEntity( ent );
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ void idAI_Vagary::Event_ThrowObjectAtEnemy( idEntity *ent, float speed ) {
|
|||
if ( !enemyEnt ) {
|
||||
vel = ( viewAxis[ 0 ] * physicsObj.GetGravityAxis() ) * speed;
|
||||
} else {
|
||||
PredictTrajectory( entPhys->GetOrigin(), lastVisibleEnemyPos + lastVisibleEnemyEyeOffset, speed, entPhys->GetGravity(),
|
||||
PredictTrajectory( entPhys->GetOrigin(), lastVisibleEnemyPos + lastVisibleEnemyEyeOffset, speed, entPhys->GetGravity(),
|
||||
entPhys->GetClipModel(), entPhys->GetClipMask(), MAX_WORLD_SIZE, NULL, enemyEnt, ai_debugTrajectory.GetBool() ? 4000 : 0, vel );
|
||||
vel *= speed;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -166,10 +166,10 @@ const idEventDef AI_GetReachableEntityPosition( "getReachableEntityPosition", "e
|
|||
#ifdef _D3XP
|
||||
const idEventDef AI_MoveToPositionDirect( "moveToPositionDirect", "v" );
|
||||
const idEventDef AI_AvoidObstacles( "avoidObstacles", "d" );
|
||||
const idEventDef AI_TriggerFX( "triggerFX", "ss" );
|
||||
const idEventDef AI_StartEmitter( "startEmitter", "sss", 'e' );
|
||||
const idEventDef AI_GetEmitter( "getEmitter", "s", 'e' );
|
||||
const idEventDef AI_StopEmitter( "stopEmitter", "s" );
|
||||
const idEventDef AI_TriggerFX( "triggerFX", "ss" );
|
||||
const idEventDef AI_StartEmitter( "startEmitter", "sss", 'e' );
|
||||
const idEventDef AI_GetEmitter( "getEmitter", "s", 'e' );
|
||||
const idEventDef AI_StopEmitter( "stopEmitter", "s" );
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -265,7 +265,7 @@ CLASS_DECLARATION( idActor, idAI )
|
|||
EVENT( AI_SetMoveType, idAI::Event_SetMoveType )
|
||||
EVENT( AI_SaveMove, idAI::Event_SaveMove )
|
||||
EVENT( AI_RestoreMove, idAI::Event_RestoreMove )
|
||||
EVENT( AI_AllowMovement, idAI::Event_AllowMovement )
|
||||
EVENT( AI_AllowMovement, idAI::Event_AllowMovement )
|
||||
EVENT( AI_JumpFrame, idAI::Event_JumpFrame )
|
||||
EVENT( AI_EnableClip, idAI::Event_EnableClip )
|
||||
EVENT( AI_DisableClip, idAI::Event_DisableClip )
|
||||
|
@ -308,7 +308,7 @@ CLASS_DECLARATION( idActor, idAI )
|
|||
EVENT( AI_GetReachableEntityPosition, idAI::Event_GetReachableEntityPosition )
|
||||
#ifdef _D3XP
|
||||
EVENT( AI_MoveToPositionDirect, idAI::Event_MoveToPositionDirect )
|
||||
EVENT( AI_AvoidObstacles, idAI::Event_AvoidObstacles )
|
||||
EVENT( AI_AvoidObstacles, idAI::Event_AvoidObstacles )
|
||||
EVENT( AI_TriggerFX, idAI::Event_TriggerFX )
|
||||
EVENT( AI_StartEmitter, idAI::Event_StartEmitter )
|
||||
EVENT( AI_GetEmitter, idAI::Event_GetEmitter )
|
||||
|
@ -476,7 +476,7 @@ void idAI::Event_ClosestReachableEnemyOfEntity( idEntity *team_mate ) {
|
|||
int areaNum;
|
||||
int enemyAreaNum;
|
||||
aasPath_t path;
|
||||
|
||||
|
||||
if ( !team_mate->IsType( idActor::Type ) ) {
|
||||
gameLocal.Error( "Entity '%s' is not an AI character or player", team_mate->GetName() );
|
||||
}
|
||||
|
@ -741,7 +741,7 @@ idAI::Event_AttackMelee
|
|||
*/
|
||||
void idAI::Event_AttackMelee( const char *meleeDefName ) {
|
||||
bool hit;
|
||||
|
||||
|
||||
hit = AttackMelee( meleeDefName );
|
||||
idThread::ReturnInt( hit );
|
||||
}
|
||||
|
@ -828,7 +828,7 @@ void idAI::Event_MeleeAttackToJoint( const char *jointname, const char *meleeDef
|
|||
animator.GetJointTransform( joint, gameLocal.time, end, axis );
|
||||
end = physicsObj.GetOrigin() + ( end + modelOffset ) * viewAxis * physicsObj.GetGravityAxis();
|
||||
start = GetEyePosition();
|
||||
|
||||
|
||||
if ( ai_debugMove.GetBool() ) {
|
||||
gameRenderWorld->DebugLine( colorYellow, start, end, gameLocal.msec );
|
||||
}
|
||||
|
@ -1316,7 +1316,7 @@ void idAI::Event_EnemyInCombatCone( idEntity *ent, int use_current_enemy_locatio
|
|||
}
|
||||
|
||||
#ifdef _D3XP
|
||||
//Allow the level designers define attack nodes that the enemy should never leave.
|
||||
//Allow the level designers define attack nodes that the enemy should never leave.
|
||||
//This is different that the turrent type combat nodes because they can play an animation
|
||||
if(ent->spawnArgs.GetBool("neverLeave", "0")) {
|
||||
idThread::ReturnInt( true );
|
||||
|
@ -1397,7 +1397,7 @@ void idAI::Event_EntityInAttackCone( idEntity *ent ) {
|
|||
idVec3 delta;
|
||||
float yaw;
|
||||
float relYaw;
|
||||
|
||||
|
||||
if ( !ent ) {
|
||||
idThread::ReturnInt( false );
|
||||
return;
|
||||
|
@ -1598,7 +1598,7 @@ void idAI::Event_CanHitEnemy( void ) {
|
|||
hit = gameLocal.GetTraceEntity( tr );
|
||||
if ( tr.fraction >= 1.0f || ( hit == enemyEnt ) ) {
|
||||
lastHitCheckResult = true;
|
||||
} else if ( ( tr.fraction < 1.0f ) && ( hit->IsType( idAI::Type ) ) &&
|
||||
} else if ( ( tr.fraction < 1.0f ) && ( hit->IsType( idAI::Type ) ) &&
|
||||
( static_cast<idAI *>( hit )->team != team ) ) {
|
||||
lastHitCheckResult = true;
|
||||
} else {
|
||||
|
@ -1838,7 +1838,7 @@ void idAI::Event_TestAnimMoveTowardEnemy( const char *animname ) {
|
|||
float yaw;
|
||||
idVec3 delta;
|
||||
idActor *enemyEnt;
|
||||
|
||||
|
||||
enemyEnt = enemy.GetEntity();
|
||||
if ( !enemyEnt ) {
|
||||
idThread::ReturnInt( false );
|
||||
|
@ -1853,7 +1853,7 @@ void idAI::Event_TestAnimMoveTowardEnemy( const char *animname ) {
|
|||
}
|
||||
|
||||
delta = enemyEnt->GetPhysics()->GetOrigin() - physicsObj.GetOrigin();
|
||||
yaw = delta.ToYaw();
|
||||
yaw = delta.ToYaw();
|
||||
|
||||
moveVec = animator.TotalMovementDelta( anim ) * idAngles( 0.0f, yaw, 0.0f ).ToMat3() * physicsObj.GetGravityAxis();
|
||||
idAI::PredictPath( this, aas, physicsObj.GetOrigin(), moveVec, 1000, 1000, ( move.moveType == MOVETYPE_FLY ) ? SE_BLOCKED : ( SE_ENTER_OBSTACLE | SE_BLOCKED | SE_ENTER_LEDGE_AREA ), path );
|
||||
|
@ -2578,7 +2578,7 @@ idAI::Event_LocateEnemy
|
|||
void idAI::Event_LocateEnemy( void ) {
|
||||
idActor *enemyEnt;
|
||||
int areaNum;
|
||||
|
||||
|
||||
enemyEnt = enemy.GetEntity();
|
||||
if ( !enemyEnt ) {
|
||||
return;
|
||||
|
@ -2597,7 +2597,7 @@ idAI::Event_KickObstacles
|
|||
void idAI::Event_KickObstacles( idEntity *kickEnt, float force ) {
|
||||
idVec3 dir;
|
||||
idEntity *obEnt;
|
||||
|
||||
|
||||
if ( kickEnt ) {
|
||||
obEnt = kickEnt;
|
||||
} else {
|
||||
|
@ -2903,4 +2903,3 @@ void idAI::Event_StopEmitter( const char* name ) {
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -52,10 +52,10 @@ If you have questions concerning this license or the applicable additional terms
|
|||
const float MAX_OBSTACLE_RADIUS = 256.0f;
|
||||
const float PUSH_OUTSIDE_OBSTACLES = 0.5f;
|
||||
const float CLIP_BOUNDS_EPSILON = 10.0f;
|
||||
const int MAX_AAS_WALL_EDGES = 256;
|
||||
const int MAX_OBSTACLES = 256;
|
||||
const int MAX_AAS_WALL_EDGES = 256;
|
||||
const int MAX_OBSTACLES = 256;
|
||||
const int MAX_PATH_NODES = 256;
|
||||
const int MAX_OBSTACLE_PATH = 64;
|
||||
const int MAX_OBSTACLE_PATH = 64;
|
||||
|
||||
typedef struct obstacle_s {
|
||||
idVec2 bounds[2];
|
||||
|
@ -260,7 +260,7 @@ void GetPointOutsideObstacles( const obstacle_t *obstacles, const int numObstacl
|
|||
return;
|
||||
}
|
||||
}
|
||||
gameLocal.Warning( "GetPointOutsideObstacles: no valid point found" );
|
||||
gameLocal.Warning( "GetPointOutsideObstacles: no valid point found" );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -425,7 +425,7 @@ int GetObstacles( const idPhysics *physics, const idAAS *aas, const idEntity *ig
|
|||
lastEdgeNormal.Zero();
|
||||
nextVerts[0] = nextVerts[1] = 0;
|
||||
for ( i = 0; i < numWallEdges && numObstacles < MAX_OBSTACLES; i++ ) {
|
||||
aas->GetEdge( wallEdges[i], start, end );
|
||||
aas->GetEdge( wallEdges[i], start, end );
|
||||
aas->GetEdgeVertexNumbers( wallEdges[i], verts );
|
||||
edgeDir = end.ToVec2() - start.ToVec2();
|
||||
edgeDir.Normalize();
|
||||
|
@ -1338,7 +1338,7 @@ static float HeightForTrajectory( const idVec3 &start, float zVel, float gravity
|
|||
t = zVel / gravity;
|
||||
// maximum height of projectile
|
||||
maxHeight = start.z - 0.5f * gravity * ( t * t );
|
||||
|
||||
|
||||
return maxHeight;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -216,7 +216,7 @@ bool idMD5Anim::LoadAnim( const char *filename ) {
|
|||
for( i = 0; i < numJoints; i++ ) {
|
||||
parser.ReadToken( &token );
|
||||
jointInfo[ i ].nameIndex = animationLib.JointIndex( token );
|
||||
|
||||
|
||||
// parse parent num
|
||||
jointInfo[ i ].parentNum = parser.ParseInt();
|
||||
if ( jointInfo[ i ].parentNum >= i ) {
|
||||
|
@ -278,7 +278,7 @@ bool idMD5Anim::LoadAnim( const char *filename ) {
|
|||
parser.Error( "Expected frame number %d", i );
|
||||
}
|
||||
parser.ExpectTokenString( "{" );
|
||||
|
||||
|
||||
for( j = 0; j < numAnimatedComponents; j++, componentPtr++ ) {
|
||||
*componentPtr = parser.ParseFloat();
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ void idMD5Anim::ConvertTimeToFrame( int time, int cyclecount, frameBlend_t &fram
|
|||
frame.cycleCount = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
frameTime = time * frameRate;
|
||||
frameNum = frameTime / 1000;
|
||||
frame.cycleCount = frameNum / ( numFrames - 1 );
|
||||
|
@ -415,7 +415,7 @@ void idMD5Anim::ConvertTimeToFrame( int time, int cyclecount, frameBlend_t &fram
|
|||
frame.frontlerp = 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
frame.frame1 = frameNum % ( numFrames - 1 );
|
||||
frame.frame2 = frame.frame1 + 1;
|
||||
if ( frame.frame2 >= numFrames ) {
|
||||
|
@ -436,7 +436,7 @@ void idMD5Anim::GetOrigin( idVec3 &offset, int time, int cyclecount ) const {
|
|||
|
||||
offset = baseFrame[ 0 ].t;
|
||||
if ( !( jointInfo[ 0 ].animBits & ( ANIM_TX | ANIM_TY | ANIM_TZ ) ) ) {
|
||||
// just use the baseframe
|
||||
// just use the baseframe
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -474,10 +474,10 @@ idMD5Anim::GetOriginRotation
|
|||
void idMD5Anim::GetOriginRotation( idQuat &rotation, int time, int cyclecount ) const {
|
||||
frameBlend_t frame;
|
||||
int animBits;
|
||||
|
||||
|
||||
animBits = jointInfo[ 0 ].animBits;
|
||||
if ( !( animBits & ( ANIM_QX | ANIM_QY | ANIM_QZ ) ) ) {
|
||||
// just use the baseframe
|
||||
// just use the baseframe
|
||||
rotation = baseFrame[ 0 ].q;
|
||||
return;
|
||||
}
|
||||
|
@ -1070,7 +1070,7 @@ void idAnimManager::FlushUnusedAnims( void ) {
|
|||
int i;
|
||||
idMD5Anim **animptr;
|
||||
idList<idMD5Anim *> removeAnims;
|
||||
|
||||
|
||||
for( i = 0; i < animations.Num(); i++ ) {
|
||||
animptr = animations.GetIndex( i );
|
||||
if ( animptr && *animptr ) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -147,7 +147,7 @@ typedef enum {
|
|||
FC_RECORDDEMO,
|
||||
FC_AVIGAME
|
||||
#ifdef _D3XP
|
||||
, FC_LAUNCH_PROJECTILE,
|
||||
, FC_LAUNCH_PROJECTILE,
|
||||
FC_TRIGGER_FX,
|
||||
FC_START_EMITTER,
|
||||
FC_STOP_EMITTER,
|
||||
|
@ -251,7 +251,7 @@ public:
|
|||
void IncreaseRefs( void ) const;
|
||||
void DecreaseRefs( void ) const;
|
||||
int NumRefs( void ) const;
|
||||
|
||||
|
||||
void CheckModelHierarchy( const idRenderModel *model ) const;
|
||||
void GetInterpolatedFrame( frameBlend_t &frame, idJointQuat *joints, const int *index, int numIndexes ) const;
|
||||
void GetSingleFrame( int framenum, idJointQuat *joints, const int *index, int numIndexes ) const;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -163,7 +163,7 @@ index 0 will never be NULL. Any anim >= NumAnims will return NULL.
|
|||
=====================
|
||||
*/
|
||||
const idMD5Anim *idAnim::MD5Anim( int num ) const {
|
||||
if ( anims == NULL || anims[0] == NULL ) {
|
||||
if ( anims == NULL || anims[0] == NULL ) {
|
||||
return NULL;
|
||||
}
|
||||
return anims[ num ];
|
||||
|
@ -196,11 +196,11 @@ int idAnim::Length( void ) const {
|
|||
idAnim::NumFrames
|
||||
=====================
|
||||
*/
|
||||
int idAnim::NumFrames( void ) const {
|
||||
int idAnim::NumFrames( void ) const {
|
||||
if ( !anims[ 0 ] ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return anims[ 0 ]->NumFrames();
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ int idAnim::NumFrames( void ) const {
|
|||
idAnim::NumAnims
|
||||
=====================
|
||||
*/
|
||||
int idAnim::NumAnims( void ) const {
|
||||
int idAnim::NumAnims( void ) const {
|
||||
return numAnims;
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ const idVec3 &idAnim::TotalMovementDelta( void ) const {
|
|||
if ( !anims[ 0 ] ) {
|
||||
return vec3_zero;
|
||||
}
|
||||
|
||||
|
||||
return anims[ 0 ]->TotalMovementDelta();
|
||||
}
|
||||
|
||||
|
@ -576,7 +576,7 @@ const char *idAnim::AddFrameCommand( const idDeclModelDef *modelDef, int framenu
|
|||
fc.type = FC_LAUNCH_PROJECTILE;
|
||||
fc.string = new idStr( token );
|
||||
} else if ( token == "trigger_fx" ) {
|
||||
|
||||
|
||||
if( !src.ReadTokenOnLine( &token ) ) {
|
||||
return "Unexpected end of line";
|
||||
}
|
||||
|
@ -703,7 +703,7 @@ const char *idAnim::AddFrameCommand( const idDeclModelDef *modelDef, int framenu
|
|||
frameLookup[ i ].firstCommand++;
|
||||
}
|
||||
|
||||
// store the new command
|
||||
// store the new command
|
||||
frameCommands[ index ] = fc;
|
||||
|
||||
// increase the number of commands on this frame
|
||||
|
@ -1192,7 +1192,7 @@ void idAnimBlend::Reset( const idDeclModelDef *_modelDef ) {
|
|||
|
||||
blendStartValue = 0.0f;
|
||||
blendEndValue = 0.0f;
|
||||
blendStartTime = 0;
|
||||
blendStartTime = 0;
|
||||
blendDuration = 0;
|
||||
}
|
||||
|
||||
|
@ -1292,7 +1292,7 @@ idAnimBlend::SetWeight
|
|||
void idAnimBlend::SetWeight( float newweight, int currentTime, int blendTime ) {
|
||||
blendStartValue = GetWeight( currentTime );
|
||||
blendEndValue = newweight;
|
||||
blendStartTime = currentTime - 1;
|
||||
blendStartTime = currentTime - 1;
|
||||
blendDuration = blendTime;
|
||||
|
||||
if ( !newweight ) {
|
||||
|
@ -1343,7 +1343,7 @@ void idAnimBlend::SetFrame( const idDeclModelDef *modelDef, int _animNum, int _f
|
|||
if ( !modelDef ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const idAnim *_anim = modelDef->GetAnim( _animNum );
|
||||
if ( !_anim ) {
|
||||
return;
|
||||
|
@ -1354,7 +1354,7 @@ void idAnimBlend::SetFrame( const idDeclModelDef *modelDef, int _animNum, int _f
|
|||
gameLocal.Warning( "Model '%s' has different # of joints than anim '%s'", modelDef->GetModelName(), md5anim->Name() );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
animNum = _animNum;
|
||||
starttime = currentTime;
|
||||
endtime = -1;
|
||||
|
@ -1386,7 +1386,7 @@ void idAnimBlend::CycleAnim( const idDeclModelDef *modelDef, int _animNum, int c
|
|||
if ( !modelDef ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const idAnim *_anim = modelDef->GetAnim( _animNum );
|
||||
if ( !_anim ) {
|
||||
return;
|
||||
|
@ -1426,7 +1426,7 @@ void idAnimBlend::PlayAnim( const idDeclModelDef *modelDef, int _animNum, int cu
|
|||
if ( !modelDef ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const idAnim *_anim = modelDef->GetAnim( _animNum );
|
||||
if ( !_anim ) {
|
||||
return;
|
||||
|
@ -1918,7 +1918,7 @@ bool idAnimBlend::BlendAnim( int currentTime, int channel, int numJoints, idJoin
|
|||
blendFrame[j].q = jointFrame[j].q;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
blendWeight += weight;
|
||||
lerp = weight / blendWeight;
|
||||
SIMDProcessor->BlendJoints( blendFrame, jointFrame, lerp, modelDef->GetChannelJoints( channel ), modelDef->NumJointsOnChannel( channel ) );
|
||||
|
@ -2000,7 +2000,7 @@ void idAnimBlend::BlendDelta( int fromtime, int totime, idVec3 &blendDelta, floa
|
|||
float lerp;
|
||||
int num;
|
||||
int i;
|
||||
|
||||
|
||||
if ( frame || !allowMove || ( ( endtime > 0 ) && ( fromtime > endtime ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
@ -2059,7 +2059,7 @@ void idAnimBlend::BlendDeltaRotation( int fromtime, int totime, idQuat &blendDel
|
|||
float mixWeight;
|
||||
int num;
|
||||
int i;
|
||||
|
||||
|
||||
if ( frame || !allowMove || ( ( endtime > 0 ) && ( fromtime > endtime ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
@ -2142,7 +2142,7 @@ bool idAnimBlend::AddBounds( int currentTime, idBounds &bounds, bool removeOrigi
|
|||
|
||||
time = AnimTime( currentTime );
|
||||
num = anim->NumAnims();
|
||||
|
||||
|
||||
addorigin = !allowMove || !removeOriginOffset;
|
||||
for( i = 0; i < num; i++ ) {
|
||||
if ( anim->GetBounds( b, i, time, cycle ) ) {
|
||||
|
@ -2261,7 +2261,7 @@ const jointInfo_t *idDeclModelDef::FindJoint( const char *name ) const {
|
|||
if ( !modelHandle ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
joint = modelHandle->GetJoints();
|
||||
for( i = 0; i < joints.Num(); i++, joint++ ) {
|
||||
if ( !joint->name.Icmp( name ) ) {
|
||||
|
@ -2667,7 +2667,7 @@ bool idDeclModelDef::Parse( const char *text, const int textLength ) {
|
|||
MakeDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const idDeclModelDef *copy = static_cast<const idDeclModelDef *>( declManager->FindType( DECL_MODELDEF, token2, false ) );
|
||||
if ( !copy ) {
|
||||
common->Warning( "Unknown model definition '%s'", token2.c_str() );
|
||||
|
@ -2872,7 +2872,7 @@ bool idDeclModelDef::HasAnim( const char *name ) const {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2915,7 +2915,7 @@ const idAnim *idDeclModelDef::GetAnim( int index ) const {
|
|||
if ( ( index < 1 ) || ( index > anims.Num() ) ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
return anims[ index - 1 ];
|
||||
}
|
||||
|
||||
|
@ -3031,7 +3031,7 @@ const char *idDeclModelDef::GetJointName( int jointHandle ) const {
|
|||
if ( !modelHandle ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if ( ( jointHandle < 0 ) || ( jointHandle > joints.Num() ) ) {
|
||||
gameLocal.Error( "idDeclModelDef::GetJointName : joint handle out of range" );
|
||||
}
|
||||
|
@ -3155,7 +3155,7 @@ void idAnimator::Save( idSaveGame *savefile ) const {
|
|||
savefile->WriteInt( (int&)jointMods[ i ]->transform_pos );
|
||||
savefile->WriteInt( (int&)jointMods[ i ]->transform_axis );
|
||||
}
|
||||
|
||||
|
||||
savefile->WriteInt( numJoints );
|
||||
for ( i = 0; i < numJoints; i++ ) {
|
||||
float *data = joints[i].ToFloatPtr();
|
||||
|
@ -3175,14 +3175,14 @@ void idAnimator::Save( idSaveGame *savefile ) const {
|
|||
for ( i = 0; i < AFPoseJoints.Num(); i++ ) {
|
||||
savefile->WriteInt( AFPoseJoints[i] );
|
||||
}
|
||||
|
||||
|
||||
savefile->WriteInt( AFPoseJointMods.Num() );
|
||||
for ( i = 0; i < AFPoseJointMods.Num(); i++ ) {
|
||||
savefile->WriteInt( (int&)AFPoseJointMods[i].mod );
|
||||
savefile->WriteMat3( AFPoseJointMods[i].axis );
|
||||
savefile->WriteVec3( AFPoseJointMods[i].origin );
|
||||
}
|
||||
|
||||
|
||||
savefile->WriteInt( AFPoseJointFrame.Num() );
|
||||
for ( i = 0; i < AFPoseJointFrame.Num(); i++ ) {
|
||||
savefile->WriteFloat( AFPoseJointFrame[i].q.x );
|
||||
|
@ -3191,7 +3191,7 @@ void idAnimator::Save( idSaveGame *savefile ) const {
|
|||
savefile->WriteFloat( AFPoseJointFrame[i].q.w );
|
||||
savefile->WriteVec3( AFPoseJointFrame[i].t );
|
||||
}
|
||||
|
||||
|
||||
savefile->WriteBounds( AFPoseBounds );
|
||||
savefile->WriteInt( AFPoseTime );
|
||||
|
||||
|
@ -3229,7 +3229,7 @@ void idAnimator::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadInt( (int&)jointMods[ i ]->transform_pos );
|
||||
savefile->ReadInt( (int&)jointMods[ i ]->transform_axis );
|
||||
}
|
||||
|
||||
|
||||
savefile->ReadInt( numJoints );
|
||||
joints = (idJointMat *) Mem_Alloc16( numJoints * sizeof( joints[0] ) );
|
||||
for ( i = 0; i < numJoints; i++ ) {
|
||||
|
@ -3238,7 +3238,7 @@ void idAnimator::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadFloat( data[j] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
savefile->ReadInt( lastTransformTime );
|
||||
savefile->ReadBool( stoppedAnimatingUpdate );
|
||||
savefile->ReadBool( forceUpdate );
|
||||
|
@ -3252,7 +3252,7 @@ void idAnimator::Restore( idRestoreGame *savefile ) {
|
|||
for ( i = 0; i < AFPoseJoints.Num(); i++ ) {
|
||||
savefile->ReadInt( AFPoseJoints[i] );
|
||||
}
|
||||
|
||||
|
||||
savefile->ReadInt( num );
|
||||
AFPoseJointMods.SetGranularity( 1 );
|
||||
AFPoseJointMods.SetNum( num );
|
||||
|
@ -3261,7 +3261,7 @@ void idAnimator::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadMat3( AFPoseJointMods[i].axis );
|
||||
savefile->ReadVec3( AFPoseJointMods[i].origin );
|
||||
}
|
||||
|
||||
|
||||
savefile->ReadInt( num );
|
||||
AFPoseJointFrame.SetGranularity( 1 );
|
||||
AFPoseJointFrame.SetNum( num );
|
||||
|
@ -3272,7 +3272,7 @@ void idAnimator::Restore( idRestoreGame *savefile ) {
|
|||
savefile->ReadFloat( AFPoseJointFrame[i].q.w );
|
||||
savefile->ReadVec3( AFPoseJointFrame[i].t );
|
||||
}
|
||||
|
||||
|
||||
savefile->ReadBounds( AFPoseBounds );
|
||||
savefile->ReadInt( AFPoseTime );
|
||||
|
||||
|
@ -3356,7 +3356,7 @@ idRenderModel *idAnimator::SetModel( const char *modelname ) {
|
|||
if ( !modelDef ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
idRenderModel *renderModel = modelDef->ModelHandle();
|
||||
if ( !renderModel ) {
|
||||
modelDef = NULL;
|
||||
|
@ -3444,7 +3444,7 @@ int idAnimator::NumAnims( void ) const {
|
|||
if ( !modelDef ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return modelDef->NumAnims();
|
||||
}
|
||||
|
||||
|
@ -3457,7 +3457,7 @@ const idAnim *idAnimator::GetAnim( int index ) const {
|
|||
if ( !modelDef ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
return modelDef->GetAnim( index );
|
||||
}
|
||||
|
||||
|
@ -3470,7 +3470,7 @@ int idAnimator::GetAnim( const char *name ) const {
|
|||
if ( !modelDef ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
return modelDef->GetAnim( name );
|
||||
}
|
||||
|
||||
|
@ -3483,7 +3483,7 @@ bool idAnimator::HasAnim( const char *name ) const {
|
|||
if ( !modelDef ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return modelDef->HasAnim( name );
|
||||
}
|
||||
|
||||
|
@ -3505,7 +3505,7 @@ idRenderModel *idAnimator::ModelHandle( void ) const {
|
|||
if ( !modelDef ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
return modelDef->ModelHandle();
|
||||
}
|
||||
|
||||
|
@ -3585,7 +3585,7 @@ void idAnimator::CycleAnim( int channelNum, int animNum, int currentTime, int bl
|
|||
if ( !modelDef || !modelDef->GetAnim( animNum ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
PushAnims( channelNum, currentTime, blendTime );
|
||||
channels[ channelNum ][ 0 ].CycleAnim( modelDef, animNum, currentTime, blendTime );
|
||||
if ( entity ) {
|
||||
|
@ -3606,7 +3606,7 @@ void idAnimator::PlayAnim( int channelNum, int animNum, int currentTime, int ble
|
|||
if ( !modelDef || !modelDef->GetAnim( animNum ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
PushAnims( channelNum, currentTime, blendTime );
|
||||
channels[ channelNum ][ 0 ].PlayAnim( modelDef, animNum, currentTime, blendTime );
|
||||
if ( entity ) {
|
||||
|
@ -3634,7 +3634,7 @@ void idAnimator::SyncAnimChannels( int channelNum, int fromChannelNum, int curre
|
|||
toBlend.blendStartValue = 0.0f;
|
||||
toBlend.blendEndValue = 0.0f;
|
||||
}
|
||||
toBlend.SetWeight( weight, currentTime - 1, blendTime );
|
||||
toBlend.SetWeight( weight, currentTime - 1, blendTime );
|
||||
|
||||
// disable framecommands on the current channel so that commands aren't called twice
|
||||
toBlend.AllowFrameCommands( false );
|
||||
|
@ -3987,7 +3987,7 @@ void idAnimator::FinishAFPose( int animNum, const idBounds &bounds, const int ti
|
|||
if ( !modelDef ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const idAnim *anim = modelDef->GetAnim( animNum );
|
||||
if ( !anim ) {
|
||||
return;
|
||||
|
@ -4290,7 +4290,7 @@ bool idAnimator::CreateFrame( int currentTime, bool force ) {
|
|||
if ( entity && ( ( g_debugAnim.GetInteger() == entity->entityNumber ) || ( g_debugAnim.GetInteger() == -2 ) ) ) {
|
||||
debugInfo = true;
|
||||
gameLocal.Printf( "---------------\n%d: entity '%s':\n", gameLocal.time, entity->GetName() );
|
||||
gameLocal.Printf( "model '%s':\n", modelDef->GetModelName() );
|
||||
gameLocal.Printf( "model '%s':\n", modelDef->GetModelName() );
|
||||
} else {
|
||||
debugInfo = false;
|
||||
}
|
||||
|
@ -4393,7 +4393,7 @@ bool idAnimator::CreateFrame( int currentTime, bool force ) {
|
|||
case JOINTMOD_LOCAL:
|
||||
joints[0].SetRotation( jointMod->mat * joints[0].ToMat3() );
|
||||
break;
|
||||
|
||||
|
||||
case JOINTMOD_WORLD:
|
||||
joints[0].SetRotation( joints[0].ToMat3() * jointMod->mat );
|
||||
break;
|
||||
|
@ -4411,7 +4411,7 @@ bool idAnimator::CreateFrame( int currentTime, bool force ) {
|
|||
case JOINTMOD_LOCAL:
|
||||
joints[0].SetTranslation( joints[0].ToVec3() + jointMod->pos );
|
||||
break;
|
||||
|
||||
|
||||
case JOINTMOD_LOCAL_OVERRIDE:
|
||||
case JOINTMOD_WORLD:
|
||||
case JOINTMOD_WORLD_OVERRIDE:
|
||||
|
@ -4448,7 +4448,7 @@ bool idAnimator::CreateFrame( int currentTime, bool force ) {
|
|||
case JOINTMOD_LOCAL:
|
||||
joints[i].SetRotation( jointMod->mat * ( joints[i].ToMat3() * joints[parentNum].ToMat3() ) );
|
||||
break;
|
||||
|
||||
|
||||
case JOINTMOD_LOCAL_OVERRIDE:
|
||||
joints[i].SetRotation( jointMod->mat * joints[parentNum].ToMat3() );
|
||||
break;
|
||||
|
@ -4471,7 +4471,7 @@ bool idAnimator::CreateFrame( int currentTime, bool force ) {
|
|||
case JOINTMOD_LOCAL:
|
||||
joints[i].SetTranslation( joints[parentNum].ToVec3() + ( joints[i].ToVec3() + jointMod->pos ) * joints[parentNum].ToMat3() );
|
||||
break;
|
||||
|
||||
|
||||
case JOINTMOD_LOCAL_OVERRIDE:
|
||||
joints[i].SetTranslation( joints[parentNum].ToVec3() + jointMod->pos * joints[parentNum].ToMat3() );
|
||||
break;
|
||||
|
@ -5039,7 +5039,7 @@ idRenderModel *idGameEdit::ANIM_CreateMeshForAnim( idRenderModel *model, const c
|
|||
const idDict *args;
|
||||
const char *temp;
|
||||
idRenderModel *newmodel;
|
||||
const idMD5Anim *md5anim;
|
||||
const idMD5Anim *md5anim;
|
||||
idStr filename;
|
||||
idStr extension;
|
||||
const idAnim *anim;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -140,7 +140,7 @@ void idModelExport::LoadMayaDll( void ) {
|
|||
}
|
||||
|
||||
// look up the dll interface functions
|
||||
dllEntry = ( exporterDLLEntry_t )sys->DLL_GetProcAddress( importDLL, "dllEntry" );
|
||||
dllEntry = ( exporterDLLEntry_t )sys->DLL_GetProcAddress( importDLL, "dllEntry" );
|
||||
Maya_ConvertModel = ( exporterInterface_t )sys->DLL_GetProcAddress( importDLL, "Maya_ConvertModel" );
|
||||
Maya_Shutdown = ( exporterShutdown_t )sys->DLL_GetProcAddress( importDLL, "Maya_Shutdown" );
|
||||
if ( !Maya_ConvertModel || !dllEntry || !Maya_Shutdown ) {
|
||||
|
@ -168,7 +168,7 @@ void idModelExport::LoadMayaDll( void ) {
|
|||
=====================
|
||||
idModelExport::ConvertMayaToMD5
|
||||
|
||||
Checks if a Maya model should be converted to an MD5, and converts if if the time/date or
|
||||
Checks if a Maya model should be converted to an MD5, and converts if if the time/date or
|
||||
version number has changed.
|
||||
=====================
|
||||
*/
|
||||
|
@ -256,7 +256,7 @@ bool idModelExport::ConvertMayaToMD5( void ) {
|
|||
if ( Maya_Error != "Ok" ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// conversion succeded
|
||||
return true;
|
||||
}
|
||||
|
@ -415,7 +415,7 @@ int idModelExport::ParseExportSection( idParser &parser ) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
parser.ReadToken( &token );
|
||||
parser.ReadToken( &token );
|
||||
if ( token.Icmp( g_exportMask.GetString() ) ) {
|
||||
parser.SkipBracedSection();
|
||||
return 0;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -32,7 +32,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
Model viewing can begin with either "testmodel <modelname>"
|
||||
|
||||
The names must be the full pathname after the basedir, like
|
||||
The names must be the full pathname after the basedir, like
|
||||
"models/weapons/v_launch/tris.md3" or "players/male/tris.md3"
|
||||
|
||||
Extension will default to ".ase" if not specified.
|
||||
|
@ -55,7 +55,7 @@ move around it to view it from different angles.
|
|||
|
||||
CLASS_DECLARATION( idAnimatedEntity, idTestModel )
|
||||
EVENT( EV_FootstepLeft, idTestModel::Event_Footstep )
|
||||
EVENT( EV_FootstepRight, idTestModel::Event_Footstep )
|
||||
EVENT( EV_FootstepRight, idTestModel::Event_Footstep )
|
||||
END_CLASS
|
||||
|
||||
/*
|
||||
|
@ -120,7 +120,7 @@ void idTestModel::Spawn( void ) {
|
|||
physicsObj.SetSelf( this );
|
||||
physicsObj.SetOrigin( GetPhysics()->GetOrigin() );
|
||||
physicsObj.SetAxis( GetPhysics()->GetAxis() );
|
||||
|
||||
|
||||
if ( spawnArgs.GetVector( "mins", NULL, bounds[0] ) ) {
|
||||
spawnArgs.GetVector( "maxs", NULL, bounds[1] );
|
||||
physicsObj.SetClipBox( bounds, 1.0f );
|
||||
|
@ -157,7 +157,7 @@ void idTestModel::Spawn( void ) {
|
|||
head.GetEntity()->SetOrigin( origin );
|
||||
head.GetEntity()->SetAxis( GetPhysics()->GetAxis() );
|
||||
head.GetEntity()->BindToJoint( this, animator.GetJointName( joint ), true );
|
||||
|
||||
|
||||
headAnimator = head.GetEntity()->GetAnimator();
|
||||
|
||||
// set up the list of joints to copy to the head
|
||||
|
@ -324,7 +324,7 @@ void idTestModel::Think( void ) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
mode = g_testModelAnimate.GetInteger();
|
||||
}
|
||||
|
||||
|
@ -414,7 +414,7 @@ void idTestModel::NextAnim( const idCmdArgs &args ) {
|
|||
headAnim = 0;
|
||||
if ( headAnimator ) {
|
||||
headAnimator->ClearAllAnims( gameLocal.time, 0 );
|
||||
headAnim = headAnimator->GetAnim( animname );
|
||||
headAnim = headAnimator->GetAnim( animname );
|
||||
if ( !headAnim ) {
|
||||
headAnim = headAnimator->GetAnim( "idle" );
|
||||
}
|
||||
|
@ -456,7 +456,7 @@ void idTestModel::PrevAnim( const idCmdArgs &args ) {
|
|||
headAnim = 0;
|
||||
if ( headAnimator ) {
|
||||
headAnimator->ClearAllAnims( gameLocal.time, 0 );
|
||||
headAnim = headAnimator->GetAnim( animname );
|
||||
headAnim = headAnimator->GetAnim( animname );
|
||||
if ( !headAnim ) {
|
||||
headAnim = headAnimator->GetAnim( "idle" );
|
||||
}
|
||||
|
@ -565,7 +565,7 @@ void idTestModel::TestAnim( const idCmdArgs &args ) {
|
|||
headAnim = 0;
|
||||
if ( headAnimator ) {
|
||||
headAnimator->ClearAllAnims( gameLocal.time, 0 );
|
||||
headAnim = headAnimator->GetAnim( animname );
|
||||
headAnim = headAnimator->GetAnim( animname );
|
||||
if ( !headAnim ) {
|
||||
headAnim = headAnimator->GetAnim( "idle" );
|
||||
if ( !headAnim ) {
|
||||
|
@ -766,8 +766,8 @@ void idTestModel::TestModel_f( const idCmdArgs &args ) {
|
|||
// without appending an ase
|
||||
if ( name[ 0 ] != '_' ) {
|
||||
name.DefaultFileExtension( ".ase" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#ifndef _D3XP
|
||||
// Maya ascii format is supported natively now
|
||||
if ( strstr( name, ".ma" ) || strstr( name, ".mb" ) ) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -58,19 +58,19 @@ public:
|
|||
void TestAnim( const idCmdArgs &args );
|
||||
void BlendAnim( const idCmdArgs &args );
|
||||
|
||||
static void KeepTestModel_f( const idCmdArgs &args );
|
||||
static void TestModel_f( const idCmdArgs &args );
|
||||
static void KeepTestModel_f( const idCmdArgs &args );
|
||||
static void TestModel_f( const idCmdArgs &args );
|
||||
static void ArgCompletion_TestModel( const idCmdArgs &args, void(*callback)( const char *s ) );
|
||||
static void TestSkin_f( const idCmdArgs &args );
|
||||
static void TestShaderParm_f( const idCmdArgs &args );
|
||||
static void TestParticleStopTime_f( const idCmdArgs &args );
|
||||
static void TestAnim_f( const idCmdArgs &args );
|
||||
static void TestSkin_f( const idCmdArgs &args );
|
||||
static void TestShaderParm_f( const idCmdArgs &args );
|
||||
static void TestParticleStopTime_f( const idCmdArgs &args );
|
||||
static void TestAnim_f( const idCmdArgs &args );
|
||||
static void ArgCompletion_TestAnim( const idCmdArgs &args, void(*callback)( const char *s ) );
|
||||
static void TestBlend_f( const idCmdArgs &args );
|
||||
static void TestModelNextAnim_f( const idCmdArgs &args );
|
||||
static void TestModelPrevAnim_f( const idCmdArgs &args );
|
||||
static void TestModelNextFrame_f( const idCmdArgs &args );
|
||||
static void TestModelPrevFrame_f( const idCmdArgs &args );
|
||||
static void TestBlend_f( const idCmdArgs &args );
|
||||
static void TestModelNextAnim_f( const idCmdArgs &args );
|
||||
static void TestModelPrevAnim_f( const idCmdArgs &args );
|
||||
static void TestModelNextFrame_f( const idCmdArgs &args );
|
||||
static void TestModelPrevFrame_f( const idCmdArgs &args );
|
||||
|
||||
private:
|
||||
idEntityPtr<idEntity> head;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -2623,4 +2623,3 @@ If you have questions concerning this license or the applicable additional terms
|
|||
typedef void ( idClass::*eventCallback_ffffffff_t )( const float, const float, const float, const float, const float, const float, const float, const float );
|
||||
( this->*( eventCallback_ffffffff_t )callback )( *( float * )&data[ 0 ], *( float * )&data[ 1 ], *( float * )&data[ 2 ], *( float * )&data[ 3 ], *( float * )&data[ 4 ], *( float * )&data[ 5 ], *( float * )&data[ 6 ], *( float * )&data[ 7 ] );
|
||||
break;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -62,7 +62,7 @@ initialized in any order, the constructor must handle the case that subclasses
|
|||
are initialized before superclasses.
|
||||
================
|
||||
*/
|
||||
idTypeInfo::idTypeInfo( const char *classname, const char *superclass, idEventFunc<idClass> *eventCallbacks, idClass *( *CreateInstance )( void ),
|
||||
idTypeInfo::idTypeInfo( const char *classname, const char *superclass, idEventFunc<idClass> *eventCallbacks, idClass *( *CreateInstance )( void ),
|
||||
void ( idClass::*Spawn )( void ), void ( idClass::*Save )( idSaveGame *savefile ) const, void ( idClass::*Restore )( idRestoreGame *savefile ) ) {
|
||||
|
||||
idTypeInfo *type;
|
||||
|
@ -83,7 +83,7 @@ idTypeInfo::idTypeInfo( const char *classname, const char *superclass, idEventFu
|
|||
|
||||
// Check if any subclasses were initialized before their superclass
|
||||
for( type = typelist; type != NULL; type = type->next ) {
|
||||
if ( ( type->super == NULL ) && !idStr::Cmp( type->superclass, this->classname ) &&
|
||||
if ( ( type->super == NULL ) && !idStr::Cmp( type->superclass, this->classname ) &&
|
||||
idStr::Cmp( type->classname, "idClass" ) ) {
|
||||
type->super = this;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ idTypeInfo::~idTypeInfo() {
|
|||
================
|
||||
idTypeInfo::Init
|
||||
|
||||
Initializes the event callback table for the class. Creates a
|
||||
Initializes the event callback table for the class. Creates a
|
||||
table for fast lookups of event functions. Should only be called once.
|
||||
================
|
||||
*/
|
||||
|
@ -203,7 +203,7 @@ void idTypeInfo::Init( void ) {
|
|||
idTypeInfo::Shutdown
|
||||
|
||||
Should only be called when DLL or EXE is being shutdown.
|
||||
Although it cleans up any allocated memory, it doesn't bother to remove itself
|
||||
Although it cleans up any allocated memory, it doesn't bother to remove itself
|
||||
from the class list since the program is shutting down.
|
||||
================
|
||||
*/
|
||||
|
@ -394,7 +394,7 @@ void idClass::Init( void ) {
|
|||
// is a subclass of another
|
||||
num = 0;
|
||||
for( c = classHierarchy.GetNext(); c != NULL; c = c->node.GetNext(), num++ ) {
|
||||
c->typeNum = num;
|
||||
c->typeNum = num;
|
||||
c->lastChild += num;
|
||||
}
|
||||
|
||||
|
@ -504,7 +504,7 @@ void idClass::operator delete( void *ptr ) {
|
|||
p = ( ( int * )ptr ) - 1;
|
||||
memused -= *p;
|
||||
numobjects--;
|
||||
Mem_Free( p );
|
||||
Mem_Free( p );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -515,7 +515,7 @@ void idClass::operator delete( void *ptr, int, int, char *, int ) {
|
|||
p = ( ( int * )ptr ) - 1;
|
||||
memused -= *p;
|
||||
numobjects--;
|
||||
Mem_Free( p );
|
||||
Mem_Free( p );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -629,9 +629,9 @@ bool idClass::PostEventArgs( const idEventDef *ev, int time, int numargs, ... )
|
|||
idTypeInfo *c;
|
||||
idEvent *event;
|
||||
va_list args;
|
||||
|
||||
|
||||
assert( ev );
|
||||
|
||||
|
||||
if ( !idEvent::initialized ) {
|
||||
return false;
|
||||
}
|
||||
|
@ -830,7 +830,7 @@ bool idClass::ProcessEventArgs( const idEventDef *ev, int numargs, ... ) {
|
|||
int num;
|
||||
int data[ D_EVENT_MAXARGS ];
|
||||
va_list args;
|
||||
|
||||
|
||||
assert( ev );
|
||||
assert( idEvent::initialized );
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -102,7 +102,7 @@ CLASS_DECLARATION
|
|||
|
||||
This macro must be included in the code to properly initialize variables
|
||||
used in type checking and run-time instanciation. It also defines the list
|
||||
of events that the class responds to. Take special care to ensure that the
|
||||
of events that the class responds to. Take special care to ensure that the
|
||||
proper superclass is indicated or the run-time type information will be
|
||||
incorrect. Use this on concrete classes only.
|
||||
================
|
||||
|
@ -287,7 +287,7 @@ public:
|
|||
|
||||
idHierarchy<idTypeInfo> node;
|
||||
|
||||
idTypeInfo( const char *classname, const char *superclass,
|
||||
idTypeInfo( const char *classname, const char *superclass,
|
||||
idEventFunc<idClass> *eventCallbacks, idClass *( *CreateInstance )( void ), void ( idClass::*Spawn )( void ),
|
||||
void ( idClass::*Save )( idSaveGame *savefile ) const, void ( idClass::*Restore )( idRestoreGame *savefile ) );
|
||||
~idTypeInfo();
|
||||
|
@ -303,7 +303,7 @@ public:
|
|||
================
|
||||
idTypeInfo::IsType
|
||||
|
||||
Checks if the object's class is a subclass of the class defined by the
|
||||
Checks if the object's class is a subclass of the class defined by the
|
||||
passed in idTypeInfo.
|
||||
================
|
||||
*/
|
||||
|
@ -330,7 +330,7 @@ ID_INLINE bool idTypeInfo::RespondsTo( const idEventDef &ev ) const {
|
|||
================
|
||||
idClass::IsType
|
||||
|
||||
Checks if the object's class is a subclass of the class defined by the
|
||||
Checks if the object's class is a subclass of the class defined by the
|
||||
passed in idTypeInfo.
|
||||
================
|
||||
*/
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -476,8 +476,8 @@ void idEvent::ClearEventList( void ) {
|
|||
//
|
||||
FreeEvents.Clear();
|
||||
EventQueue.Clear();
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
// add the events to the free list
|
||||
//
|
||||
for( i = 0; i < MAX_EVENTS; i++ ) {
|
||||
|
@ -733,7 +733,7 @@ void idEvent::Shutdown( void ) {
|
|||
}
|
||||
|
||||
ClearEventList();
|
||||
|
||||
|
||||
eventDataAllocator.Shutdown();
|
||||
|
||||
// say it is now shutdown
|
||||
|
@ -962,7 +962,7 @@ void idEvent::Restore( idRestoreGame *savefile ) {
|
|||
/*
|
||||
================
|
||||
idEvent::ReadTrace
|
||||
|
||||
|
||||
idRestoreGame has a ReadTrace procedure, but unfortunately idEvent wants the material
|
||||
string name at the of the data structure rather than in the middle
|
||||
================
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -67,7 +67,7 @@ private:
|
|||
|
||||
public:
|
||||
idEventDef( const char *command, const char *formatspec = NULL, char returnType = 0 );
|
||||
|
||||
|
||||
const char *GetName( void ) const;
|
||||
const char *GetArgFormat( void ) const;
|
||||
unsigned int GetFormatspecIndex( void ) const;
|
||||
|
@ -105,7 +105,7 @@ public:
|
|||
|
||||
static idEvent *Alloc( const idEventDef *evdef, int numargs, va_list args );
|
||||
static void CopyArgs( const idEventDef *evdef, int numargs, va_list args, int data[ D_EVENT_MAXARGS ] );
|
||||
|
||||
|
||||
void Free( void );
|
||||
void Schedule( idClass *object, const idTypeInfo *cls, int time );
|
||||
byte *GetData( void );
|
||||
|
@ -124,7 +124,7 @@ public:
|
|||
static void Restore( idRestoreGame *savefile ); // unarchives object from save game file
|
||||
static void SaveTrace( idSaveGame *savefile, const trace_t &trace );
|
||||
static void RestoreTrace( idRestoreGame *savefile, trace_t &trace );
|
||||
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -36,7 +36,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
/*
|
||||
Save game related helper classes.
|
||||
|
||||
Save games are implemented in two classes, idSaveGame and idRestoreGame, that implement write/read functions for
|
||||
Save games are implemented in two classes, idSaveGame and idRestoreGame, that implement write/read functions for
|
||||
common types. They're passed in to each entity and object for them to archive themselves. Each class
|
||||
implements save/restore functions for it's own data. When restoring, all the objects are instantiated,
|
||||
then the restore function is called on each, superclass first, then subclasses.
|
||||
|
@ -138,7 +138,7 @@ void idSaveGame::CallSave_r( const idTypeInfo *cls, const idClass *obj ) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
( obj->*cls->Save )( this );
|
||||
}
|
||||
|
||||
|
@ -227,13 +227,13 @@ void idSaveGame::WriteBool( const bool value ) {
|
|||
================
|
||||
idSaveGame::WriteString
|
||||
================
|
||||
*/
|
||||
*/
|
||||
void idSaveGame::WriteString( const char *string ) {
|
||||
int len;
|
||||
|
||||
len = strlen( string );
|
||||
WriteInt( len );
|
||||
file->Write( string, len );
|
||||
file->Write( string, len );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -705,7 +705,7 @@ void idSaveGame::WriteTrace( const trace_t &trace ) {
|
|||
*/
|
||||
void idSaveGame::WriteTraceModel( const idTraceModel &trace ) {
|
||||
int j, k;
|
||||
|
||||
|
||||
WriteInt( (int&)trace.type );
|
||||
WriteInt( trace.numVerts );
|
||||
for ( j = 0; j < MAX_TRACEMODEL_VERTS; j++ ) {
|
||||
|
@ -771,7 +771,7 @@ void idSaveGame::WriteBuildNumber( const int value ) {
|
|||
/***********************************************************************
|
||||
|
||||
idRestoreGame
|
||||
|
||||
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
|
@ -901,7 +901,7 @@ void idRestoreGame::CallRestore_r( const idTypeInfo *cls, idClass *obj ) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
( obj->*cls->Restore )( this );
|
||||
}
|
||||
|
||||
|
@ -1481,7 +1481,7 @@ void idRestoreGame::ReadTrace( trace_t &trace ) {
|
|||
*/
|
||||
void idRestoreGame::ReadTraceModel( idTraceModel &trace ) {
|
||||
int j, k;
|
||||
|
||||
|
||||
ReadInt( (int&)trace.type );
|
||||
ReadInt( trace.numVerts );
|
||||
for ( j = 0; j < MAX_TRACEMODEL_VERTS; j++ ) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -623,22 +623,22 @@ static void Cmd_Say( bool team, const idCmdArgs &args ) {
|
|||
}
|
||||
|
||||
#ifdef CTF
|
||||
// Append the player's location to team chat messages in CTF
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && team && player ) {
|
||||
idLocationEntity *locationEntity = gameLocal.LocationForPoint( player->GetEyePosition() );
|
||||
|
||||
if ( locationEntity ) {
|
||||
idStr temp = "[";
|
||||
temp += locationEntity->GetLocation();
|
||||
temp += "] ";
|
||||
temp += text;
|
||||
text = temp;
|
||||
}
|
||||
|
||||
}
|
||||
// Append the player's location to team chat messages in CTF
|
||||
if ( gameLocal.mpGame.IsGametypeFlagBased() && team && player ) {
|
||||
idLocationEntity *locationEntity = gameLocal.LocationForPoint( player->GetEyePosition() );
|
||||
|
||||
if ( locationEntity ) {
|
||||
idStr temp = "[";
|
||||
temp += locationEntity->GetLocation();
|
||||
temp += "] ";
|
||||
temp += text;
|
||||
text = temp;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
name = "server";
|
||||
}
|
||||
|
@ -2119,7 +2119,7 @@ static void Cmd_CloseViewNotes_f( const idCmdArgs &args ) {
|
|||
if ( !player ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
player->hud->SetStateString( "viewcomments", "" );
|
||||
player->hud->HandleNamedEvent( "hideViewComments" );
|
||||
}
|
||||
|
@ -2159,7 +2159,7 @@ static void Cmd_ShowViewNotes_f( const idCmdArgs &args ) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( parser.ExpectTokenString( "view" ) && parser.Parse1DMatrix( 3, origin.ToFloatPtr() ) &&
|
||||
if ( parser.ExpectTokenString( "view" ) && parser.Parse1DMatrix( 3, origin.ToFloatPtr() ) &&
|
||||
parser.Parse1DMatrix( 9, axis.ToFloatPtr() ) && parser.ExpectTokenString( "comments" ) && parser.ReadToken( &token ) ) {
|
||||
player->hud->SetStateString( "viewcomments", token );
|
||||
player->hud->HandleNamedEvent( "showViewComments" );
|
||||
|
@ -2274,7 +2274,7 @@ void Cmd_NextGUI_f( const idCmdArgs &args ) {
|
|||
if ( ent->spawnArgs.GetString( "gui", NULL ) != NULL ) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ( ent->spawnArgs.GetString( "gui2", NULL ) != NULL ) {
|
||||
break;
|
||||
}
|
||||
|
@ -2282,7 +2282,7 @@ void Cmd_NextGUI_f( const idCmdArgs &args ) {
|
|||
if ( ent->spawnArgs.GetString( "gui3", NULL ) != NULL ) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// try the next entity
|
||||
gameLocal.lastGUIEnt = ent;
|
||||
}
|
||||
|
@ -2317,7 +2317,7 @@ void Cmd_NextGUI_f( const idCmdArgs &args ) {
|
|||
|
||||
assert( geom->facePlanes != NULL );
|
||||
|
||||
modelMatrix = idMat4( renderEnt->axis, renderEnt->origin );
|
||||
modelMatrix = idMat4( renderEnt->axis, renderEnt->origin );
|
||||
normal = geom->facePlanes[ 0 ].Normal() * renderEnt->axis;
|
||||
center = geom->bounds.GetCenter() * modelMatrix;
|
||||
|
||||
|
@ -2346,7 +2346,7 @@ void Cmd_SetActorState_f( const idCmdArgs &args ) {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!ent->IsType(idActor::Type)) {
|
||||
gameLocal.Printf( "entity not an actor\n" );
|
||||
return;
|
||||
|
@ -2381,7 +2381,7 @@ void Cmd_TestId_f( const idCmdArgs &args ) {
|
|||
if ( idStr::Cmpn( id, STRTABLE_ID, STRTABLE_ID_LENGTH ) != 0 ) {
|
||||
id = STRTABLE_ID + id;
|
||||
}
|
||||
gameLocal.mpGame.AddChatLine( common->GetLanguageDict()->GetString( id ), "<nothing>", "<nothing>", "<nothing>" );
|
||||
gameLocal.mpGame.AddChatLine( common->GetLanguageDict()->GetString( id ), "<nothing>", "<nothing>", "<nothing>" );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -49,7 +49,7 @@ const char *si_gameTypeArgs[] = { "singleplayer", "deathmatch", "Tourney", "Tea
|
|||
const char *si_gameTypeArgs[] = { "singleplayer", "deathmatch", "Tourney", "Team DM", "Last Man", NULL };
|
||||
#endif
|
||||
|
||||
const char *si_readyArgs[] = { "Not Ready", "Ready", NULL };
|
||||
const char *si_readyArgs[] = { "Not Ready", "Ready", NULL };
|
||||
const char *si_spectateArgs[] = { "Play", "Spectate", NULL };
|
||||
|
||||
#ifdef _D3XP
|
||||
|
@ -58,7 +58,7 @@ const char *ui_skinArgs[] = { "skins/characters/player/marine_mp", "skins/char
|
|||
const char *ui_skinArgs[] = { "skins/characters/player/marine_mp", "skins/characters/player/marine_mp_red", "skins/characters/player/marine_mp_blue", "skins/characters/player/marine_mp_green", "skins/characters/player/marine_mp_yellow", NULL };
|
||||
#endif
|
||||
|
||||
const char *ui_teamArgs[] = { "Red", "Blue", NULL };
|
||||
const char *ui_teamArgs[] = { "Red", "Blue", NULL };
|
||||
|
||||
struct gameVersion_s {
|
||||
gameVersion_s( void ) { sprintf( string, "%s.%d%s %s %s", ENGINE_VERSION, BUILD_NUMBER, BUILD_DEBUG, BUILD_STRING, __DATE__, __TIME__ ); }
|
||||
|
@ -101,7 +101,7 @@ idCVar si_midnight( "si_midnight", "0",
|
|||
// user info
|
||||
idCVar ui_name( "ui_name", "Player", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE, "player name" );
|
||||
idCVar ui_skin( "ui_skin", ui_skinArgs[ 0 ], CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE, "player skin", ui_skinArgs, idCmdSystem::ArgCompletion_String<ui_skinArgs> );
|
||||
idCVar ui_team( "ui_team", ui_teamArgs[ 0 ], CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE, "player team", ui_teamArgs, idCmdSystem::ArgCompletion_String<ui_teamArgs> );
|
||||
idCVar ui_team( "ui_team", ui_teamArgs[ 0 ], CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE, "player team", ui_teamArgs, idCmdSystem::ArgCompletion_String<ui_teamArgs> );
|
||||
idCVar ui_autoSwitch( "ui_autoSwitch", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "auto switch weapon" );
|
||||
idCVar ui_autoReload( "ui_autoReload", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "auto reload weapon" );
|
||||
idCVar ui_showGun( "ui_showGun", "1", CVAR_GAME | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "show gun" );
|
||||
|
@ -112,7 +112,7 @@ idCVar ui_chat( "ui_chat", "0", CVAR_GAME | CVAR_USERINFO | CVAR_BOOL
|
|||
// change anytime vars
|
||||
idCVar developer( "developer", "0", CVAR_GAME | CVAR_BOOL, "" );
|
||||
|
||||
idCVar r_aspectRatio( "r_aspectRatio", "0", CVAR_RENDERER | CVAR_INTEGER | CVAR_ARCHIVE, "aspect ratio of view:\n0 = 4:3\n1 = 16:9\n2 = 16:10", 0, 2 );
|
||||
idCVar r_aspectRatio( "r_aspectRatio", "0", CVAR_RENDERER | CVAR_INTEGER | CVAR_ARCHIVE, "aspect ratio of view:\n0 = 4:3\n1 = 16:9\n2 = 16:10", 0, 2 );
|
||||
|
||||
idCVar g_cinematic( "g_cinematic", "1", CVAR_GAME | CVAR_BOOL, "skips updating entities that aren't marked 'cinematic' '1' during cinematics" );
|
||||
idCVar g_cinematicMaxSkipTime( "g_cinematicMaxSkipTime", "600", CVAR_GAME | CVAR_FLOAT, "# of seconds to allow game to run when skipping cinematic. prevents lock-up when cinematic doesn't end.", 0, 3600 );
|
||||
|
@ -225,7 +225,7 @@ idCVar g_dragShowSelection( "g_dragShowSelection", "0", CVAR_GAME | CVAR_BO
|
|||
idCVar g_dropItemRotation( "g_dropItemRotation", "", CVAR_GAME, "" );
|
||||
|
||||
#ifdef CTF
|
||||
// Note: These cvars do not necessarily need to be in the shipping game.
|
||||
// Note: These cvars do not necessarily need to be in the shipping game.
|
||||
idCVar g_flagAttachJoint( "g_flagAttachJoint", "Chest", CVAR_GAME | CVAR_CHEAT, "player joint to attach CTF flag to" );
|
||||
idCVar g_flagAttachOffsetX( "g_flagAttachOffsetX", "8", CVAR_GAME | CVAR_CHEAT, "X offset of CTF flag when carried" );
|
||||
idCVar g_flagAttachOffsetY( "g_flagAttachOffsetY", "4", CVAR_GAME | CVAR_CHEAT, "Y offset of CTF flag when carried" );
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
@ -72,7 +72,7 @@ idBlockAlloc<clipLink_t, 1024> clipLinkAllocator;
|
|||
|
||||
static idList<trmCache_s*> traceModelCache;
|
||||
static idHashIndex traceModelHash;
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
idClipModel::ClearTraceModelCache
|
||||
|
@ -162,7 +162,7 @@ void idClipModel::SaveTraceModels( idSaveGame *savefile ) {
|
|||
savefile->WriteInt( traceModelCache.Num() );
|
||||
for ( i = 0; i < traceModelCache.Num(); i++ ) {
|
||||
trmCache_t *entry = traceModelCache[i];
|
||||
|
||||
|
||||
savefile->WriteTraceModel( entry->trm );
|
||||
savefile->WriteFloat( entry->volume );
|
||||
savefile->WriteVec3( entry->centerOfMass );
|
||||
|
@ -185,7 +185,7 @@ void idClipModel::RestoreTraceModels( idRestoreGame *savefile ) {
|
|||
|
||||
for ( i = 0; i < num; i++ ) {
|
||||
trmCache_t *entry = new trmCache_t;
|
||||
|
||||
|
||||
savefile->ReadTraceModel( entry->trm );
|
||||
|
||||
savefile->ReadFloat( entry->volume );
|
||||
|
@ -667,9 +667,9 @@ clipSector_t *idClip::CreateClipSectors_r( const int depth, const idBounds &boun
|
|||
|
||||
front = bounds;
|
||||
back = bounds;
|
||||
|
||||
|
||||
front[0][anode->axis] = back[1][anode->axis] = anode->dist;
|
||||
|
||||
|
||||
anode->children[0] = CreateClipSectors_r( depth+1, front, maxSector );
|
||||
anode->children[1] = CreateClipSectors_r( depth+1, back, maxSector );
|
||||
|
||||
|
@ -967,7 +967,7 @@ ID_INLINE bool TestHugeTranslation( trace_t &results, const idClipModel *mdl, co
|
|||
// May be important: This occurs in CTF when a player connects and spawns
|
||||
// in the PVS of a player that has a flag that is spawning the idMoveableItem
|
||||
// "nuggets". The error seems benign and the assert was getting in the way
|
||||
// of testing.
|
||||
// of testing.
|
||||
assert( 0 );
|
||||
#endif
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
===========================================================================
|
||||
|
||||
Doom 3 GPL Source Code
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
|
||||
|
||||
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue