Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. "Read more...":https://support.plan.io/news/187

Bug #874937 ยป 0037-Add-ruleset-control-of-unlimited-airlift-without-cap.patch

Marko Lindqvist, 2021-03-15 03:39 AM

View differences:

client/citydlg_common.c
char dest[512];
int unlimited = 0;
if (game.info.airlifting_style & AIRLIFTING_UNLIMITED_SRC
&& pcity->airlift >= 1) {
/* AIRLIFTING_UNLIMITED_SRC applies only when the source city has
* remaining airlift. */
if ((game.info.airlifting_style & AIRLIFTING_UNLIMITED_SRC)
&& (pcity->airlift >= 1 || game.info.airlift_from_always_enabled)) {
unlimited++;
......
pcity->airlift);
}
if (game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST) {
/* AIRLIFTING_UNLIMITED_DEST works even if the source city has no
* remaining airlift. */
if ((game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST)
&& (pcity->airlift >= 1 || game.info.airlift_to_always_enabled)){
unlimited++;
......
char dest[512];
int unlimited = 0;
if (game.info.airlifting_style & AIRLIFTING_UNLIMITED_SRC
&& pcity->airlift >= 1) {
/* AIRLIFTING_UNLIMITED_SRC applies only when the source city has
* remaining airlift. */
if ((game.info.airlifting_style & AIRLIFTING_UNLIMITED_SRC)
&& (pcity->airlift >= 1 || game.info.airlift_from_always_enabled)) {
unlimited++;
......
fc_snprintf(src, sizeof(src), _("%d"), pcity->airlift);
}
if (game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST) {
/* AIRLIFTING_UNLIMITED_DEST works even if the source city has no
* remaining airlift. */
if ((game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST)
&& (pcity->airlift >= 1 || game.info.airlift_to_always_enabled)){
unlimited++;
client/text.c
const struct city *pcity = src ? tile_city(unit_tile(punit)) : pdest;
fc_assert_ret_val(pcity != NULL, fc_strdup("-"));
if (!src && (game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST)) {
if (!src && ((game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST)
&& game.info.airlift_to_always_enabled)) {
/* No restrictions on destination (and we can infer this even for
* other players' cities). */
this = AL_INFINITE;
} else if (src && ((game.info.airlifting_style & AIRLIFTING_UNLIMITED_SRC)
&& game.info.airlift_from_always_enabled)) {
this = AL_INFINITE;
} else if (client_player() == city_owner(pcity)) {
/* A city we know about. */
int this_cur = pcity->airlift, this_max = city_airlift_max(pcity);
......
&& (game.info.airlifting_style & AIRLIFTING_UNLIMITED_SRC)) {
/* Unlimited capacity. */
this = AL_INFINITE;
} else if (!src
&& (game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST)) {
this = AL_INFINITE;
} else {
/* Limited capacity (possibly zero right now). */
this = AL_FINITE;
common/actions.c
return TRI_MAYBE;
}
if (0 >= actor_city->airlift) {
if (0 >= actor_city->airlift
&& (!(game.info.airlifting_style & AIRLIFTING_UNLIMITED_SRC)
|| !game.info.airlift_from_always_enabled)) {
/* The source cannot airlift for this turn (maybe already airlifted
* or no airport).
*
* Note that (game.info.airlifting_style & AIRLIFTING_UNLIMITED_SRC)
* is not handled here because it applies only when the source city
* has at least one remaining airlift.
* See also do_airline() in server/unittools.h. */
return TRI_NO;
}
common/networking/packets.def
PLAYER aifill;
PERSISTENT_READY persistent_ready;
AIRLIFTING_STYLE airlifting_style;
BOOL airlift_from_always_enabled;
BOOL airlift_to_always_enabled;
UINT8 angrycitizen;
SINT16 base_pollution;
UINT16 base_tech_cost;
common/unit.c
if (NULL == restriction || city_owner(psrc_city) == restriction) {
/* We know for sure whether or not src can airlift this turn. */
if (0 >= psrc_city->airlift) {
if (0 >= psrc_city->airlift
&& (!(game.info.airlifting_style & AIRLIFTING_UNLIMITED_SRC)
|| !game.info.airlift_from_always_enabled)) {
/* The source cannot airlift for this turn (maybe already airlifted
* or no airport).
*
* Note that (game.info.airlifting_style & AIRLIFTING_UNLIMITED_SRC)
* is not handled here because it applies only when the source city
* has at least one remaining airlift.
* See also do_airline() in server/unittools.h. */
return AR_SRC_NO_FLIGHTS;
} /* else, there is capacity; continue to other checks */
......
if (pdest_city) {
if (NULL == restriction || city_owner(pdest_city) == restriction) {
if (0 >= pdest_city->airlift
&& !(game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST)) {
&& (!(game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST)
|| !game.info.airlift_to_always_enabled)) {
/* The destination cannot support airlifted units for this turn
* (maybe already airlifed or no airport).
* See also do_airline() in server/unittools.h. */
data/alien/game.ruleset
; want this to be some 10^n.
output_granularity = 1
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
illness_on = FALSE
data/civ1/game.ruleset
; want this to be some 10^n.
output_granularity = 1
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
illness_on = FALSE
data/civ2/game.ruleset
; want this to be some 10^n.
output_granularity = 1
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
illness_on = FALSE
data/civ2civ3/game.ruleset
; want this to be some 10^n.
output_granularity = 1
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
illness_on = TRUE
data/classic/game.ruleset
; want this to be some 10^n.
output_granularity = 1
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
; There are some latent building effects in effects.ruleset which affect
data/goldkeep/game.ruleset
; want this to be some 10^n.
output_granularity = 1
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
illness_on = TRUE
data/granularity/game.ruleset
; want this to be some 10^n.
output_granularity = 100
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
illness_on = FALSE
data/multiplayer/game.ruleset
; want this to be some 10^n.
output_granularity = 1
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
; There are some latent building effects in effects.ruleset which affect
data/sandbox/game.ruleset
; want this to be some 10^n.
output_granularity = 1
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
illness_on = TRUE
data/stub/game.ruleset
; want this to be some 10^n.
output_granularity = 1
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
illness_on = FALSE
data/webperimental/game.ruleset
; want this to be some 10^n.
output_granularity = 1
; Is it possible to airlift even with zero airlift capacity when
; airliftingstyle server setting has been set to unlimited airlifts?
airlift_from_always_enabled = FALSE
airlift_to_always_enabled = TRUE
[illness]
; Whether plagues (illness) are possible
; There are some latent building effects in effects.ruleset which affect
fc_version
# - No new mandatory capabilities can be added to the release branch; doing
# so would break network capability of supposedly "compatible" releases.
#
NETWORK_CAPSTRING="+Freeciv.Devel-3.2-2021.Mar.14b"
NETWORK_CAPSTRING="+Freeciv.Devel-3.2-2021.Mar.15"
FREECIV_DISTRIBUTOR=""
server/ruleset.c
game.info.granularity = secfile_lookup_int_default(file, 1,
"civstyle.output_granularity");
game.info.airlift_from_always_enabled
= secfile_lookup_bool_default(file, FALSE, "civstyle.airlift_from_always_enabled");
game.info.airlift_to_always_enabled
= secfile_lookup_bool_default(file, TRUE, "civstyle.airlift_to_always_enabled");
/* section: illness */
game.info.illness_on
= secfile_lookup_bool_default(file, RS_DEFAULT_ILLNESS_ON,
server/settings.c
"- \"Allows units to be airlifted to allied cities\" "
"(TO_ALLIES).\n"
"- \"Unlimited units from source city\" (SRC_UNLIMITED): "
"note that airlifting from a city doesn't reduce the "
"airlifted counter, but still needs airlift capacity of "
"at least 1.\n"
"airlifting from a city doesn't reduce the "
"airlifted counter. It depends on the ruleset whether "
"this is possible even with zero airlift capacity.\n"
"- \"Unlimited units to destination city\" "
"(DEST_UNLIMITED): note that airlifting to a city doesn't "
"reduce the airlifted counter, and doesn't need any "
"airlift capacity."),
"(DEST_UNLIMITED): airlifting to a city doesn't "
"reduce the airlifted counter. It depends on the ruleset "
"whether this is possible even with zero airlift capacity."),
NULL, NULL, airliftingstyle_name, GAME_DEFAULT_AIRLIFTINGSTYLE)
GEN_INT("diplchance", game.server.diplchance,
tools/ruleutil/rulesave.c
}
save_default_int(sfile, game.info.granularity,
1, "civstyle.output_granularity", NULL);
save_default_bool(sfile, game.info.airlift_from_always_enabled,
FALSE, "civstyle.airlift_from_always_enabled", NULL);
save_default_bool(sfile, game.info.airlift_to_always_enabled,
TRUE, "civstyle.airlift_to_always_enabled", NULL);
save_default_bool(sfile, game.info.illness_on,
RS_DEFAULT_ILLNESS_ON,
"illness.illness_on", NULL);
    (1-1/1)