LuaAI: rewired caching functions to ai.get_*() instead of ai.get_cached_*()
This commit is contained in:
parent
617404ef11
commit
175d0a84f5
3 changed files with 15 additions and 15 deletions
|
@ -49,20 +49,20 @@ return {
|
|||
|
||||
-- Proxy function section
|
||||
|
||||
function ai.get_cached_dstsrc()
|
||||
return ai.get_cached_item("dstsrc", "get_dstsrc", "dst_src_validator")
|
||||
function ai.get_dstsrc()
|
||||
return ai.get_cached_item("dstsrc", "get_new_dstsrc", "dst_src_validator")
|
||||
end
|
||||
|
||||
function ai.get_cached_srcdst()
|
||||
return ai.get_cached_item("srcdst", "get_srcdst", "dst_src_enemy_validator")
|
||||
function ai.get_srcdst()
|
||||
return ai.get_cached_item("srcdst", "get_new_srcdst", "dst_src_enemy_validator")
|
||||
end
|
||||
|
||||
function ai.get_cached_enemy_dstsrc()
|
||||
return ai.get_cached_item("enemy_dstsrc", "get_enemy_dstsrc", "src_dst_validator")
|
||||
function ai.get_enemy_dstsrc()
|
||||
return ai.get_cached_item("enemy_dstsrc", "get_new_enemy_dstsrc", "src_dst_validator")
|
||||
end
|
||||
|
||||
function ai.get_cached_enemy_srcdst()
|
||||
return ai.get_cached_item("enemy_srcdst", "get_enemy_srcdst", "src_dst_enemy_validator")
|
||||
function ai.get_enemy_srcdst()
|
||||
return ai.get_cached_item("enemy_srcdst", "get_new_enemy_srcdst", "src_dst_enemy_validator")
|
||||
end
|
||||
|
||||
-- End of proxy function section
|
||||
|
|
|
@ -263,13 +263,13 @@ ai_stdlib.init(ai)
|
|||
function my_ai:stage_hello()
|
||||
local debug_utils = wesnoth.require "~add-ons/Wesnoth_Lua_Pack/debug_utils.lua"
|
||||
|
||||
local mm = ai.get_attacks()
|
||||
local mm = ai.get_dstsrc()
|
||||
|
||||
|
||||
--wesnoth.message("type " .. type(mo))
|
||||
--debug_utils.dbms(dstsrc,false,"variable",false)
|
||||
debug_utils.dbms(mm[2].target,false,"variable",false)
|
||||
debug_utils.dbms(mm[2].movements,false,"variable",false)
|
||||
debug_utils.dbms(mm,false,"variable",false)
|
||||
--debug_utils.dbms(mm[2].movements,false,"variable",false)
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -774,10 +774,10 @@ lua_ai_context* lua_ai_context::create(lua_State *L, char const *code, ai::engin
|
|||
static luaL_Reg const callbacks[] = {
|
||||
{ "attack", &cfun_ai_execute_attack },
|
||||
// Move maps
|
||||
{ "get_dstsrc", &cfun_ai_get_dstsrc },
|
||||
{ "get_srcdst", &cfun_ai_get_srcdst },
|
||||
{ "get_enemy_dstsrc", &cfun_ai_get_enemy_dstsrc },
|
||||
{ "get_enemy_srcdst", &cfun_ai_get_enemy_srcdst },
|
||||
{ "get_new_dstsrc", &cfun_ai_get_dstsrc },
|
||||
{ "get_new_srcdst", &cfun_ai_get_srcdst },
|
||||
{ "get_new_enemy_dstsrc", &cfun_ai_get_enemy_dstsrc },
|
||||
{ "get_new_enemy_srcdst", &cfun_ai_get_enemy_srcdst },
|
||||
// End of move maps
|
||||
// Goals and targets
|
||||
{ "get_targets", &cfun_ai_get_targets },
|
||||
|
|
Loading…
Add table
Reference in a new issue