From 74640736cc1a2fb8b955c12bbf483d101166d7e1 Mon Sep 17 00:00:00 2001 From: xiaojin Date: Wed, 4 Aug 2021 19:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20chore(=E5=BA=93):=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20lua=20ecs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/lualib-src/lua-ecs/luaecs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/lualib-src/lua-ecs/luaecs.c b/framework/lualib-src/lua-ecs/luaecs.c index 19356bc..f716fa2 100644 --- a/framework/lualib-src/lua-ecs/luaecs.c +++ b/framework/lualib-src/lua-ecs/luaecs.c @@ -162,7 +162,7 @@ add_component_id_(lua_State *L, int world_index, struct entity_world *w, int cid } ++pool->n; pool->id[index] = eid; - if (index > 0 && eid <= pool->id[index-1]) { + if (index > 0 && eid < pool->id[index-1]) { luaL_error(L, "Add component %d fail", cid); } return index;