diff options
| author | Paweł Redman <pawel.redman@gmail.com> | 2020-04-08 08:12:26 +0200 | 
|---|---|---|
| committer | Paweł Redman <pawel.redman@gmail.com> | 2020-04-08 08:12:58 +0200 | 
| commit | 9fd2c5dec3a26ff238a783fbfde1c299f0447b4d (patch) | |
| tree | 3f95f4561626f603b0cfd3bb18e7854d679146e5 /src/game | |
| parent | ef0750708f2a5426c0a14e4bfbc1f3cc6eea47e0 (diff) | |
Print the 'donated ...' message only once
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/g_cmds.c | 18 | 
1 files changed, 13 insertions, 5 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 27c3dbc..d9edc16 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -5169,6 +5169,19 @@ void Cmd_Donate_f( gentity_t *ent ) {    // transfer funds    G_AddCreditToClient( ent->client, value - total, qtrue ); + +  if( ent->client->pers.teamSelection == PTE_ALIENS ) +  { +    trap_SendServerCommand( ent-g_entities, +      va( "print \"Donated %.3f evo(s) to the cause.\n\"", +      ( total - value ) / EVO_TO_CREDS_RATE ) ); +  } +  else +  { +    trap_SendServerCommand( ent-g_entities, +      va( "print \"Donated %d credit(s) to the cause.\n\"", ( total - value ) ) ); +  } +    for( i = 0; i < level.maxclients; i++ )    {      if( totals[ i ] ) @@ -5178,17 +5191,12 @@ void Cmd_Donate_f( gentity_t *ent ) {          trap_SendServerCommand( i,            va( "print \"%s^7 donated %.3f evo(s) to you, don't forget to say 'thank you'!\n\"",            ent->client->pers.netname, totals[ i ] / EVO_TO_CREDS_RATE ) ); -        trap_SendServerCommand( ent-g_entities, -          va( "print \"Donated %.3f evo(s) to the cause.\n\"", -          ( total - value ) / EVO_TO_CREDS_RATE ) );        }        else        {          trap_SendServerCommand( i,            va( "print \"%s^7 donated %d credit(s) to you, don't forget to say 'thank you'!\n\"",            ent->client->pers.netname, totals[ i ] ) ); -        trap_SendServerCommand( ent-g_entities, -          va( "print \"Donated %d credit(s) to the cause.\n\"", total-value ) );        }      }    }  | 
