Merge remote-tracking branch 'jjyg/master'

develop
Alexander Gavrilov 2012-10-21 11:12:32 +04:00
commit 67674a7676
6 changed files with 9 additions and 8 deletions

@ -292,9 +292,9 @@ void DFHack::describeUnit(BasicUnitInfo *info, df::unit *unit,
if (!unit->custom_profession.empty())
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);
}
}

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

@ -48,6 +48,7 @@ module DFHack
end
end
rescue
df.onupdate_unregister self
puts_err "onupdate cb #$!", $!.backtrace
end

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

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

@ -89,7 +89,7 @@ end
for _,v in ipairs(df.global.world.units.active) do
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 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)
end
wake_unit(v)