From 7cc4a7fdab2374df60c78416bc64ca5bf2575cc9 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 9 Feb 2023 20:12:49 +0200 Subject: [PATCH 36/36] Move set_unit_activity_[road|base]() to savegame2.c They are not needed in loading anything newer See osdn #46205 Signed-off-by: Marko Lindqvist --- server/savegame/savecompat.c | 20 -------------------- server/savegame/savecompat.h | 3 --- server/savegame/savegame2.c | 21 +++++++++++++++++++++ 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/server/savegame/savecompat.c b/server/savegame/savecompat.c index 7db130537c..344e96e651 100644 --- a/server/savegame/savecompat.c +++ b/server/savegame/savecompat.c @@ -2888,23 +2888,3 @@ enum barbarian_type barb_type_convert(int old_type) return barbarian_type_invalid(); } - -/************************************************************************//** - Assign a new base building task to unit -****************************************************************************/ -void set_unit_activity_base(struct unit *punit, - Base_type_id base) -{ - set_unit_activity_targeted(punit, ACTIVITY_BASE, - base_extra_get(base_by_number(base))); -} - -/************************************************************************//** - Assign a new road building task to unit -****************************************************************************/ -void set_unit_activity_road(struct unit *punit, - Road_type_id road) -{ - set_unit_activity_targeted(punit, ACTIVITY_GEN_ROAD, - road_extra_get(road_by_number(road))); -} diff --git a/server/savegame/savecompat.h b/server/savegame/savecompat.h index 9f25545c60..b4afc786c3 100644 --- a/server/savegame/savecompat.h +++ b/server/savegame/savecompat.h @@ -212,9 +212,6 @@ struct extra_type *resource_by_identifier(const char identifier); enum ai_level ai_level_convert(int old_level); enum barbarian_type barb_type_convert(int old_type); -void set_unit_activity_base(struct unit *punit, Base_type_id base); -void set_unit_activity_road(struct unit *punit, Road_type_id road); - /* Old savegames might have padding up to this amount of trade routes */ #define MAX_TRADE_ROUTES_OLD 5 diff --git a/server/savegame/savegame2.c b/server/savegame/savegame2.c index 42245778df..7513c4ce74 100644 --- a/server/savegame/savegame2.c +++ b/server/savegame/savegame2.c @@ -556,6 +556,27 @@ static void loaddata_destroy(struct loaddata *loading) free(loading); } + +/************************************************************************//** + Assign a new base building task to unit +****************************************************************************/ +static void set_unit_activity_base(struct unit *punit, + Base_type_id base) +{ + set_unit_activity_targeted(punit, ACTIVITY_BASE, + base_extra_get(base_by_number(base))); +} + +/************************************************************************//** + Assign a new road building task to unit +****************************************************************************/ +static void set_unit_activity_road(struct unit *punit, + Road_type_id road) +{ + set_unit_activity_targeted(punit, ACTIVITY_GEN_ROAD, + road_extra_get(road_by_number(road))); +} + /* ======================================================================= * Helper functions. * ======================================================================= */ -- 2.39.1