From 702f784e44a932ca29d4b817afcf5834a3893176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Gr=C3=BCnbacher?= Date: Mon, 11 May 2015 00:19:26 +0200 Subject: [PATCH] Engine: Fix get_info_keybuffer() not being able to retrieve local keybuffer --- modules/engine/engine.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/engine/engine.cpp b/modules/engine/engine.cpp index 89f0adde..673d916e 100644 --- a/modules/engine/engine.cpp +++ b/modules/engine/engine.cpp @@ -367,11 +367,10 @@ static cell AMX_NATIVE_CALL get_info_keybuffer(AMX *amx, cell *params) { int iEnt = params[1]; - CHECK_ENTITY(iEnt); + if (iEnt != -1) + CHECK_ENTITY(iEnt); - edict_t *e = INDEXENT2(iEnt); - - char *info = GETINFOKEYBUFFER(e); + char *info = GETINFOKEYBUFFER((iEnt == -1) ? NULL : INDEXENT2(iEnt)); return MF_SetAmxString(amx, params[2], info, params[3]); }