diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_buildable.c | 22 | ||||
-rw-r--r-- | src/cgame/cg_ents.c | 7 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 4 |
3 files changed, 22 insertions, 11 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index dd008dee..d788657d 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -220,19 +220,22 @@ static void CG_Creep( centity_t *cent ) trace_t tr, tr2; vec3_t temp, origin, p1, p2; int scaleUpTime = BG_FindBuildTimeForBuildable( cent->currentState.modelindex ); + int time; + + time = cent->currentState.time; //should the creep be growing or receding? - if( cent->miscTime >= 0 ) + if( time >= 0 ) { - msec = cg.time - cent->miscTime; + msec = cg.time - time; if( msec >= 0 && msec < scaleUpTime ) frac = (float)msec / scaleUpTime; else frac = 1.0f; } - else if( cent->miscTime < 0 ) + else if( time < 0 ) { - msec = cg.time + cent->miscTime; + msec = cg.time + time; if( msec >= 0 && msec < CREEP_SCALEDOWN_TIME ) frac = 1.0f - ( (float)msec / CREEP_SCALEDOWN_TIME ); else @@ -984,8 +987,15 @@ void CG_Buildable( centity_t *cent ) ent.nonNormalizedAxes = qfalse; - if( team == BIT_HUMANS && !( es->generic1 & B_SPAWNED_TOGGLEBIT ) ) - ent.customShader = cgs.media.humanSpawningShader; + if( !( es->generic1 & B_SPAWNED_TOGGLEBIT ) ) + { + if( team == BIT_HUMANS ) + { + ent.customShader = cgs.media.humanSpawningShader; + } + + /*trap_S_AddLoopingSound*/ + } CG_BuildableAnimation( cent, &ent.oldframe, &ent.frame, &ent.backlerp ); diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index c4b7ecc9..1d6d5733 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -878,13 +878,14 @@ static void CG_CEntityPVSEnter( centity_t *cent ) //clear any particle systems from previous uses of this centity_t cent->muzzlePS = NULL; cent->muzzlePsTrigger = qfalse; - cent->jetPackPS = NULL; cent->jetPackState = JPS_OFF; - cent->buildablePS = NULL; - cent->entityPS = NULL; + + //make sure that the buildable animations are in a consistent state + //when a buildable enters the PVS + cent->buildableAnim = BANIM_NONE; } diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 3e512204..3157b660 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -654,12 +654,12 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_BUILD_CONSTRUCT: DEBUGNAME( "EV_BUILD_CONSTRUCT" ); - cent->miscTime = cg.time; // scale up from this + //do something useful here break; case EV_BUILD_DESTROY: DEBUGNAME( "EV_BUILD_DESTROY" ); - cent->miscTime = -cg.time; // scale down from this + //do something useful here break; case EV_RPTUSE_SOUND: |