From 1298684fd9623b5f8a6a5dc424b06ea0c6753255 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 17 Jun 2012 17:55:46 -0700 Subject: [PATCH] bind GIVE CONTROL to lua --- scripts/tests/bindings.lua | 1 + scripts/tests/orders.lua | 8 ++++++++ src/bindings/bind_process.c | 4 ++++ src/bindings/bind_process.h | 1 + src/bindings/process.pkg | 1 + 5 files changed, 15 insertions(+) diff --git a/scripts/tests/bindings.lua b/scripts/tests/bindings.lua index fc325c608..61c8ed93c 100755 --- a/scripts/tests/bindings.lua +++ b/scripts/tests/bindings.lua @@ -41,6 +41,7 @@ function test_process() assert_equal("function", _G.type(eressea.process.contact)) assert_equal("function", _G.type(eressea.process.enter)) assert_equal("function", _G.type(eressea.process.magic)) + assert_equal("function", _G.type(eressea.process.give_control)) end function test_settings() diff --git a/scripts/tests/orders.lua b/scripts/tests/orders.lua index 076e27be6..890c7b825 100755 --- a/scripts/tests/orders.lua +++ b/scripts/tests/orders.lua @@ -213,6 +213,14 @@ function test_process_contact() eressea.process.contact() end +function test_process_battle() + eressea.process.battle() +end + function test_process_magic() eressea.process.magic() end + +function test_process_give_control() + eressea.process.give_control() +end diff --git a/src/bindings/bind_process.c b/src/bindings/bind_process.c index 5010bf2f9..5244ef317 100755 --- a/src/bindings/bind_process.c +++ b/src/bindings/bind_process.c @@ -207,6 +207,10 @@ void process_magic(void) { magic(); } +void process_give_control(void) { + process_cmd(K_CONTACT, give_control_cmd, 0); +} + void process_enter(int final) { region * r; for (r=regions; r; r=r->next) { diff --git a/src/bindings/bind_process.h b/src/bindings/bind_process.h index 7fd9a1508..128692c49 100755 --- a/src/bindings/bind_process.h +++ b/src/bindings/bind_process.h @@ -33,6 +33,7 @@ void process_sethelp(void); void process_contact(void); void process_enter(int final); void process_magic(void); +void process_give_control(void); #ifdef __cplusplus } diff --git a/src/bindings/process.pkg b/src/bindings/process.pkg index 81a189633..339fa6a7c 100755 --- a/src/bindings/process.pkg +++ b/src/bindings/process.pkg @@ -30,5 +30,6 @@ module eressea { void process_contact @ contact(void); /* CONTACT */ void process_enter @ enter(int message); /* ENTER */ void process_magic @ magic(void); /* CAST */ + void process_give_control @ give_control(void); /* GIVE CONTROL */ } }