Skip to content

Commit 889757a

Browse files
authored
Nailbomb nail travel duration nerf (#71)
* update nail travel duration client side * destroy nail server side destroy nail after set duration server side
1 parent d3a1be0 commit 889757a

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

code/cgame/cg_q3f_grenades.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,11 @@ static int NailEndTime( struct gnail *nail, float zpos, int parentnum )
335335
end[0] = nail->xvel;
336336
end[1] = nail->yvel;
337337
end[2] = 0;
338-
VectorScale( end, 20000 * Q3F_NAILSPEED / 1000 , end ); // 20 seconds travel
338+
VectorScale( end, 500 * Q3F_NAILSPEED / 1000 , end ); // 20 seconds travel - Default; Tulkas - adjusted to 1 second travel duration to reduce nail spam
339339
VectorAdd( start, end, end );
340340

341341
CG_Trace( &tr, start, NULL, NULL, end, parentnum, MASK_SHOT );
342-
return( nail->starttime + 20000 * tr.fraction );
342+
return( nail->starttime + 500 * tr.fraction );
343343
}
344344

345345
static int InitNailArray( centity_t *cent )

code/game/g_q3f_grenades.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,12 @@ static void NailThink( gentity_t *grenade )
915915
ptr = array + index;
916916
if( !ptr->starttime || ptr->starttime > level.time )
917917
continue;
918+
if( level.time - ptr->starttime >= 500 )
919+
{
920+
ptr->starttime = 0; // expire nail
921+
*(bitptr + (index>>3)) &= ~(1<<(index&7)); // tell client it's gone
922+
continue;
923+
}
918924
start[0] = ptr->xpos;
919925
start[1] = ptr->ypos;
920926
start[2] = grenade->r.currentOrigin[2];

0 commit comments

Comments
 (0)