diff --git a/scripts/tests/bindings.lua b/scripts/tests/bindings.lua index 9e937e985..b37606530 100755 --- a/scripts/tests/bindings.lua +++ b/scripts/tests/bindings.lua @@ -43,6 +43,8 @@ function test_process() assert_equal("function", _G.type(eressea.process.magic)) assert_equal("function", _G.type(eressea.process.give_control)) assert_equal("function", _G.type(eressea.process.regeneration)) + assert_equal("function", _G.type(eressea.process.guard_on)) + assert_equal("function", _G.type(eressea.process.guard_off)) end function test_settings() diff --git a/scripts/tests/orders.lua b/scripts/tests/orders.lua index d2d95b743..b46e0c1c7 100755 --- a/scripts/tests/orders.lua +++ b/scripts/tests/orders.lua @@ -229,3 +229,10 @@ function test_process_regeneration() eressea.process.regeneration() end +function test_process_guard_on() + eressea.process.guard_on() +end + +function test_process_guard_off() + eressea.process.guard_off() +end diff --git a/src/bindings/bind_process.c b/src/bindings/bind_process.c index c52d66f8e..926655e66 100755 --- a/src/bindings/bind_process.c +++ b/src/bindings/bind_process.c @@ -211,6 +211,14 @@ void process_give_control(void) { process_cmd(K_CONTACT, give_control_cmd, 0); } +void process_guard_on(void) { + process_cmd(K_GUARD, guard_on_cmd, PROC_LAND_REGION); +} + +void process_guard_off(void) { + process_cmd(K_GUARD, guard_off_cmd, PROC_LAND_REGION); +} + void process_regeneration(void) { monthly_healing(); regenerate_aura(); diff --git a/src/bindings/bind_process.h b/src/bindings/bind_process.h index 61bc5e573..4a9ebc147 100755 --- a/src/bindings/bind_process.h +++ b/src/bindings/bind_process.h @@ -35,6 +35,8 @@ void process_enter(int final); void process_magic(void); void process_give_control(void); void process_regeneration(void); +void process_guard_on(void); +void process_guard_off(void); #ifdef __cplusplus } diff --git a/src/bindings/process.pkg b/src/bindings/process.pkg index 5a86b632d..bf6f4a83c 100755 --- a/src/bindings/process.pkg +++ b/src/bindings/process.pkg @@ -32,5 +32,7 @@ module eressea { void process_magic @ magic(void); /* CAST */ void process_give_control @ give_control(void); /* GIVE CONTROL */ void process_regeneration @ regeneration(void); /* regen health & aura */ + void process_guard_on @ guard_on(void); /* GUARD */ + void process_guard_off @ guard_off(void); /* GUARD NOT */ } } diff --git a/src/gamecode/laws.c b/src/gamecode/laws.c index 313c68469..82ebc4034 100755 --- a/src/gamecode/laws.c +++ b/src/gamecode/laws.c @@ -2769,7 +2769,7 @@ int origin_cmd(unit * u, struct order *ord) return 0; } -static int guard_off_cmd(unit * u, struct order *ord) +int guard_off_cmd(unit * u, struct order *ord) { assert(get_keyword(ord) == K_GUARD); init_tokens(ord); @@ -2930,7 +2930,7 @@ void update_guards(void) } } -static int guard_on_cmd(unit * u, struct order *ord) +int guard_on_cmd(unit * u, struct order *ord) { assert(get_keyword(ord) == K_GUARD); diff --git a/src/gamecode/laws.h b/src/gamecode/laws.h index 583a07af3..0d4cbd614 100755 --- a/src/gamecode/laws.h +++ b/src/gamecode/laws.h @@ -79,6 +79,8 @@ extern "C" { extern int renumber_cmd(struct unit *u, struct order *ord); extern int combatspell_cmd(struct unit *u, struct order *ord); extern int contact_cmd(struct unit *u, struct order *ord); + extern int guard_on_cmd(struct unit *u, struct order *ord); + extern int guard_off_cmd(struct unit *u, struct order *ord); #ifdef __cplusplus }