Rename unit_flags1.dead to killed, update submodules/changelog

Follow-up for dfhack/df-structures#247
develop
lethosor 2018-06-21 11:17:09 -04:00
parent 46b6bfd3f7
commit 7a5e7c7c86
8 changed files with 14 additions and 10 deletions

@ -80,6 +80,9 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
- Added ``profiler`` module to measure lua performance
- Enabled shift+cursor movement in WorkshopOverlay-derived screens
## Structures
- ``unit_flags1``: renamed ``dead`` to ``inactive`` to better reflect its use
## Internals
- Added fallback for YouCompleteMe database lookup failures (e.g. for newly-created files)
- jsoncpp: fixed constructor with ``long`` on Linux

@ -676,7 +676,7 @@ static void manageSyndromeEvent(color_ostream& out) {
for ( auto a = df::global::world->units.all.begin(); a != df::global::world->units.all.end(); a++ ) {
df::unit* unit = *a;
/*
if ( unit->flags1.bits.dead )
if ( unit->flags1.bits.inactive )
continue;
*/
for ( size_t b = 0; b < unit->syndromes.active.size(); b++ ) {
@ -723,7 +723,7 @@ static void manageEquipmentEvent(color_ostream& out) {
itemIdToInventoryItem.clear();
currentlyEquipped.clear();
df::unit* unit = *a;
/*if ( unit->flags1.bits.dead )
/*if ( unit->flags1.bits.inactive )
continue;
*/
@ -952,7 +952,7 @@ static void manageUnitAttackEvent(color_ostream& out) {
}
if ( !wound1 && !wound2 ) {
//if ( unit1->flags1.bits.dead || unit2->flags1.bits.dead )
//if ( unit1->flags1.bits.inactive || unit2->flags1.bits.inactive )
// continue;
if ( reportStr.find("severed part") )
continue;

@ -1579,7 +1579,7 @@ bool Units::isActive(df::unit *unit)
{
CHECK_NULL_POINTER(unit);
return !unit->flags1.bits.dead;
return !unit->flags1.bits.inactive;
}
bool Units::isKilled(df::unit *unit)

@ -1 +1 @@
Subproject commit 7daa862b57856098cd7b0fde1f578196df740634
Subproject commit 321bd48b10c4c3f694cc801a7dee6be392c09b7b

@ -95,7 +95,7 @@ static vector<df::unit *> get_units_at(const df::coord pos, bool only_one)
df::unit_flags1 bad_flags;
bad_flags.whole = 0;
bad_flags.bits.dead = true;
bad_flags.bits.inactive = true;
bad_flags.bits.hidden_ambusher = true;
bad_flags.bits.hidden_in_ambush = true;

@ -57,8 +57,9 @@ module DFHack
def unit_category(u)
return if u.flags1.left or u.flags1.incoming
# return if hostile & unit_invisible(u) (hidden_in_ambush or caged+mapblock.hidden or caged+holder.ambush
return :Dead if u.flags1.dead
return :Dead if u.flags2.killed
return :Dead if u.flags3.ghostly # hostile ?
return if u.flags1.inactive
return :Others if !unit_isfortmember(u)
casteflags = u.race_tg.caste[u.caste].flags if u.caste >= 0
return :Livestock if casteflags and (casteflags[:PET] or casteflags[:PET_EXOTIC])
@ -132,7 +133,7 @@ module DFHack
# returns if an unit is openly hostile
# does not include ghosts / wildlife
def unit_ishostile(u)
# return true if u.flags3.ghostly and not u.flags1.dead
# return true if u.flags3.ghostly and not u.flags1.inactive
return unless unit_category(u) == :Others
case unit_other_category(u)

@ -831,7 +831,7 @@ static command_result tweak(color_ostream &out, vector <string> &parameters)
{
// remove ghostly, set to dead instead
unit->flags3.bits.ghostly = 0;
unit->flags1.bits.dead = 1;
unit->flags1.bits.inactive = 1;
}
else
{

@ -1 +1 @@
Subproject commit b065ce4442da88a749f1b90f35d5102ed13b9afb
Subproject commit 56a209a9b460b7eec4f5b3d0c48a18f5235f08db