follow rename unit.military.squad_index to squad_id in df-structures

develop
jj 2012-10-20 22:35:39 +02:00
parent ffe70e9ee7
commit 1f7a01d685
5 changed files with 8 additions and 8 deletions

@ -292,9 +292,9 @@ void DFHack::describeUnit(BasicUnitInfo *info, df::unit *unit,
if (!unit->custom_profession.empty()) if (!unit->custom_profession.empty())
info->set_custom_profession(unit->custom_profession); info->set_custom_profession(unit->custom_profession);
if (unit->military.squad_index >= 0) if (unit->military.squad_id >= 0)
{ {
info->set_squad_id(unit->military.squad_index); info->set_squad_id(unit->military.squad_id);
info->set_squad_position(unit->military.squad_position); info->set_squad_position(unit->military.squad_position);
} }
} }

@ -93,7 +93,7 @@ orders.race = {
orders.squad = { orders.squad = {
key = function(unit) key = function(unit)
local sidx = unit.military.squad_index local sidx = unit.military.squad_id
if sidx >= 0 then if sidx >= 0 then
return sidx return sidx
end end
@ -102,7 +102,7 @@ orders.squad = {
orders.squad_position = { orders.squad_position = {
key = function(unit) key = function(unit)
local sidx = unit.military.squad_index local sidx = unit.military.squad_id
if sidx >= 0 then if sidx >= 0 then
return sidx * 1000 + unit.military.squad_position return sidx * 1000 + unit.military.squad_position
end end

@ -92,7 +92,7 @@ module DFHack
# filter 'attend meeting' # filter 'attend meeting'
not u.specific_refs.find { |s| s.type == :ACTIVITY } and not u.specific_refs.find { |s| s.type == :ACTIVITY } and
# filter soldiers (TODO check schedule) # filter soldiers (TODO check schedule)
u.military.squad_index == -1 and u.military.squad_id == -1 and
# filter 'on break' # filter 'on break'
not u.status.misc_traits.find { |t| t.id == :OnBreak } not u.status.misc_traits.find { |t| t.id == :OnBreak }
end end

@ -640,7 +640,7 @@ struct military_assign_hook : df::viewscreen_layer_militaryst {
for (int y = y1, i = i1; i <= i2; i++, y++) for (int y = y1, i = i1; i <= i2; i++, y++)
{ {
auto unit = vector_get(positions.candidates, i); auto unit = vector_get(positions.candidates, i);
if (!unit || unit->military.squad_index < 0) if (!unit || unit->military.squad_id < 0)
continue; continue;
for (int x = x1; x <= x2; x++) for (int x = x1; x <= x2; x++)

@ -89,7 +89,7 @@ end
for _,v in ipairs(df.global.world.units.active) do for _,v in ipairs(df.global.world.units.active) do
local x,y,z = dfhack.units.getPosition(v) local x,y,z = dfhack.units.getPosition(v)
if x and dfhack.units.isCitizen(v) and is_in_burrows(xyz2pos(x,y,z)) then if x and dfhack.units.isCitizen(v) and is_in_burrows(xyz2pos(x,y,z)) then
if not in_siege and v.military.squad_index < 0 then if not in_siege and v.military.squad_id < 0 then
add_thought(v, df.unit_thought_type.LackProtection) add_thought(v, df.unit_thought_type.LackProtection)
end end
wake_unit(v) wake_unit(v)