From adbd351462f71db6a98b681eb9336524cc530092 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sat, 21 Apr 2012 12:46:55 +0400 Subject: [PATCH] Rename units.other[0] to units.active. --- library/RemoteTools.cpp | 2 +- library/modules/Gui.cpp | 4 ++-- library/xml | 2 +- plugins/Dfusion/luafiles/adv_tools/init.lua | 2 +- plugins/Dfusion/luafiles/common.lua | 4 ++-- plugins/Dfusion/luafiles/tools/init.lua | 4 ++-- plugins/advtools.cpp | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/library/RemoteTools.cpp b/library/RemoteTools.cpp index 5e11e0621..b72c0c91d 100644 --- a/library/RemoteTools.cpp +++ b/library/RemoteTools.cpp @@ -402,7 +402,7 @@ static command_result GetWorldInfo(color_ostream &stream, case GAMETYPE_ADVENTURE_MAIN: out->set_mode(GetWorldInfoOut::MODE_ADVENTURE); - if (auto unit = vector_get(world->units.other[0], 0)) + if (auto unit = vector_get(world->units.active, 0)) out->set_player_unit_id(unit->id); if (!ui_advmode) diff --git a/library/modules/Gui.cpp b/library/modules/Gui.cpp index 2eaa4c27e..6841421b6 100644 --- a/library/modules/Gui.cpp +++ b/library/modules/Gui.cpp @@ -194,7 +194,7 @@ bool Gui::view_unit_hotkey(df::viewscreen *top) if (!ui_selected_unit) // allow missing return false; - return vector_get(world->units.other[0], *ui_selected_unit) != NULL; + return vector_get(world->units.active, *ui_selected_unit) != NULL; } bool Gui::unit_inventory_hotkey(df::viewscreen *top) @@ -303,7 +303,7 @@ static df::unit *getAnyUnit(df::viewscreen *top) if (!ui_selected_unit) return NULL; - return vector_get(world->units.other[0], *ui_selected_unit); + return vector_get(world->units.active, *ui_selected_unit); } case LookAround: { diff --git a/library/xml b/library/xml index 521aad437..ee172f69f 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 521aad43799ff65d772e5314972b8bc675500fb3 +Subproject commit ee172f69f613716c8d740bbd22054f48b1a22d5f diff --git a/plugins/Dfusion/luafiles/adv_tools/init.lua b/plugins/Dfusion/luafiles/adv_tools/init.lua index f5fd9a473..5504f32bc 100644 --- a/plugins/Dfusion/luafiles/adv_tools/init.lua +++ b/plugins/Dfusion/luafiles/adv_tools/init.lua @@ -5,7 +5,7 @@ function adv_tools.reincarnate(swap_soul) --only for adventurer i guess if swap_soul==nil then swap_soul=true end - local adv=df.global.world.units.other[0][0] + local adv=df.global.world.units.active[0] if adv.flags1.dead==false then error("You are not dead (yet)!") end diff --git a/plugins/Dfusion/luafiles/common.lua b/plugins/Dfusion/luafiles/common.lua index 7e41dc4e5..951468bc7 100644 --- a/plugins/Dfusion/luafiles/common.lua +++ b/plugins/Dfusion/luafiles/common.lua @@ -472,8 +472,8 @@ function getSelectedUnit() return nil end local unit_indx=df.global.ui_selected_unit - if unit_indx<#df.global.world.units.other[0]-1 then - return df.global.world.units.other[0][unit_indx] + if unit_indx<#df.global.world.units.active-1 then + return df.global.world.units.active[unit_indx] else return nil end diff --git a/plugins/Dfusion/luafiles/tools/init.lua b/plugins/Dfusion/luafiles/tools/init.lua index b01157c87..e3a4607cf 100644 --- a/plugins/Dfusion/luafiles/tools/init.lua +++ b/plugins/Dfusion/luafiles/tools/init.lua @@ -113,7 +113,7 @@ function tools.change_adv(unit,nemesis) if unit==nil then error("Invalid unit!") end - local other=df.global.world.units.other[0] + local other=df.global.world.units.active local unit_indx for k,v in pairs(other) do if v==unit then @@ -157,7 +157,7 @@ function tools.MakeFollow(unit,trgunit) error("Invalid creature") end if trgunit==nil then - trgunit=df.global.world.units.other[0][0] + trgunit=df.global.world.units.active[0] end unit.relations.group_leader_id=trgunit.id local u_nem=getNemesis(unit) diff --git a/plugins/advtools.cpp b/plugins/advtools.cpp index 69841849a..4823d362c 100644 --- a/plugins/advtools.cpp +++ b/plugins/advtools.cpp @@ -169,7 +169,7 @@ bool bodySwap(color_ostream &out, df::unit *player) return false; } - auto &vec = world->units.other[0]; + auto &vec = world->units.active; int idx = linear_index(vec, player); if (idx < 0) @@ -195,7 +195,7 @@ df::nemesis_record *getPlayerNemesis(color_ostream &out, bool restore_swap) if (restore_swap) { - df::unit *ctl = world->units.other[0][0]; + df::unit *ctl = world->units.active[0]; auto ctl_nemesis = Units::getNemesis(ctl); if (ctl_nemesis != real_nemesis)