From af1e5c03be8e2fd41135f9064ad8e4c4c1ccd8f4 Mon Sep 17 00:00:00 2001 From: James O'Neill Date: Sun, 27 Apr 2025 01:32:57 +0900 Subject: [PATCH] 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 --- prvm_edict.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.39.5