From 55988e3fc4042af34408f362772c09d9a88b21f9 Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Wed, 8 Apr 2020 08:45:40 +0200 Subject: [PATCH] adapted to updated structures, remote Using units for age --- library/modules/Units.cpp | 2 +- .../remotefortressreader/remotefortressreader.cpp | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/library/modules/Units.cpp b/library/modules/Units.cpp index 07c3a7acf..fa7007574 100644 --- a/library/modules/Units.cpp +++ b/library/modules/Units.cpp @@ -210,7 +210,7 @@ void Units::setNickname(df::unit *unit, std::string nick) break; // We want the nickname to end up in the identity case df::identity_type::Unk_1: // Guess, but that's how it worked in the past - case df::identity_type::Demon_Alias: + case df::identity_type::True_Name: case df::identity_type::Unk_4: // Pure guess, as this is a new case, still unseen id_hfig = df::historical_figure::find(identity->histfig_nemesis_id); break; diff --git a/plugins/remotefortressreader/remotefortressreader.cpp b/plugins/remotefortressreader/remotefortressreader.cpp index 6ab401027..686c32211 100644 --- a/plugins/remotefortressreader/remotefortressreader.cpp +++ b/plugins/remotefortressreader/remotefortressreader.cpp @@ -1693,20 +1693,7 @@ static command_result GetUnitListInside(color_ostream &stream, const BlockReques using df::global::cur_year; using df::global::cur_year_tick; - int year_ticks = 403200; - int birth_time = unit->birth_year * year_ticks + unit->birth_time; - int cur_time = *cur_year * year_ticks + *cur_year_tick; - - if (unit->curse_year >= 0) - { - if (auto identity = Units::getIdentity(unit)) - { - if (identity->histfig_nemesis_id < 0) - birth_time = identity->birth_year * year_ticks + identity->birth_second; - } - } - - send_unit->set_age(cur_time - birth_time); + send_unit->set_age(Units::getAge(unit, false)); ConvertDfColor(Units::getProfessionColor(unit), send_unit->mutable_profession_color()); send_unit->set_flags1(unit->flags1.whole);