binding COMBATSPELL to Lua

This commit is contained in:
Enno Rehling 2012-06-17 12:51:48 -07:00
parent d880bf281a
commit d02857ebb9
6 changed files with 9 additions and 1 deletions

View File

@ -36,6 +36,7 @@ function test_process()
assert_equal("function", _G.type(eressea.process.promote)) assert_equal("function", _G.type(eressea.process.promote))
assert_equal("function", _G.type(eressea.process.renumber)) assert_equal("function", _G.type(eressea.process.renumber))
assert_equal("function", _G.type(eressea.process.restack)) assert_equal("function", _G.type(eressea.process.restack))
assert_equal("function", _G.type(eressea.process.set_spells))
end end
function test_settings() function test_settings()

View File

@ -190,6 +190,10 @@ void process_restack(void) {
restack_units(); restack_units();
} }
void process_setspells(void) {
process_cmd(K_COMBATSPELL, combatspell_cmd, 0);
}
void process_maintenance(void) { void process_maintenance(void) {
region * r; region * r;
for (r=regions; r; r=r->next) { for (r=regions; r; r=r->next) {

View File

@ -28,6 +28,7 @@ void process_maintenance(void);
void process_promote(void); void process_promote(void);
void process_renumber(void); void process_renumber(void);
void process_restack(void); void process_restack(void);
void process_setspells(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -25,5 +25,6 @@ module eressea {
void process_promote @ promote(void); /* PROMOTE */ void process_promote @ promote(void); /* PROMOTE */
void process_renumber @ renumber(void); /* RENUMBER */ void process_renumber @ renumber(void); /* RENUMBER */
void process_restack @ restack(void); /* SORT */ void process_restack @ restack(void); /* SORT */
void process_setspells @ set_spells(void); /* COMBATSPELL */
} }
} }

View File

@ -2838,7 +2838,7 @@ int status_cmd(unit * u, struct order *ord)
return 0; return 0;
} }
static int combatspell_cmd(unit * u, struct order *ord) int combatspell_cmd(unit * u, struct order *ord)
{ {
const char *s; const char *s;
int level = 0; int level = 0;

View File

@ -75,6 +75,7 @@ extern "C" {
extern int pay_cmd(struct unit *u, struct order *ord); extern int pay_cmd(struct unit *u, struct order *ord);
extern int promotion_cmd(struct unit *u, struct order *ord); extern int promotion_cmd(struct unit *u, struct order *ord);
extern int renumber_cmd(struct unit *u, struct order *ord); extern int renumber_cmd(struct unit *u, struct order *ord);
extern int combatspell_cmd(struct unit *u, struct order *ord);
#ifdef __cplusplus #ifdef __cplusplus
} }