From 8fbbda13c6c1fe921278dece061d2b30cfec0fd1 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Wed, 15 Sep 2004 15:17:52 +0000 Subject: [PATCH] added FNullEntity check --- dlls/fun/fun.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/fun/fun.cpp b/dlls/fun/fun.cpp index 4c86d1e8..7a92d1b2 100755 --- a/dlls/fun/fun.cpp +++ b/dlls/fun/fun.cpp @@ -239,6 +239,11 @@ static cell AMX_NATIVE_CALL give_item(AMX *amx, cell *params) // native give_ite // Create the entity, returns to pointer pItemEntity = CREATE_NAMED_ENTITY(item); + if(FNullEnt(pItemEntity)) { + MF_RaiseAmxError(amx, AMX_ERR_NATIVE); + return 0; + } + //VARS(pItemEntity)->origin = VARS(pPlayer)->origin; // nice to do VARS(ent)->origin instead of ent->v.origin? :-I //I'm not sure, normally I use macros too =P pItemEntity->v.origin = pPlayer->v.origin;