From: James O'Neill Date: Sat, 26 Apr 2025 16:32:57 +0000 (+0900) Subject: Allow prvm_edictset to return the current value (#228) X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=af1e5c03be8e2fd41135f9064ad8e4c4c1ccd8f4;p=xonotic%2Fdarkplaces.git Allow prvm_edictset to return the current value (#228) Implement @Baker7's suggestion by updating `prvm_edictset` so that when no new value is provided it will instead call `prvm_edictget`, returning the current value. Resolves #213 --- diff --git a/prvm_edict.c b/prvm_edict.c index 5f96e19c..4bf008d6 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -1252,7 +1252,13 @@ static void PRVM_ED_EdictSet_f(cmd_state_t *cmd) prvm_edict_t *ed; mdef_t *key; - if(Cmd_Argc(cmd) != 5) + if (Cmd_Argc(cmd) == 4) { + // Baker: Turn into prvm_edictget when no value(s) provided + PRVM_ED_EdictGet_f(cmd); + return; + } + + if (Cmd_Argc(cmd) != 5) { Con_Print("prvm_edictset \n"); return;