From 5386a061cec7aeaba224226aad691c0d35e6b2de Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 9 Dec 2023 12:01:04 +0200 Subject: [PATCH] lua: cleanup `tostring()` function of edict value --- Quake/ls_edict.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Quake/ls_edict.c b/Quake/ls_edict.c index 954b6b50..54e0df9b 100644 --- a/Quake/ls_edict.c +++ b/Quake/ls_edict.c @@ -236,12 +236,10 @@ static int LS_value_edict_tostring(lua_State* state) edict_t* ed = LS_GetEdictFromUserData(state); if (ed == NULL) - { lua_pushstring(state, "invalid edict"); - return 1; - } + else + lua_pushfstring(state, "edict %d: %s", NUM_FOR_EDICT(ed), SV_GetEntityName(ed)); - lua_pushfstring(state, "edict %d: %s", NUM_FOR_EDICT(ed), SV_GetEntityName(ed)); return 1; }