From 52f08917d51a331ce7cdc613728e27246a6690dd Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 15 Sep 2019 13:37:04 +0200 Subject: [PATCH] getn is deprecated --- scripts/tests/e2/allies.lua | 2 +- src/bind_faction.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/tests/e2/allies.lua b/scripts/tests/e2/allies.lua index 9f86e5f7c..ef38a97bf 100644 --- a/scripts/tests/e2/allies.lua +++ b/scripts/tests/e2/allies.lua @@ -23,7 +23,7 @@ function test_get_allies() assert_equal(0, #allies) f1:set_ally(f2, "give", true) allies = f1.allies - assert_not_nil(1, table.getn(allies)) + assert_not_nil(allies[f2.id]) assert_equal('table', type(allies[f2.id])) assert_equal(1, #allies[f2.id]) assert_equal("give", allies[f2.id][1]) diff --git a/src/bind_faction.c b/src/bind_faction.c index fd6983f0d..56164785d 100644 --- a/src/bind_faction.c +++ b/src/bind_faction.c @@ -32,7 +32,10 @@ #include #include #include -#include +#include // for bool +#include // for puts + +struct allies; int tolua_factionlist_next(lua_State * L) {