*/
static void Con_DrawInput(qbool is_console, float x, float v, float inputsize)
{
- int y, i, col_out, linepos, text_start, prefix_start;
+ int y, i, col_out, linepos, text_start, prefix_start = 0;
char text[MAX_INPUTLINE + 5 + 9 + 1]; // space for ^xRGB, "say_team:" and \0
float xo;
size_t len_out;
int i;
qbool haveorigin;
- qbool expectval = false;
void (*print)(const char *, ...) = (cmd->source == src_client ? SV_ClientPrintf : Con_Printf);
if(!Cmd_Argc(cmd))
}
// Allow more than one key/value pair by cycling between expecting either one.
- for(i = 2; i < Cmd_Argc(cmd); i++)
+ for(i = 2; i < Cmd_Argc(cmd); i += 2)
{
- if(!expectval)
+ if(!(key = PRVM_ED_FindField(prog, Cmd_Argv(cmd, i))))
{
- if(!(key = PRVM_ED_FindField(prog, Cmd_Argv(cmd, i))))
- {
- print("Key %s not found!\n", Cmd_Argv(cmd, i));
- PRVM_ED_Free(prog, ed);
- return;
- }
+ print("Key %s not found!\n", Cmd_Argv(cmd, i));
+ PRVM_ED_Free(prog, ed);
+ return;
+ }
- /*
- * This is mostly for dedicated server console, but if the
- * player gave a custom origin, we can ignore the traceline.
- */
- if(!strcmp(Cmd_Argv(cmd, i), "origin"))
- haveorigin = true;
+ /*
+ * This is mostly for dedicated server console, but if the
+ * player gave a custom origin, we can ignore the traceline.
+ */
+ if(!strcmp(Cmd_Argv(cmd, i), "origin"))
+ haveorigin = true;
- expectval = true;
- }
- else
- {
- PRVM_ED_ParseEpair(prog, ed, key, Cmd_Argv(cmd, i), false);
- expectval = false;
- }
+ if (i + 1 < Cmd_Argc(cmd))
+ PRVM_ED_ParseEpair(prog, ed, key, Cmd_Argv(cmd, i+1), false);
}
if(!haveorigin)
{
prvm_prog_t *prog = SVVM_prog;
prvm_edict_t *ed;
- int i, ednum;
+ int i, ednum = 0;
void (*print)(const char *, ...) = (cmd->source == src_client ? SV_ClientPrintf : Con_Printf);
if(!Cmd_Argc(cmd))