Bug #2328 » 0085-Drop-nonfunctional-cm-parameter-allow_specialists.patch
| ai/default/daihand.c | ||
|---|---|---|
|
cm_init_parameter(&cmp);
|
||
|
cmp.require_happy = TRUE; /* Note this one */
|
||
|
cmp.allow_disorder = FALSE;
|
||
|
cmp.allow_specialists = TRUE;
|
||
|
cmp.factor[O_FOOD] = 20;
|
||
|
cmp.minimal_surplus[O_GOLD] = -FC_INFINITY;
|
||
| client/agents/cma_fec.c | ||
|---|---|---|
|
.minimal_surplus = {0, 0, 0, -20, 0, 0},
|
||
|
.require_happy = FALSE,
|
||
|
.allow_disorder = FALSE,
|
||
|
.allow_specialists = TRUE,
|
||
|
.factor = {10, 5, 0, 4, 0, 4},
|
||
|
.happy_factor = 25
|
||
|
},
|
||
| ... | ... | |
|
.minimal_surplus = {-20, 0, 0, -20, 0, 0},
|
||
|
.require_happy = FALSE,
|
||
|
.allow_disorder = FALSE,
|
||
|
.allow_specialists = TRUE,
|
||
|
.factor = {25, 5, 0, 4, 0, 4},
|
||
|
.happy_factor = 0
|
||
|
},
|
||
| ... | ... | |
|
.minimal_surplus = {0, -20, 0, -20, 0, 0},
|
||
|
.require_happy = FALSE,
|
||
|
.allow_disorder = FALSE,
|
||
|
.allow_specialists = TRUE,
|
||
|
.factor = {10, 25, 0, 4, 0, 4},
|
||
|
.happy_factor = 0
|
||
|
},
|
||
| ... | ... | |
|
.minimal_surplus = {0, 0, 0, -20, 0, 0},
|
||
|
.require_happy = FALSE,
|
||
|
.allow_disorder = FALSE,
|
||
|
.allow_specialists = TRUE,
|
||
|
.factor = {10, 5, 0, 25, 0, 4},
|
||
|
.happy_factor = 0
|
||
|
},
|
||
| ... | ... | |
|
.minimal_surplus = {0, 0, 0, -20, 0, 0},
|
||
|
.require_happy = FALSE,
|
||
|
.allow_disorder = FALSE,
|
||
|
.allow_specialists = TRUE,
|
||
|
.factor = {10, 5, 0, 4, 0, 25},
|
||
|
.happy_factor = 0
|
||
|
}
|
||
| client/gui-qt/citydlg.cpp | ||
|---|---|---|
|
struct cm_parameter param;
|
||
|
QByteArray ask_bytes = ask->input_edit.text().toUtf8();
|
||
|
QString text = ask_bytes.data();
|
||
|
if (!text.isEmpty()) {
|
||
|
param.allow_disorder = false;
|
||
|
param.allow_specialists = true;
|
||
|
param.require_happy = cma_celeb_checkbox->isChecked();
|
||
|
param.max_growth = cma_max_growth->isChecked();
|
||
|
param.happy_factor = slider_tab[2 * O_LAST + 1]->value();
|
||
| ... | ... | |
|
struct cm_parameter param;
|
||
|
param.allow_disorder = false;
|
||
|
param.allow_specialists = true;
|
||
|
param.require_happy = cma_celeb_checkbox->isChecked();
|
||
|
param.max_growth = cma_max_growth->isChecked();
|
||
|
param.happy_factor = slider_tab[2 * O_LAST + 1]->value();
|
||
| client/options.c | ||
|---|---|---|
|
parameter.happy_factor =
|
||
|
secfile_lookup_int_default(file, 0, "cma.preset%d.happyfactor", i);
|
||
|
parameter.allow_disorder = FALSE;
|
||
|
parameter.allow_specialists = TRUE;
|
||
|
cmafec_preset_add(name, ¶meter);
|
||
|
}
|
||
| common/aicore/cm.c | ||
|---|---|---|
|
if (p1->allow_disorder != p2->allow_disorder) {
|
||
|
return FALSE;
|
||
|
}
|
||
|
if (p1->allow_specialists != p2->allow_specialists) {
|
||
|
return FALSE;
|
||
|
}
|
||
|
if (p1->happy_factor != p2->happy_factor) {
|
||
|
return FALSE;
|
||
|
}
|
||
| ... | ... | |
|
dest->happy_factor = 1;
|
||
|
dest->require_happy = FALSE;
|
||
|
dest->allow_disorder = FALSE;
|
||
|
dest->allow_specialists = TRUE;
|
||
|
dest->max_growth = FALSE;
|
||
|
}
|
||
| ... | ... | |
|
dest->happy_factor = 1;
|
||
|
dest->require_happy = FALSE;
|
||
|
dest->allow_disorder = TRUE;
|
||
|
dest->allow_specialists = TRUE;
|
||
|
dest->max_growth = FALSE;
|
||
|
}
|
||
| common/aicore/cm.h | ||
|---|---|---|
|
bool max_growth;
|
||
|
bool require_happy;
|
||
|
bool allow_disorder;
|
||
|
bool allow_specialists;
|
||
|
int factor[O_LAST];
|
||
|
int happy_factor;
|
||
| common/networking/dataio_json.c | ||
|---|---|---|
|
json_boolean(param->require_happy));
|
||
|
e |= json_object_set_new(obj, "allow_disorder",
|
||
|
json_boolean(param->allow_disorder));
|
||
|
e |= json_object_set_new(obj, "allow_specialists",
|
||
|
json_boolean(param->allow_specialists));
|
||
|
e |= json_object_set_new(obj, "happy_factor",
|
||
|
json_integer(param->happy_factor));
|
||
|
e |= plocation_write_data(d_out->json, location, obj);
|
||
| ... | ... | |
|
return FALSE;
|
||
|
}
|
||
|
location->sub_location->name = "allow_specialists";
|
||
|
if (!dio_get_bool8_json(pc, din, location, ¶m->allow_specialists)) {
|
||
|
log_packet("Corrupt cm_parameter.allow_specialists");
|
||
|
FC_FREE(location->sub_location);
|
||
|
FC_FREE(location->sub_location);
|
||
|
return FALSE;
|
||
|
}
|
||
|
location->sub_location->name = "happy_factor";
|
||
|
if (!dio_get_uint16_json(pc, din, location, ¶m->happy_factor)) {
|
||
|
log_packet("Corrupt cm_parameter.happy_factor");
|
||
| common/networking/dataio_raw.c | ||
|---|---|---|
|
e |= dio_put_bool8_raw(d_out, param->max_growth);
|
||
|
e |= dio_put_bool8_raw(d_out, param->require_happy);
|
||
|
e |= dio_put_bool8_raw(d_out, param->allow_disorder);
|
||
|
e |= dio_put_bool8_raw(d_out, param->allow_specialists);
|
||
|
for (i = 0; i < O_LAST; i++) {
|
||
|
e |= dio_put_uint16_raw(d_out, param->factor[i]);
|
||
| ... | ... | |
|
if (!dio_get_bool8_raw(din, ¶m->max_growth)
|
||
|
|| !dio_get_bool8_raw(din, ¶m->require_happy)
|
||
|
|| !dio_get_bool8_raw(din, ¶m->allow_disorder)
|
||
|
|| !dio_get_bool8_raw(din, ¶m->allow_specialists)) {
|
||
|
|| !dio_get_bool8_raw(din, ¶m->allow_disorder)) {
|
||
|
log_packet("Got a bad cm_parameter");
|
||
|
return FALSE;
|
||
|
}
|
||
| server/cityturn.c | ||
|---|---|---|
|
cmp->require_happy = FALSE;
|
||
|
cmp->allow_disorder = FALSE;
|
||
|
cmp->allow_specialists = TRUE;
|
||
|
/* We used to look at pplayer->ai.xxx_priority to determine the values
|
||
|
* to be used here. However that doesn't work at all because those values
|
||
| server/savegame/savecompat.c | ||
|---|---|---|
|
sg_check_ret();
|
||
|
log_debug("Upgrading data from savegame to version 3.4.0");
|
||
|
player_slots_iterate(pslot) {
|
||
|
int plrno = player_slot_index(pslot);
|
||
|
int ncities;
|
||
|
int cnro;
|
||
|
if (secfile_section_lookup(loading->file, "player%d", plrno) == nullptr) {
|
||
|
continue;
|
||
|
}
|
||
|
ncities = secfile_lookup_int_default(loading->file, 0,
|
||
|
"player%d.dc_total", plrno);
|
||
|
for (cnro = 0; cnro < ncities; cnro++) {
|
||
|
secfile_entry_ignore(loading->file, "player%d.c%d.allow_specialists",
|
||
|
plrno, cnro);
|
||
|
}
|
||
|
} player_slots_iterate_end;
|
||
|
}
|
||
|
/************************************************************************//**
|
||
| ... | ... | |
|
if (game_version < 3039100) {
|
||
|
/* Before version number bump to 3.3.91 */
|
||
|
player_slots_iterate(pslot) {
|
||
|
int plrno = player_slot_index(pslot);
|
||
|
int ncities;
|
||
|
int cnro;
|
||
|
if (secfile_section_lookup(loading->file, "player%d", plrno) == nullptr) {
|
||
|
continue;
|
||
|
}
|
||
|
ncities = secfile_lookup_int_default(loading->file, 0,
|
||
|
"player%d.dc_total", plrno);
|
||
|
for (cnro = 0; cnro < ncities; cnro++) {
|
||
|
secfile_entry_ignore(loading->file, "player%d.c%d.allow_specialists",
|
||
|
plrno, cnro);
|
||
|
}
|
||
|
} player_slots_iterate_end;
|
||
|
} /* Version < 3.3.91 */
|
||
|
#endif /* FREECIV_DEV_SAVE_COMPAT_3_4 */
|
||
| server/savegame/savegame3.c | ||
|---|---|---|
|
loading->file, FALSE, "%s.require_happy", citystr);
|
||
|
param->allow_disorder = secfile_lookup_bool_default(
|
||
|
loading->file, FALSE, "%s.allow_disorder", citystr);
|
||
|
param->allow_specialists = secfile_lookup_bool_default(
|
||
|
loading->file, FALSE, "%s.allow_specialists", citystr);
|
||
|
param->happy_factor = secfile_lookup_int_default(
|
||
|
loading->file, 0, "%s.happy_factor", citystr);
|
||
|
pcity->cm_parameter = param;
|
||
| ... | ... | |
|
citystr);
|
||
|
secfile_entry_ignore(loading->file, "%s.allow_disorder",
|
||
|
citystr);
|
||
|
secfile_entry_ignore(loading->file, "%s.allow_specialists",
|
||
|
citystr);
|
||
|
secfile_entry_ignore(loading->file, "%s.happy_factor",
|
||
|
citystr);
|
||
|
}
|
||
| ... | ... | |
|
"%s.require_happy", buf);
|
||
|
secfile_insert_bool(saving->file, pcity->cm_parameter->allow_disorder,
|
||
|
"%s.allow_disorder", buf);
|
||
|
secfile_insert_bool(saving->file,
|
||
|
pcity->cm_parameter->allow_specialists,
|
||
|
"%s.allow_specialists", buf);
|
||
|
secfile_insert_int(saving->file, pcity->cm_parameter->happy_factor,
|
||
|
"%s.happy_factor", buf);
|
||
|
} else {
|
||
| ... | ... | |
|
secfile_insert_bool(saving->file, FALSE, "%s.max_growth", buf);
|
||
|
secfile_insert_bool(saving->file, FALSE, "%s.require_happy", buf);
|
||
|
secfile_insert_bool(saving->file, FALSE, "%s.allow_disorder", buf);
|
||
|
secfile_insert_bool(saving->file, FALSE, "%s.allow_specialists", buf);
|
||
|
secfile_insert_int(saving->file, 0, "%s.happy_factor", buf);
|
||
|
}
|
||
- « Previous
- 1
- 2
- Next »