summaryrefslogtreecommitdiff
path: root/src/game/g_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r--src/game/g_cmds.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 1687504f..759ac058 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1918,10 +1918,20 @@ void Cmd_Build_f( gentity_t *ent )
trap_SendServerCommand( ent-g_entities, va("print \"Unknown item\n\"" ) );
else
{
- if( itemFits( ent, buildable, -50 ) )
- Build_Item( ent, buildable, -50 );
- else
- trap_SendServerCommand( ent-g_entities, va("print \"Location is not suitable\n\"" ) );
+ switch( itemFits( ent, buildable, -50 ) )
+ {
+ case IBE_NONE:
+ Build_Item( ent, buildable, -50 );
+ break;
+
+ case IBE_NOCREEP:
+ trap_SendServerCommand( ent-g_entities, va("print \"No creep to build on\n\"" ) );
+ break;
+
+ case IBE_NOROOM:
+ trap_SendServerCommand( ent-g_entities, va("print \"Not enough room\n\"" ) );
+ break;
+ }
}
}
else if( ( ent->client->pers.pteam == PTE_HUMANS ) &&
@@ -1934,10 +1944,20 @@ void Cmd_Build_f( gentity_t *ent )
trap_SendServerCommand( ent-g_entities, va("print \"Unknown item\n\"" ) );
else
{
- if( itemFits( ent, buildable, 80 ) )
- Build_Item( ent, buildable, 80 );
- else
- trap_SendServerCommand( ent-g_entities, va("print \"Location is not suitable\n\"" ) );
+ switch( itemFits( ent, buildable, 80 ) )
+ {
+ case IBE_NONE:
+ Build_Item( ent, buildable, 80 );
+ break;
+
+ case IBE_REACTOR:
+ trap_SendServerCommand( ent-g_entities, va("print \"Only one reactor per map\n\"" ) );
+ break;
+
+ case IBE_NOROOM:
+ trap_SendServerCommand( ent-g_entities, va("print \"Not enough room\n\"" ) );
+ break;
+ }
}
}
else if( ent->client->pers.pteam == PTE_NONE )