Project

General

Profile

Feature #241 ยป 0042-Unhardcode-wld.map-from-actres_possible.patch

Marko Lindqvist, 02/08/2024 04:55 AM

View differences:

common/actions.c
}
/* Hard requirements for results. */
out = actres_possible(paction->result, actor,
out = actres_possible(nmap,
paction->result, actor,
target, target_extra, out, omniscient,
homecity);
common/actres.c
/**********************************************************************//**
Could an action with this kind of result be made?
**************************************************************************/
enum fc_tristate actres_possible(enum action_result result,
enum fc_tristate actres_possible(const struct civ_map *nmap,
enum action_result result,
const struct req_context *actor,
const struct req_context *target,
const struct extra_type *target_extra,
......
struct terrain *pterrain;
bool can_see_tgt_unit;
bool can_see_tgt_tile;
struct civ_map *nmap = &(wld.map);
/* Only check requirement against the target unit if the actor can see it
* or if the evaluator is omniscient. The game checking the rules is
common/actres.h
/* common */
#include "fc_types.h"
#include "world_object.h"
struct req_context;
......
bool actres_removes_extra(enum action_result result,
const struct extra_type *pextra);
enum fc_tristate actres_possible(enum action_result result,
enum fc_tristate actres_possible(const struct civ_map *nmap,
enum action_result result,
const struct req_context *actor,
const struct req_context *target,
const struct extra_type *target_extra,
    (1-1/1)