From d1379bb671a5ab5b09792a0e2df640f6d01136a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bergstr=C3=B6m?= Date: Tue, 9 Mar 2004 08:32:50 +0000 Subject: [PATCH] renamed find_entity in engine to find_ent_by_class (find_ent_by_classname works too) --- dlls/engine/meta_api.cpp | 5 +++-- plugins/include/engine.inc | 2 +- plugins/include/engine_stocks.inc | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/engine/meta_api.cpp b/dlls/engine/meta_api.cpp index 450058d0..dcb82663 100755 --- a/dlls/engine/meta_api.cpp +++ b/dlls/engine/meta_api.cpp @@ -1830,7 +1830,7 @@ static cell AMX_NATIVE_CALL create_entity(AMX *amx, cell *params) { } //ej ref'd by jghg -static cell AMX_NATIVE_CALL find_entity(AMX *amx, cell *params) /* 3 param */ +static cell AMX_NATIVE_CALL find_ent_by_class(AMX *amx, cell *params) /* 3 param */ { edict_t *pEnt = INDEXENT(params[1]); @@ -3160,7 +3160,8 @@ AMX_NATIVE_INFO Engine_Natives[] = { {"create_entity", create_entity}, {"remove_entity", remove_entity}, - {"find_entity", find_entity}, + {"find_ent_by_class", find_ent_by_class}, + {"find_ent_by_classname", find_ent_by_class}, // just in case anyone likes typing the whole thing {"find_ent_by_owner", find_ent_by_owner}, {"find_ent_by_target", find_ent_by_target}, {"find_ent_by_tname", find_ent_by_tname}, diff --git a/plugins/include/engine.inc b/plugins/include/engine.inc index c98e95d6..304deef0 100755 --- a/plugins/include/engine.inc +++ b/plugins/include/engine.inc @@ -93,7 +93,7 @@ native entity_set_byte(iIndex, iKey, iVal); native create_entity(szClassname[]); /* Finds an entity in the world, will return 0 if nothing is found */ -native find_entity(iIndex, szClass[]); +native find_ent_by_class(iIndex, szClass[]); native find_ent_by_owner(iIndex, szClass[], iOwner); native find_ent_by_target(iIndex, szClass[]); native find_ent_by_tname(iIndex, szClass[]); diff --git a/plugins/include/engine_stocks.inc b/plugins/include/engine_stocks.inc index 737213c0..0988e2cb 100755 --- a/plugins/include/engine_stocks.inc +++ b/plugins/include/engine_stocks.inc @@ -61,13 +61,13 @@ stock get_entity_distance(ent1, ent2) /* Get grenade thrown by this user */ stock get_grenade(id) { - new iGrenade = find_entity(-1, "grenade") + new iGrenade = find_ent_by_class(-1, "grenade") while(iGrenade > 0) { if(entity_get_edict(iGrenade, EV_ENT_owner) == id) return iGrenade - iGrenade = find_entity(iGrenade, "grenade") + iGrenade = find_ent_by_class(iGrenade, "grenade") } return 0 @@ -92,7 +92,7 @@ stock remove_entity_name(eName[]) while (iEntity > 0) { remove_entity(iEntity) - iEntity = find_entity(-1, eName) + iEntity = find_ent_by_class(-1, eName) } return 1