From a6fed5829c180420c7162f485045b0304bb39dce Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 7 Oct 2022 19:40:57 +0300 Subject: [PATCH 28/28] Drop unused 'enum hut_behavior' See osdn #44903 Signed-off-by: Marko Lindqvist --- common/extras.c | 3 +-- common/unittype.h | 2 -- server/advisors/autoexplorer.c | 2 +- server/animals.c | 3 +-- server/gamehand.c | 4 ++-- server/generator/startpos.c | 9 +++++---- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/common/extras.c b/common/extras.c index 31cca0029b..55d794b76d 100644 --- a/common/extras.c +++ b/common/extras.c @@ -545,6 +545,7 @@ static bool can_extra_be_removed(const struct extra_type *pextra, /************************************************************************//** Tells if player can remove extra from tile with suitable unit. + Entering or Frightening huts are not considered. ****************************************************************************/ bool player_can_remove_extra(const struct extra_type *pextra, const struct player *pplayer, @@ -554,7 +555,6 @@ bool player_can_remove_extra(const struct extra_type *pextra, return FALSE; } - /* For huts, it's not checked if player has any non-HUT_NOTHING units */ return are_reqs_active(&(const struct req_context) { .player = pplayer, .tile = ptile, @@ -572,7 +572,6 @@ bool can_remove_extra(const struct extra_type *pextra, const struct unit *punit, const struct tile *ptile) { - if (!can_extra_be_removed(pextra, ptile)) { return FALSE; } diff --git a/common/unittype.h b/common/unittype.h index 3cb782b957..51340d344f 100644 --- a/common/unittype.h +++ b/common/unittype.h @@ -130,8 +130,6 @@ BV_DEFINE(bv_utypes, U_LAST); /* Used in the network protocol. */ BV_DEFINE(bv_unit_classes, UCL_LAST); -enum hut_behavior { HUT_NORMAL, HUT_NOTHING, HUT_FRIGHTEN }; - enum move_level { MOVE_NONE, MOVE_PARTIAL, MOVE_FULL }; struct extra_type_list; diff --git a/server/advisors/autoexplorer.c b/server/advisors/autoexplorer.c index 9817855a41..273bde8ad3 100644 --- a/server/advisors/autoexplorer.c +++ b/server/advisors/autoexplorer.c @@ -209,7 +209,7 @@ static int explorer_desirable(struct tile *ptile, struct player *pplayer, /* First do some checks that would make a tile completely non-desirable. * If we're a barbarian and the tile has a hut, don't go there. */ - /* FIXME: HUT_NOTHING ok */ + /* FIXME: Would be ok for a unit that does not enter or frighten hut */ if (is_barbarian(pplayer) && hut_on_tile(ptile)) { return 0; } diff --git a/server/animals.c b/server/animals.c index 6723351cbc..67f27b53fd 100644 --- a/server/animals.c +++ b/server/animals.c @@ -24,7 +24,6 @@ #include "research.h" #include "tech.h" #include "tile.h" -#include "unittype.h" /* server */ #include "aiiface.h" @@ -60,7 +59,7 @@ static void place_animal(struct player *plr, int sqrdist) extra_type_by_rmcause_iterate(ERM_ENTER, pextra) { if (tile_has_extra(ptile, pextra)) { /* Animals should not displace huts */ - /* FIXME: might HUT_NOTHING animals appear here? */ + /* FIXME: could animals not entering nor frightening huts appear here? */ return; } } extra_type_by_rmcause_iterate_end; diff --git a/server/gamehand.c b/server/gamehand.c index 19cd77bde3..9f21c00135 100644 --- a/server/gamehand.c +++ b/server/gamehand.c @@ -188,10 +188,10 @@ static struct tile *place_starting_unit(struct tile *starttile, fc_assert_ret_val(!is_non_allied_unit_tile(ptile, pplayer), NULL); /* For scenarios or dispersion, huts may coincide with player starts (in - * other cases, huts are avoided as start positions). Remove any such hut, + * other cases, huts are avoided as start positions). Remove any such hut, * and make sure to tell the client, since we may have already sent this * tile (with the hut) earlier: */ - /* FIXME: don't remove under a HUT_NOTHING unit */ + /* FIXME: don't remove under a unit that can't enter or frighten hut */ extra_type_by_rmcause_iterate(ERM_ENTER, pextra) { if (tile_has_extra(ptile, pextra)) { tile_extra_rm_apply(ptile, pextra); diff --git a/server/generator/startpos.c b/server/generator/startpos.c index 13b234d70d..9428c7cea6 100644 --- a/server/generator/startpos.c +++ b/server/generator/startpos.c @@ -191,10 +191,10 @@ static bool is_valid_start_pos(const struct tile *ptile, const void *dataptr) struct islands_data_type *island; int cont_size, cont = tile_continent(ptile); - /* Only start on certain terrain types. */ + /* Only start on certain terrain types. */ if (pdata->value[tile_index(ptile)] < pdata->min_value) { - return FALSE; - } + return FALSE; + } fc_assert_ret_val(cont > 0, FALSE); if (islands[islands_index[cont]].starters == 0) { @@ -202,7 +202,7 @@ static bool is_valid_start_pos(const struct tile *ptile, const void *dataptr) } /* Don't start on a hut. */ - /* FIXME: for HUT_NOTHING might be valid */ + /* FIXME: Could be ok for unit not entering or frightening hut */ if (hut_on_tile(ptile)) { return FALSE; } @@ -243,6 +243,7 @@ static bool is_valid_start_pos(const struct tile *ptile, const void *dataptr) return FALSE; } } map_startpos_iterate_end; + return TRUE; } -- 2.35.1