Rename units.other[0] to units.active.

develop
Alexander Gavrilov 2012-04-21 12:46:55 +04:00
parent 0a6982f404
commit adbd351462
7 changed files with 11 additions and 11 deletions

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

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

@ -1 +1 @@
Subproject commit 521aad43799ff65d772e5314972b8bc675500fb3
Subproject commit ee172f69f613716c8d740bbd22054f48b1a22d5f

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

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

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

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