diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_public.h | 2 | ||||
-rw-r--r-- | src/game/g_buildable.c | 6 | ||||
-rw-r--r-- | src/game/g_cmds.c | 18 |
3 files changed, 17 insertions, 9 deletions
diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 845993d5..7af74969 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -565,13 +565,13 @@ typedef enum MN_H_SPAWN, MN_H_BUILD, MN_H_MCU, + MN_H_BANK, MN_H_NOROOM, MN_H_NOPOWER, MN_H_REACTOR, MN_H_REPEATER, MN_H_RPLWARN, MN_H_RPTWARN, - MN_H_MCUPOWER, MN_H_NOSLOTS, MN_H_NOFUNDS, MN_H_ITEMHELD diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 808666b5..8f9fbcab 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -751,7 +751,7 @@ void HMCU_Activate( gentity_t *self, gentity_t *other, gentity_t *activator ) if( self->powered ) G_AddPredictableEvent( activator, EV_MENU, MN_H_MCU ); else - G_AddPredictableEvent( activator, EV_MENU, MN_H_MCUPOWER ); + G_AddPredictableEvent( activator, EV_MENU, MN_H_NOPOWER ); } /* @@ -790,9 +790,9 @@ void HBank_Activate( gentity_t *self, gentity_t *other, gentity_t *activator ) //if this is powered then call the mcu menu if( self->powered ) - G_AddPredictableEvent( activator, EV_MENU, MN_H_MCU ); + G_AddPredictableEvent( activator, EV_MENU, MN_H_BANK ); else - G_AddPredictableEvent( activator, EV_MENU, MN_H_MCUPOWER ); + G_AddPredictableEvent( activator, EV_MENU, MN_H_NOPOWER ); } /* diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 1d977b86..f2f7ff4d 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1992,7 +1992,6 @@ void Cmd_Deposit_f( gentity_t *ent ) qboolean nearBank = qfalse; trap_Argv( 1, s, sizeof( s ) ); - amount = atoi( s ); //droids don't sell stuff if( ent->client->pers.pteam != PTE_HUMANS ) @@ -2011,6 +2010,11 @@ void Cmd_Deposit_f( gentity_t *ent ) } } + if( !Q_stricmp( s, "all" ) ) + amount = ent->client->ps.stats[ STAT_CREDIT ]; + else + amount = atoi( s ); + //no Bank nearby if( !nearBank ) { @@ -2024,7 +2028,7 @@ void Cmd_Deposit_f( gentity_t *ent ) bankEntity->credits[ ent->client->ps.clientNum ] += amount; } else - trap_SendServerCommand( ent-g_entities, va("print \"You do not have that amount\n\"" ) ); + G_AddPredictableEvent( ent, EV_MENU, MN_H_NOFUNDS ); } @@ -2043,8 +2047,7 @@ void Cmd_Withdraw_f( gentity_t *ent ) qboolean nearBank = qfalse; trap_Argv( 1, s, sizeof( s ) ); - amount = atoi( s ); - + //droids don't sell stuff if( ent->client->pers.pteam != PTE_HUMANS ) return; @@ -2062,6 +2065,11 @@ void Cmd_Withdraw_f( gentity_t *ent ) } } + if( !Q_stricmp( s, "all" ) ) + amount = bankEntity->credits[ ent->client->ps.clientNum ]; + else + amount = atoi( s ); + //no Bank nearby if( !nearBank ) { @@ -2075,7 +2083,7 @@ void Cmd_Withdraw_f( gentity_t *ent ) bankEntity->credits[ ent->client->ps.clientNum ] -= amount; } else - trap_SendServerCommand( ent-g_entities, va("print \"You do not have that amount\n\"" ) ); + G_AddPredictableEvent( ent, EV_MENU, MN_H_NOFUNDS ); } |