132 #define log_sg qCritical
134 #define sg_check_ret(...) \
138 #define sg_check_ret_val(_val) \
143 #define sg_warn(condition, message, ...) \
144 if (!(condition)) { \
145 log_sg(message, ##__VA_ARGS__); \
147 #define sg_warn_ret(condition, message, ...) \
148 if (!(condition)) { \
149 log_sg(message, ##__VA_ARGS__); \
152 #define sg_warn_ret_val(condition, _val, message, ...) \
153 if (!(condition)) { \
154 log_sg(message, ##__VA_ARGS__); \
158 #define sg_failure_ret(condition, message, ...) \
159 if (!(condition)) { \
160 sg_success = false; \
161 log_sg(message, ##__VA_ARGS__); \
164 #define sg_failure_ret_val(condition, _val, message, ...) \
165 if (!(condition)) { \
166 sg_success = false; \
167 log_sg(message, ##__VA_ARGS__); \
168 sg_check_ret_val(_val); \
176 #define hex_chars "0123456789abcdef"
195 #define ORDER_OLD_BUILD_CITY (-1)
196 #define ORDER_OLD_DISBAND (-2)
197 #define ORDER_OLD_BUILD_WONDER (-3)
198 #define ORDER_OLD_TRADE_ROUTE (-4)
199 #define ORDER_OLD_HOMECITY (-5)
201 struct tile *tgt_tile);
static void road(QVariant data1, QVariant data2)
Action "Build Road" for choice dialog.
static void base(QVariant data1, QVariant data2)
Action "Build Base" for choice dialog.
struct extra_type * resource_by_identifier(const char identifier)
Return the resource type matching the identifier, or nullptr when none matches.
int sg_order_to_action(int order, struct unit *act_unit, struct tile *tgt_tile)
Returns the action id corresponding to the specified order id.
const char * special_rule_name(enum tile_special_type type)
Return the untranslated name of the given special.
enum barbarian_type barb_type_convert(int old_type)
Convert old barbarian type value to barbarian_type.
void set_unit_activity_road(struct unit *punit, Road_type_id road)
Assign a new road building task to unit.
struct extra_type * special_extra_get(int spe)
Get extra of the given special.
char bin2ascii_hex(int value, int halfbyte_wanted)
This returns an ascii hex value of the given half-byte of the binary integer.
int char2num(char ch)
Converts single character into numerical value.
void sg_load_compat(struct loaddata *loading, enum sgf_version format_class)
Compatibility functions for loaded game.
enum ai_level ai_level_convert(int old_level)
Translate savegame secfile data from earlier development version format to current one.
void set_unit_activity_base(struct unit *punit, Base_type_id base)
Assign a new base building task to unit.
int ascii_hex2bin(char ch, int halfbyte)
This returns a binary integer value of the ascii hex char, offset by the given number of half-bytes.
enum tile_special_type special_by_rule_name(const char *name)
Return the special with the given name, or S_LAST.
void sg_load_post_load_compat(struct loaddata *loading, enum sgf_version format_class)
Compatibility functions for loaded game that needs game state.
int current_compat_ver()
Return current compatibility version.
struct loaddata::@96 trait
const char * secfile_options
struct specialist ** order
struct loaddata::@98 multiplier
struct loaddata::@97 extra
enum tile_special_type * order
struct road_type ** order
enum action_decision * order
struct loaddata::@105 act_dec
struct loaddata::@103 ds_t
struct base_type ** order
struct extra_type ** order
struct loaddata::@93 improvement
struct loaddata::@106 ssa
struct multiplier ** order
enum server_states server_state
struct loaddata::@94 technology
struct loaddata::@104 action
struct loaddata::@101 road
struct loaddata::@99 special
struct loaddata::@100 base
struct loaddata::@95 activities
struct loaddata::@102 specialist
enum diplstate_type * order
struct section_file * file
enum server_side_agent * order