binding GUARD to lua

This commit is contained in:
Enno Rehling 2012-06-17 23:13:58 -07:00
parent 64a91a75a1
commit 59665de7ba
7 changed files with 25 additions and 2 deletions

View File

@ -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()

View File

@ -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

View File

@ -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();

View File

@ -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
}

View File

@ -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 */
}
}

View File

@ -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);

View File

@ -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
}