Feature #2054 ยป 0036-Initialize-access_info-at-the-client-side.patch
| client/packhand.c | ||
|---|---|---|
|
void handle_ruleset_terrain_control
|
||
|
(const struct packet_ruleset_terrain_control *p)
|
||
|
{
|
||
|
struct unit_type *access_unit = nullptr;
|
||
|
/* Since terrain_control is the same as packet_ruleset_terrain_control
|
||
|
* we can just copy the data directly. */
|
||
|
terrain_control = *p;
|
||
|
/* terrain_control.move_fragments likely changed */
|
||
|
init_move_fragments();
|
||
|
if (p->access_unit >= 0) {
|
||
|
access_unit = utype_by_number(p->access_unit);
|
||
|
}
|
||
|
access_info_init(access_unit);
|
||
|
}
|
||
|
/************************************************************************//**
|
||
| common/networking/packets.def | ||
|---|---|---|
|
BOOL infrapoints;
|
||
|
STRING gui_type_base0[MAX_LEN_NAME];
|
||
|
STRING gui_type_base1[MAX_LEN_NAME];
|
||
|
SINT16 access_unit;
|
||
|
end
|
||
|
PACKET_RULESETS_READY = 225; sc, lsend
|
||
| server/ruleset/ruleload.c | ||
|---|---|---|
|
int *res_freq;
|
||
|
bool ok = TRUE;
|
||
|
/* parameters */
|
||
|
/* Parameters */
|
||
|
terrain_control.ocean_reclaim_requirement_pct
|
||
|
= secfile_lookup_int_default(file, 101,
|
||
| ... | ... | |
|
"aarea.access_unit");
|
||
|
const struct unit_type *access_unit = nullptr;
|
||
|
terrain_control.access_unit = -1;
|
||
|
if (uname != nullptr && uname[0] != '\0') {
|
||
|
access_unit = unit_type_by_rule_name(uname);
|
||
| ... | ... | |
|
ruleset_error(nullptr, LOG_ERROR, "%s: access unit %s unknown.",
|
||
|
filename, uname);
|
||
|
ok = FALSE;
|
||
|
} else {
|
||
|
terrain_control.access_unit = utype_number(access_unit);
|
||
|
}
|
||
|
}
|
||