Skip to content

Commit

Permalink
Merge pull request #765 from cazfi/srvup
Browse files Browse the repository at this point in the history
  • Loading branch information
cazfi authored Oct 19, 2023
2 parents 325d53b + 00e8e07 commit 93bf782
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 311 deletions.
14 changes: 6 additions & 8 deletions freeciv-web/src/main/webapp/javascript/action_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,12 @@ function popup_action_selection(actor_unit, action_probabilities,
}

for (var action_id = 0; action_id < ACTION_COUNT; action_id++) {
if (action_id != ACTION_UNUSED_1 && action_id != ACTION_UNUSED_2) {
if (actions[action_id]['tgt_kind'] == tgt_kind
&& action_prob_possible(
action_probabilities[action_id])) {
buttons.push(create_act_sel_button(id, actor_unit['id'],
tgt_id, sub_tgt_id, action_id,
action_probabilities));
}
if (actions[action_id]['tgt_kind'] == tgt_kind
&& action_prob_possible(
action_probabilities[action_id])) {
buttons.push(create_act_sel_button(id, actor_unit['id'],
tgt_id, sub_tgt_id, action_id,
action_probabilities));
}
}
}
Expand Down
46 changes: 22 additions & 24 deletions freeciv-web/src/main/webapp/javascript/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -1669,32 +1669,30 @@ function do_unit_paradrop_to(punit, ptile)
var paradrop_action = null;

for (act_id = 0; act_id < ACTION_COUNT; act_id++) {
if (action_id != ACTION_UNUSED_1 && action_id != ACTION_UNUSED_2) {
var paction = action_by_number(act_id);
var paction = action_by_number(act_id);

if (!(action_has_result(paction, ACTRES_PARADROP_CONQUER)
|| action_has_result(paction, ACTRES_PARADROP))) {
/* Not relevant. */
continue;
}
if (!(action_has_result(paction, ACTRES_PARADROP_CONQUER)
|| action_has_result(paction, ACTRES_PARADROP))) {
/* Not relevant. */
continue;
}

if (utype_can_do_action(unit_type(punit), act_id)) {
if (paradrop_action == null) {
/* This is the first possible paradrop action. */
paradrop_action = paction;
} else {
/* More than one paradrop action may be possible. The user must
* choose. Have the server record that an action decision is wanted
* for this unit so the dialog will be brought up. */
var packet = {
"pid" : packet_unit_sscs_set,
"unit_id" : punit['id'],
"type" : USSDT_QUEUE,
"value" : ptile['index']
};
send_request(JSON.stringify(packet));
return;
}
if (utype_can_do_action(unit_type(punit), act_id)) {
if (paradrop_action == null) {
/* This is the first possible paradrop action. */
paradrop_action = paction;
} else {
/* More than one paradrop action may be possible. The user must
* choose. Have the server record that an action decision is wanted
* for this unit so the dialog will be brought up. */
var packet = {
"pid" : packet_unit_sscs_set,
"unit_id" : punit['id'],
"type" : USSDT_QUEUE,
"value" : ptile['index']
};
send_request(JSON.stringify(packet));
return;
}
}
}
Expand Down
44 changes: 22 additions & 22 deletions freeciv-web/src/main/webapp/javascript/fc_types.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,28 +197,28 @@ var ACTION_UPGRADE_UNIT = 42;
var ACTION_CONVERT = 43;
var ACTION_AIRLIFT = 44;
var ACTION_ATTACK = 45;
var ACTION_SUICIDE_ATTACK = 46;
var ACTION_STRIKE_BUILDING = 47;
var ACTION_STRIKE_PRODUCTION = 48;
var ACTION_CONQUER_CITY = 49;
var ACTION_CONQUER_CITY2 = 50;
var ACTION_CONQUER_CITY3 = 51;
var ACTION_CONQUER_CITY4 = 52;
var ACTION_BOMBARD = 53;
var ACTION_BOMBARD2 = 54;
var ACTION_BOMBARD3 = 55;
var ACTION_BOMBARD_LETHAL = 56;
var ACTION_FORTIFY = 57;
var ACTION_CULTIVATE = 58;
var ACTION_PLANT = 59;
var ACTION_TRANSFORM_TERRAIN = 60;
var ACTION_ROAD = 61;
var ACTION_IRRIGATE = 62;
var ACTION_MINE = 63;
var ACTION_BASE = 64;
var ACTION_PILLAGE = 65;
var ACTION_UNUSED_1 = 66;
var ACTION_UNUSED_2 = 67;
var ACTION_ATTACK2 = 46;
var ACTION_SUICIDE_ATTACK = 47;
var ACTION_SUICIDE_ATTACK2 = 48;
var ACTION_STRIKE_BUILDING = 49;
var ACTION_STRIKE_PRODUCTION = 50;
var ACTION_CONQUER_CITY = 51;
var ACTION_CONQUER_CITY2 = 52;
var ACTION_CONQUER_CITY3 = 53;
var ACTION_CONQUER_CITY4 = 54;
var ACTION_BOMBARD = 55;
var ACTION_BOMBARD2 = 56;
var ACTION_BOMBARD3 = 57;
var ACTION_BOMBARD_LETHAL = 58;
var ACTION_FORTIFY = 59;
var ACTION_CULTIVATE = 60;
var ACTION_PLANT = 61;
var ACTION_TRANSFORM_TERRAIN = 62;
var ACTION_ROAD = 63;
var ACTION_IRRIGATE = 64;
var ACTION_MINE = 65;
var ACTION_BASE = 66;
var ACTION_PILLAGE = 67;
var ACTION_TRANSPORT_BOARD = 68;
var ACTION_TRANSPORT_BOARD2 = 69;
var ACTION_TRANSPORT_BOARD3 = 70;
Expand Down
8 changes: 4 additions & 4 deletions freeciv/apply_patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# osdn #????? is ticket in freeciv.org tracker:
# https://osdn.net/projects/freeciv/ticket/?????
#
# 0013-Meson-Replace-boolean-ruledit-option-with-tools-arra.patch
# Refactor meson options
# osdn #48700
# 0031-Lua-Always-pass-lua_Integer-to-API_TYPE_INT.patch
# Lua API fix
# osdn #48722
Expand Down Expand Up @@ -38,6 +35,9 @@
# 0050-Correct-filling-of-territory-claiming-extras-cache.patch
# Fix terr claiming extras cache
# osdn #48838
# 0025-Autoworkers-Use-ADV_WANTS_EQ-for-comparing-tile-valu.patch
# Autoworkers work value fix
# osdn #48842

# Not in the upstream Freeciv server
# ----------------------------------
Expand All @@ -60,7 +60,6 @@ declare -a GIT_PATCHLIST=(
)

declare -a PATCHLIST=(
"backports/0013-Meson-Replace-boolean-ruledit-option-with-tools-arra"
"backports/0031-Lua-Always-pass-lua_Integer-to-API_TYPE_INT"
"backports/0042-Meson-Make-manual-generator-build-optional"
"backports/0036-tile_move_cost_ptrs-Make-cardinal_move-signed"
Expand All @@ -71,6 +70,7 @@ declare -a PATCHLIST=(
"backports/0064-featured_text.-ch-Replace-NULL-with-nullptr"
"backports/0050-Cache-territory-claiming-base-types"
"backports/0050-Correct-filling-of-territory-claiming-extras-cache"
"backports/0025-Autoworkers-Use-ADV_WANTS_EQ-for-comparing-tile-valu"
"meson_webperimental"
"metachange"
"text_fixes"
Expand Down
Loading

0 comments on commit 93bf782

Please sign in to comment.