diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cgame/cg_buildable.c | 116 | ||||
| -rw-r--r-- | src/cgame/cg_event.c | 21 | ||||
| -rw-r--r-- | src/cgame/cg_local.h | 2 | ||||
| -rw-r--r-- | src/game/bg_misc.c | 64 | ||||
| -rw-r--r-- | src/game/bg_public.h | 38 | ||||
| -rw-r--r-- | src/game/g_buildable.c | 37 | ||||
| -rw-r--r-- | src/game/g_client.c | 3 | ||||
| -rw-r--r-- | src/game/g_local.h | 1 | 
8 files changed, 171 insertions, 111 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 9a63b477..097dea43 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -69,7 +69,7 @@ static qboolean CG_ParseBuildableAnimationFile( const char *filename, buildable_    skip = 0; // quite the compiler warning    // read information for each frame -  for ( i = 0; i < MAX_BUILDABLE_ANIMATIONS; i++ ) +  for ( i = BANIM_NONE + 1; i < MAX_BUILDABLE_ANIMATIONS; i++ )    {      token = COM_Parse( &text_p ); @@ -159,7 +159,11 @@ static void CG_SetBuildableLerpFrameAnimation( buildable_t buildable, lerpFrame_      CG_Error( "Bad animation number: %i", newAnimation );    } -  anim = buildAnimations[ buildable ]; +  anim = &buildAnimations[ buildable ][ newAnimation ]; + +  //this item has just spawned so lf->frameTime will be zero +  if( !lf->animation ) +    lf->frameTime = cg.time + 1000; //1 sec delay before starting the spawn anim    lf->animation = anim;    lf->animationTime = lf->frameTime + anim->initialLerp; @@ -177,96 +181,105 @@ Sets cg.snap, cg.oldFrame, and cg.backlerp  cg.time should be between oldFrameTime and frameTime after exit  ===============  */ -static void CG_RunBuildableLerpFrame( buildable_t buildable, lerpFrame_t *lf, int newAnimation ) { -  int     f, numFrames; -  animation_t *anim; +static void CG_RunBuildableLerpFrame( centity_t *cent ) +{ +  int                   f, numFrames; +  animation_t           *anim; +  buildable_t           buildable = cent->currentState.clientNum; +  lerpFrame_t           *lf = ¢->lerpFrame; +  buildableAnimNumber_t newAnimation = cent->buildableAnim;    // debugging tool to get no animations -  if ( cg_animSpeed.integer == 0 ) { +  if( cg_animSpeed.integer == 0 ) +  {      lf->oldFrame = lf->frame = lf->backlerp = 0;      return;    }    // see if the animation sequence is switching -  if ( newAnimation != lf->animationNumber || !lf->animation ) { +  if( newAnimation != lf->animationNumber || !lf->animation )      CG_SetBuildableLerpFrameAnimation( buildable, lf, newAnimation ); -  }    // if we have passed the current frame, move it to    // oldFrame and calculate a new frame -  if ( cg.time >= lf->frameTime ) { +  if( cg.time >= lf->frameTime ) +  {      lf->oldFrame = lf->frame;      lf->oldFrameTime = lf->frameTime;      // get the next frame based on the animation      anim = lf->animation; -    if ( !anim->frameLerp ) { +    if( !anim->frameLerp )        return;   // shouldn't happen -    } -    if ( cg.time < lf->animationTime ) { +       +    if ( cg.time < lf->animationTime )        lf->frameTime = lf->animationTime;    // initial lerp -    } else { +    else        lf->frameTime = lf->oldFrameTime + anim->frameLerp; -    } +            f = ( lf->frameTime - lf->animationTime ) / anim->frameLerp;      numFrames = anim->numFrames; -    if (anim->flipflop) { +    if(anim->flipflop)        numFrames *= 2; -    } -    if ( f >= numFrames ) { + +    if( f >= numFrames ) +    {        f -= numFrames; -      if ( anim->loopFrames ) { +      if( anim->loopFrames ) +      {          f %= anim->loopFrames;          f += anim->numFrames - anim->loopFrames; -      } else { +      } +      else +      {          f = numFrames - 1;          // the animation is stuck at the end, so it          // can immediately transition to another sequence          lf->frameTime = cg.time; +        cent->buildableAnim = cent->currentState.torsoAnim;        }      } -    if ( anim->reversed ) { +     +    if( anim->reversed )        lf->frame = anim->firstFrame + anim->numFrames - 1 - f; -    } -    else if (anim->flipflop && f>=anim->numFrames) { +    else if(anim->flipflop && f>=anim->numFrames)        lf->frame = anim->firstFrame + anim->numFrames - 1 - (f%anim->numFrames); -    } -    else { +    else        lf->frame = anim->firstFrame + f; -    } -    if ( cg.time > lf->frameTime ) { +       +    if ( cg.time > lf->frameTime ) +    {        lf->frameTime = cg.time; -      if ( cg_debugAnim.integer ) { +      if( cg_debugAnim.integer )          CG_Printf( "Clamp lf->frameTime\n"); -      }      }    } -  if ( lf->frameTime > cg.time + 200 ) { +  if( lf->frameTime > cg.time + 200 )      lf->frameTime = cg.time; -  } -  if ( lf->oldFrameTime > cg.time ) { +  if( lf->oldFrameTime > cg.time )      lf->oldFrameTime = cg.time; -  } +        // calculate current lerp value -  if ( lf->frameTime == lf->oldFrameTime ) { +  if ( lf->frameTime == lf->oldFrameTime )      lf->backlerp = 0; -  } else { +  else      lf->backlerp = 1.0 - (float)( cg.time - lf->oldFrameTime ) / ( lf->frameTime - lf->oldFrameTime ); -  }  } -  /*  ===============  CG_BuildableAnimation  ===============  */ -static void CG_BuildableAnimation( centity_t *cent, int *old, int *now, float *backLerp ) { +static void CG_BuildableAnimation( centity_t *cent, int *old, int *now, float *backLerp ) +{ +  //if no animation is set default to idle anim +  if( cent->buildableAnim == BANIM_NONE ) +    cent->buildableAnim = cent->currentState.torsoAnim; -  CG_RunBuildableLerpFrame( cent->currentState.clientNum, -                            ¢->lerpFrame, cent->currentState.torsoAnim ); +  CG_RunBuildableLerpFrame( cent );    *old      = cent->lerpFrame.oldFrame;    *now      = cent->lerpFrame.frame; @@ -279,7 +292,8 @@ static void CG_BuildableAnimation( centity_t *cent, int *old, int *now, float *b  CG_Buildable  ==================  */ -void CG_Buildable( centity_t *cent ) { +void CG_Buildable( centity_t *cent ) +{    refEntity_t     ent;    refEntity_t     ent2;    entityState_t   *es; @@ -289,22 +303,20 @@ void CG_Buildable( centity_t *cent ) {    float       scale;    es = ¢->currentState; -  if ( es->modelindex >= bg_numItems ) { +  if ( es->modelindex >= bg_numItems )      CG_Error( "Bad item index %i on entity", es->modelindex ); -  }    //add creep    if( es->modelindex2 == BIT_DROIDS )      CG_Creep( cent );      // if set to invisible, skip -  if ( !es->modelindex || ( es->eFlags & EF_NODRAW ) ) { +  if ( !es->modelindex || ( es->eFlags & EF_NODRAW ) )      return; -  }    item = &bg_itemlist[ es->modelindex ]; -  memset (&ent, 0, sizeof(ent)); +  memset ( &ent, 0, sizeof( ent ) );    VectorCopy( es->angles, cent->lerpAngles );    AnglesToAxis( cent->lerpAngles, ent.axis ); @@ -317,7 +329,7 @@ void CG_Buildable( centity_t *cent ) {    ent.nonNormalizedAxes = qfalse;    // if just respawned, slowly scale up -  msec = cg.time - cent->miscTime; +/*  msec = cg.time - cent->miscTime;    if ( msec >= 0 && msec < ITEM_SCALEUP_TIME ) {      frac = (float)msec / ITEM_SCALEUP_TIME;      VectorScale( ent.axis[0], frac, ent.axis[0] ); @@ -326,8 +338,10 @@ void CG_Buildable( centity_t *cent ) {      ent.nonNormalizedAxes = qtrue;    } else {      frac = 1.0; -  } +  }*/ +  CG_BuildableAnimation( cent, &ent.oldframe, &ent.frame, &ent.backlerp ); +      //turret barrel bit    if( cg_items[ es->modelindex ].models[ 1 ] != 0 )    { @@ -347,13 +361,13 @@ void CG_Buildable( centity_t *cent ) {      ent2.nonNormalizedAxes = qfalse; -    CG_BuildableAnimation( cent, &ent2.oldframe, &ent2.frame, &ent2.backlerp ); -     +    ent2.oldframe = ent.oldframe; +    ent2.frame    = ent.frame; +    ent2.backlerp = ent.backlerp; +      trap_R_AddRefEntityToScene( &ent2 );    } -  CG_BuildableAnimation( cent, &ent.oldframe, &ent.frame, &ent.backlerp ); -    // add to refresh list    trap_R_AddRefEntityToScene(&ent);  } diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 37ac7435..d9a1ae4c 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -891,17 +891,26 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) {      break;    //TA: make droid items "grow" -  case EV_ITEM_GROW: -      DEBUGNAME("EV_ITEM_GROW"); -      cent->miscTime = cg.time; // scale up from this +  case EV_BUILD_CONSTRUCT: +    DEBUGNAME("EV_BUILD_CONSTRUCT"); +    cent->miscTime = cg.time; // scale up from this +    //probably a better place for this, but for the time being it lives here +    memset( ¢->lerpFrame, 0, sizeof( lerpFrame_t ) ); +    cent->buildableAnim = es->eventParm;      break;    //TA: make droid creep "recede" -  case EV_ITEM_RECEDE: -      DEBUGNAME("EV_ITEM_RECEDE"); -      cent->miscTime = -cg.time; // scale down from this +  case EV_BUILD_DESTROY: +    DEBUGNAME("EV_BUILD_DESTROY"); +    cent->miscTime = -cg.time; // scale down from this      break; +  //TA: trigger an anim on a buildable item +  case EV_BUILD_ANIM: +    DEBUGNAME("EV_BUILD_ANIM"); +    cent->buildableAnim = es->eventParm; +    break; +        case EV_GRENADE_BOUNCE:      DEBUGNAME("EV_GRENADE_BOUNCE");      if ( rand() & 1 ) { diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index e37cb644..f2610dff 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -195,6 +195,8 @@ typedef struct centity_s {    vec3_t      lerpAngles;    lerpFrame_t lerpFrame; + +  buildableAnimNumber_t buildableAnim; //TA: persistant anim number  } centity_t; diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index a3acc451..6f6aeada 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -1109,7 +1109,7 @@ buildableAttributes_t bg_buildableList[ ] =      200,                   //int       splashRadius;      MOD_DSPAWN,            //int       meansOfDeath;      BIT_DROIDS,            //int       team; -    EV_ITEM_GROW,          //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      100,                   //int       nextthink;      0,                     //int       turretFireSpeed;      0,                     //int       turretRange; @@ -1130,7 +1130,7 @@ buildableAttributes_t bg_buildableList[ ] =      50,                    //int       splashRadius;      MOD_DSPAWN,            //int       meansOfDeath;      BIT_DROIDS,            //int       team; -    EV_ITEM_GROW,          //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      100,                   //int       nextthink;      0,                     //int       turretFireSpeed;      0,                     //int       turretRange; @@ -1151,7 +1151,7 @@ buildableAttributes_t bg_buildableList[ ] =      50,                    //int       splashRadius;      MOD_DSPAWN,            //int       meansOfDeath;      BIT_DROIDS,            //int       team; -    EV_ITEM_GROW,          //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      100,                   //int       nextthink;      1500,                  //int       turretFireSpeed;      500,                   //int       turretRange; @@ -1172,7 +1172,7 @@ buildableAttributes_t bg_buildableList[ ] =      50,                    //int       splashRadius;      MOD_DSPAWN,            //int       meansOfDeath;      BIT_DROIDS,            //int       team; -    EV_ITEM_GROW,          //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      -1,                    //int       nextthink;      0,                     //int       turretFireSpeed;      0,                     //int       turretRange; @@ -1193,7 +1193,7 @@ buildableAttributes_t bg_buildableList[ ] =      150,                   //int       splashRadius;      MOD_HSPAWN,            //int       meansOfDeath;      BIT_HUMANS,            //int       team; -    EV_NONE,               //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      100,                   //int       nextthink;      0,                     //int       turretFireSpeed;      0,                     //int       turretRange; @@ -1214,7 +1214,7 @@ buildableAttributes_t bg_buildableList[ ] =      50,                    //int       splashRadius;      MOD_HSPAWN,            //int       meansOfDeath;      BIT_HUMANS,            //int       team; -    EV_NONE,               //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      50,                    //int       nextthink;      500,                   //int       turretFireSpeed;      500,                   //int       turretRange; @@ -1235,7 +1235,7 @@ buildableAttributes_t bg_buildableList[ ] =      50,                    //int       splashRadius;      MOD_HSPAWN,            //int       meansOfDeath;      BIT_HUMANS,            //int       team; -    EV_NONE,               //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      50,                    //int       nextthink;      50,                    //int       turretFireSpeed;      300,                   //int       turretRange; @@ -1256,7 +1256,7 @@ buildableAttributes_t bg_buildableList[ ] =      50,                    //int       splashRadius;      MOD_HSPAWN,            //int       meansOfDeath;      BIT_HUMANS,            //int       team; -    EV_NONE,               //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      150,                   //int       nextthink;      4000,                  //int       turretFireSpeed;      1500,                  //int       turretRange; @@ -1277,7 +1277,7 @@ buildableAttributes_t bg_buildableList[ ] =      150,                   //int       splashRadius;      MOD_HSPAWN,            //int       meansOfDeath;      BIT_HUMANS,            //int       team; -    EV_NONE,               //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      100,                   //int       nextthink;      0,                     //int       turretFireSpeed;      0,                     //int       turretRange; @@ -1298,7 +1298,7 @@ buildableAttributes_t bg_buildableList[ ] =      150,                   //int       splashRadius;      MOD_HSPAWN,            //int       meansOfDeath;      BIT_HUMANS,            //int       team; -    EV_NONE,               //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      -1,                    //int       nextthink;      0,                     //int       turretFireSpeed;      0,                     //int       turretRange; @@ -1319,7 +1319,7 @@ buildableAttributes_t bg_buildableList[ ] =      150,                   //int       splashRadius;      MOD_HSPAWN,            //int       meansOfDeath;      BIT_HUMANS,            //int       team; -    EV_NONE,               //int       spawnEvent; +    BANIM_IDLE1,                 //int       constructAnim;      100,                   //int       nextthink;      0,                     //int       turretFireSpeed;      0,                     //int       turretRange; @@ -1579,10 +1579,10 @@ int BG_FindTeamForBuildable( int bclass )  /*  ============== -BG_FindEventForBuildable +BG_FindAnimForBuildable  ==============  */ -int BG_FindEventForBuildable( int bclass ) +int BG_FindAnimForBuildable( int bclass )  {    int i; @@ -1590,11 +1590,11 @@ int BG_FindEventForBuildable( int bclass )    {      if( bg_buildableList[ i ].buildNum == bclass )      { -      return bg_buildableList[ i ].spawnEvent; +      return bg_buildableList[ i ].constructAnim;      }    } -  return EV_NONE; +  return BANIM_IDLE1;  }  /* @@ -3392,6 +3392,7 @@ char *eventnames[] = {    "EV_FOOTSTEP",    "EV_FOOTSTEP_METAL", +  "EV_FOOTSTEP_SQUELCH",    "EV_FOOTSPLASH",    "EV_FOOTWADE",    "EV_SWIM", @@ -3405,7 +3406,7 @@ char *eventnames[] = {    "EV_FALL_MEDIUM",    "EV_FALL_FAR", -  "EV_JUMP_PAD",      // boing sound at origin", jump sound on player +  "EV_JUMP_PAD",      // boing sound at origin, jump sound on player    "EV_JUMP",    "EV_WATER_TOUCH", // foot touches @@ -3440,7 +3441,7 @@ char *eventnames[] = {    "EV_USE_ITEM15",    "EV_ITEM_RESPAWN", -  "EV_PLAYER_RESPAWN", +  "EV_PLAYER_RESPAWN", //TA: for fovwarp effects    "EV_ITEM_POP",    "EV_PLAYER_TELEPORT_IN",    "EV_PLAYER_TELEPORT_OUT", @@ -3449,7 +3450,6 @@ char *eventnames[] = {    "EV_GENERAL_SOUND",    "EV_GLOBAL_SOUND",    // no attenuation -  "EV_GLOBAL_TEAM_SOUND",    "EV_BULLET_HIT_FLESH",    "EV_BULLET_HIT_WALL", @@ -3457,6 +3457,7 @@ char *eventnames[] = {    "EV_MISSILE_HIT",    "EV_MISSILE_MISS",    "EV_MISSILE_MISS_METAL", +  "EV_ITEM_EXPLOSION", //TA: human item explosions    "EV_RAILTRAIL",    "EV_SHOTGUN",    "EV_BULLET",        // otherEntity is the shooter @@ -3472,22 +3473,23 @@ char *eventnames[] = {    "EV_POWERUP_REGEN",    "EV_GIB_PLAYER",      // gib a previously living player -  "EV_SCOREPLUM",     // score plum - -//#ifdef MISSIONPACK -  "EV_PROXIMITY_MINE_STICK", -  "EV_PROXIMITY_MINE_TRIGGER", -  "EV_KAMIKAZE",      // kamikaze explodes -  "EV_OBELISKEXPLODE",    // obelisk explodes -  "EV_INVUL_IMPACT",    // invulnerability sphere impact -  "EV_JUICED",        // invulnerability juiced effect -  "EV_LIGHTNINGBOLT",   // lightning bolt bounced of invulnerability sphere -//#endif +  "EV_GIB_DROID",       //TA: generic green gib for droids + +  "EV_BUILD_CONSTRUCT", //TA +  "EV_BUILD_DESTROY",   //TA +  "EV_BUILD_ANIM",      //TA    "EV_DEBUG_LINE",    "EV_STOPLOOPINGSOUND", -  "EV_TAUNT" - +  "EV_TAUNT", +  "EV_TAUNT_YES", +  "EV_TAUNT_NO", +  "EV_TAUNT_FOLLOWME", +  "EV_TAUNT_GETFLAG", +  "EV_TAUNT_GUARDBASE", +  "EV_TAUNT_PATROL", + +  "EV_MENU"             //TA: menu event  };  /* diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 09f5ecf3..01ea379e 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -492,7 +492,6 @@ typedef enum {    EV_ITEM_RESPAWN,    EV_PLAYER_RESPAWN, //TA: for fovwarp effects -  EV_ITEM_GROW, //droid items that grow    EV_ITEM_POP,    EV_PLAYER_TELEPORT_IN,    EV_PLAYER_TELEPORT_OUT, @@ -525,7 +524,10 @@ typedef enum {    EV_GIB_PLAYER,      // gib a previously living player    EV_GIB_DROID,       //TA: generic green gib for droids -  EV_ITEM_RECEDE,     //TA: sent when creep should recede + +  EV_BUILD_CONSTRUCT, //TA +  EV_BUILD_DESTROY,   //TA +  EV_BUILD_ANIM,      //TA    EV_DEBUG_LINE,    EV_STOPLOOPINGSOUND, @@ -626,24 +628,26 @@ typedef enum {  //TA: for buildable animations  typedef enum  { -  CONSTRUCT1, -  CONSTRUCT2, +  BANIM_NONE, + +  BANIM_CONSTRUCT1, +  BANIM_CONSTRUCT2, -  IDLE1, -  IDLE2, -  IDLE3, +  BANIM_IDLE1, +  BANIM_IDLE2, +  BANIM_IDLE3, -  ATTACK1, -  ATTACK2, +  BANIM_ATTACK1, +  BANIM_ATTACK2, -  SPAWN1, -  SPAWN2, +  BANIM_SPAWN1, +  BANIM_SPAWN2, -  PAIN1, -  PAIN2, +  BANIM_PAIN1, +  BANIM_PAIN2, -  DESTROY1, -  DESTROY2, +  BANIM_DESTROY1, +  BANIM_DESTROY2,    MAX_BUILDABLE_ANIMATIONS  } buildableAnimNumber_t; @@ -857,7 +861,7 @@ typedef struct    int       team; -  int       spawnEvent; +  int       constructAnim;    int       nextthink; @@ -926,7 +930,7 @@ int       BG_FindSplashDamageForBuildable( int bclass );  int       BG_FindSplashRadiusForBuildable( int bclass );  int       BG_FindMODForBuildable( int bclass );  int       BG_FindTeamForBuildable( int bclass ); -int       BG_FindEventForBuildable( int bclass ); +int       BG_FindAnimForBuildable( int bclass );  int       BG_FindNextThinkForBuildable( int bclass );  int       BG_FindFireSpeedForBuildable( int bclass );  int       BG_FindRangeForBuildable( int bclass ); diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index c9c5fdb7..04e246f8 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -35,6 +35,18 @@ Triggers an animation client side  */  void G_setBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim )  { +  G_AddEvent( ent, EV_BUILD_ANIM, anim ); +} + +/* +================ +G_setIdleBuildableAnim + +Set the animation to use whilst no other animations are running +================ +*/ +void G_setIdleBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim ) +{    ent->s.torsoAnim = anim;  } @@ -190,7 +202,7 @@ void D_CreepRecede( gentity_t *self )  {    //if the creep just died begin the recession    if( ( self->timestamp + 100 ) == level.time ) -    G_AddEvent( self, EV_ITEM_RECEDE, 0 ); +    G_AddEvent( self, EV_BUILD_DESTROY, 0 );    //creep is still receeding    if( ( self->timestamp + 10000 ) > level.time ) @@ -225,7 +237,7 @@ void DSpawn_Melt( gentity_t *self )    //start creep recession    if( ( self->timestamp + 500 ) == level.time ) -    G_AddEvent( self, EV_ITEM_RECEDE, 0 ); +    G_AddEvent( self, EV_BUILD_DESTROY, 0 );    //not dead yet    if( ( self->timestamp + 10000 ) > level.time ) @@ -279,6 +291,17 @@ void DSpawn_Think( gentity_t *self )  {  } +/* +================ +DSpawn_Pain + +pain function for Droid Spawn +================ +*/ +void DSpawn_Pain( gentity_t *self, gentity_t *attacker, int damage ) +{ +  G_setBuildableAnim( self, BANIM_PAIN1 ); +} @@ -1214,9 +1237,7 @@ gentity_t *Build_Item( gentity_t *ent, buildable_t buildable, int distance ) {    built->splashRadius = BG_FindSplashRadiusForBuildable( buildable );    built->splashMethodOfDeath = BG_FindMODForBuildable( buildable ); -  //add a spawn event -  if( BG_FindEventForBuildable( buildable ) != EV_NONE ) -    G_AddEvent( built, BG_FindEventForBuildable( buildable ), 0 ); +  G_setIdleBuildableAnim( built, BG_FindAnimForBuildable( buildable ) );    built->nextthink = BG_FindNextThinkForBuildable( buildable ); @@ -1226,22 +1247,26 @@ gentity_t *Build_Item( gentity_t *ent, buildable_t buildable, int distance ) {      case BA_D_SPAWN:        built->die = DSpawn_Die;        built->think = DSpawn_Think; +      built->pain = DSpawn_Pain;        break;      case BA_D_DEF1:        built->die = DDef1_Die;        built->think = DDef1_Think; +      built->pain = DSpawn_Pain;        break;      case BA_D_DEF2:        built->die = DDef1_Die;        built->think = DDef2_Think; +      built->pain = DSpawn_Pain;        built->enemy = NULL;        built->s.weapon = BG_FindProjTypeForBuildable( buildable );        break;      case BA_D_HIVEMIND:        built->die = DSpawn_Die; +      built->pain = DSpawn_Pain;        break;      case BA_H_SPAWN: @@ -1296,7 +1321,7 @@ gentity_t *Build_Item( gentity_t *ent, buildable_t buildable, int distance ) {    built->s.pos.trType = TR_GRAVITY;    built->s.pos.trTime = level.time; -  G_setBuildableAnim( built, CONSTRUCT1 ); +  G_AddEvent( built, EV_BUILD_CONSTRUCT, BANIM_CONSTRUCT1 );    trap_LinkEntity( built ); diff --git a/src/game/g_client.c b/src/game/g_client.c index 17928cc3..66f8afa9 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1307,6 +1307,9 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn ) {          trap_SendServerCommand( ent-g_entities, va("print \"No suitable spawns available\n\"" ) );          return;        } +       +      //start spawn animation on egg +      G_setBuildableAnim( spawnPoint, BANIM_SPAWN1 );      }    }    client->pers.teamState.state = TEAM_ACTIVE; diff --git a/src/game/g_local.h b/src/game/g_local.h index 64d3f3de..a176e444 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -545,6 +545,7 @@ typedef enum  itemBuildError_t  itemFits( gentity_t *ent, buildable_t buildable, int distance );  gentity_t         *Build_Item( gentity_t *ent, buildable_t buildable, int distance );  void              G_setBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim ); +void              G_setIdleBuildableAnim( gentity_t *ent, buildableAnimNumber_t anim );  //  // g_utils.c  | 
