diff options
author | Tim Angus <tim@ngus.net> | 2001-03-22 22:36:31 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-03-22 22:36:31 +0000 |
commit | 8db4c8343e6ee7a46a387a368e738cd51c4529e5 (patch) | |
tree | 81569bc0973633512e059000158de02dabebbc6d /src/game/g_cmds.c | |
parent | 0b7492d5127881183298fe0d9029a66a3eb54ba1 (diff) |
Restructured itemFits to be more verbose
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 36 |
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 ) |