diff options
author | Tim Angus <tim@ngus.net> | 2001-08-28 18:35:20 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-08-28 18:35:20 +0000 |
commit | 0ec416c5c51458d1faac712884c2d7cbddd2eb43 (patch) | |
tree | 04dd2d2387857a7d5583f70a13bd5b6717796420 /src/game/g_cmds.c | |
parent | 5af435dc4a2c87798f1b72b1e113209e1d1c2de4 (diff) |
Ceiling eggs
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 29b1f27c..35a453a4 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -2004,23 +2004,30 @@ Cmd_Build_f void Cmd_Build_f( gentity_t *ent ) { char s[ MAX_TOKEN_CHARS ]; + char s1[ MAX_TOKEN_CHARS ]; buildable_t buildable; weapon_t weapon; - float dist; + float dist, speed, maxspeed; trap_Argv( 1, s, sizeof( s ) ); + trap_Argv( 2, s1, sizeof( s1 ) ); buildable = BG_FindBuildNumForName( s ); + speed = atof( s1 ); + maxspeed = BG_FindLaunchSpeedForClass( ent->client->ps.stats[ STAT_PCLASS ] ); + + if( speed > maxspeed ) + speed = maxspeed; if( buildable != BA_NONE && ( 1 << ent->client->ps.weapon ) & BG_FindBuildWeaponForBuildable( buildable ) ) { dist = BG_FindBuildDistForClass( ent->client->ps.stats[ STAT_PCLASS ] ); - switch( itemFits( ent, buildable, dist ) ) + switch( G_itemFits( ent, buildable, dist ) ) { case IBE_NONE: - Build_Item( ent, buildable, dist ); + G_buildItem( ent, buildable, dist, speed ); break; case IBE_NOCREEP: @@ -2039,11 +2046,6 @@ void Cmd_Build_f( gentity_t *ent ) G_AddPredictableEvent( ent, EV_MENU, MN_D_HIVEMIND ); break; - case IBE_SPWNWARN: - G_AddPredictableEvent( ent, EV_MENU, MN_D_SPWNWARN ); - Build_Item( ent, buildable, dist ); - break; - case IBE_REACTOR: G_AddPredictableEvent( ent, EV_MENU, MN_H_REACTOR ); break; @@ -2063,14 +2065,19 @@ void Cmd_Build_f( gentity_t *ent ) G_AddPredictableEvent( ent, EV_MENU, MN_H_NOPOWER ); break; + case IBE_SPWNWARN: + G_AddPredictableEvent( ent, EV_MENU, MN_D_SPWNWARN ); + G_buildItem( ent, buildable, dist, speed ); + break; + case IBE_RPLWARN: G_AddPredictableEvent( ent, EV_MENU, MN_H_RPLWARN ); - Build_Item( ent, buildable, dist ); + G_buildItem( ent, buildable, dist, speed ); break; case IBE_RPTWARN: G_AddPredictableEvent( ent, EV_MENU, MN_H_RPTWARN ); - Build_Item( ent, buildable, dist ); + G_buildItem( ent, buildable, dist, speed ); break; } } |