All pastes #609177 Raw Edit

Stuff

public text v1 · immutable
·published 2007-07-08 18:50 UTC
rendered paste body

/*
===============
Cmd_Concat_f

concatenates two cvars together
===============
*/
void Cmd_Concat_f( void ) {
  char  *v;
  char  *v1;
  char  *v2;

  if (Cmd_Argc () != 4) {
    Com_Printf ("concat <variableToSet> <variable1> <variable2> : concatenates variable1 and variable2 and sets the result to variableToSet\n");
    return;
  }

  v  = Cmd_Argv( 1 );
  v1 = Cvar_VariableString( Cmd_Argv( 2 ) );
  v2 = Cvar_VariableString( Cmd_Argv( 3 ) );
  Cvar_Set( v, strcat( v1, v2 ) );
}