From 573d4c3e97300c0553ba4f46a63087ce0b6f3854 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 17 Jun 2012 15:55:23 -0700 Subject: [PATCH] binding HELP to Lua --- scripts/tests/bindings.lua | 1 + src/bindings/bind_process.c | 5 +++++ src/bindings/bind_process.h | 1 + src/bindings/process.pkg | 1 + src/gamecode/laws.c | 7 +------ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/tests/bindings.lua b/scripts/tests/bindings.lua index 8715e501a..bad3d454d 100755 --- a/scripts/tests/bindings.lua +++ b/scripts/tests/bindings.lua @@ -37,6 +37,7 @@ function test_process() assert_equal("function", _G.type(eressea.process.renumber)) assert_equal("function", _G.type(eressea.process.restack)) assert_equal("function", _G.type(eressea.process.set_spells)) + assert_equal("function", _G.type(eressea.process.set_help)) end function test_settings() diff --git a/src/bindings/bind_process.c b/src/bindings/bind_process.c index eb7a72052..ae25eb109 100755 --- a/src/bindings/bind_process.c +++ b/src/bindings/bind_process.c @@ -194,6 +194,11 @@ void process_setspells(void) { process_cmd(K_COMBATSPELL, combatspell_cmd, 0); } +void process_sethelp(void) { + process_cmd(K_ALLY, ally_cmd, 0); +} + + void process_maintenance(void) { region * r; for (r=regions; r; r=r->next) { diff --git a/src/bindings/bind_process.h b/src/bindings/bind_process.h index 804414795..b12cd0c24 100755 --- a/src/bindings/bind_process.h +++ b/src/bindings/bind_process.h @@ -29,6 +29,7 @@ void process_promote(void); void process_renumber(void); void process_restack(void); void process_setspells(void); +void process_sethelp(void); #ifdef __cplusplus } diff --git a/src/bindings/process.pkg b/src/bindings/process.pkg index 7504773fa..5ffab96d2 100755 --- a/src/bindings/process.pkg +++ b/src/bindings/process.pkg @@ -26,5 +26,6 @@ module eressea { void process_renumber @ renumber(void); /* RENUMBER */ void process_restack @ restack(void); /* SORT */ void process_setspells @ set_spells(void); /* COMBATSPELL */ + void process_sethelp @ set_help(void); /* HELP */ } } diff --git a/src/gamecode/laws.c b/src/gamecode/laws.c index 6d0c50ad2..d1fb4a70a 100755 --- a/src/gamecode/laws.c +++ b/src/gamecode/laws.c @@ -3654,6 +3654,7 @@ void update_long_order(unit * u) boolean trade = false; boolean hunger = LongHunger(u); + freset(u, UFL_MOVED); freset(u, UFL_LONGACTION); if (hunger) { /* Hungernde Einheiten führen NUR den default-Befehl aus */ @@ -4428,11 +4429,6 @@ static void maintain_buildings_1(region * r) maintain_buildings(r, false); } -static void reset_moved(unit * u) -{ - freset(u, UFL_MOVED); -} - /** warn about passwords that are not US ASCII. * even though passwords are technically UTF8 strings, the server receives * them as part of the Subject of an email when reports are requested. @@ -4476,7 +4472,6 @@ void init_processor(void) add_proc_order(p, K_GROUP, &group_cmd, 0, NULL); p += 10; - add_proc_unit(p, &reset_moved, "Instant-Befehle"); add_proc_order(p, K_QUIT, &quit_cmd, 0, NULL); add_proc_order(p, K_URSPRUNG, &origin_cmd, 0, NULL); add_proc_order(p, K_ALLY, &ally_cmd, 0, NULL);