Feature #2276 ยป 0071-Move-resource_by_identifier-to-savegame2.c.patch
| server/savegame/savecompat.c | ||
|---|---|---|
|
return nullptr;
|
||
|
}
|
||
|
/************************************************************************//**
|
||
|
Return the resource type matching the identifier, or nullptr
|
||
|
when none matches.
|
||
|
****************************************************************************/
|
||
|
struct extra_type *resource_by_identifier(const char identifier)
|
||
|
{
|
||
|
extra_type_by_cause_iterate(EC_RESOURCE, presource) {
|
||
|
if (presource->data.resource->id_old_save == identifier) {
|
||
|
return presource;
|
||
|
}
|
||
|
} extra_type_by_cause_iterate_end;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/* =======================================================================
|
||
|
* Compatibility functions for loading a game.
|
||
|
* ======================================================================= */
|
||
| server/savegame/savecompat.h | ||
|---|---|---|
|
const char *special_rule_name(enum tile_special_type type);
|
||
|
struct extra_type *special_extra_get(int spe);
|
||
|
struct extra_type *resource_by_identifier(const char identifier);
|
||
|
enum ai_level ai_level_convert(int old_level);
|
||
|
enum barbarian_type barb_type_convert(int old_type);
|
||
| server/savegame/savegame2.c | ||
|---|---|---|
|
}
|
||
|
}
|
||
|
/************************************************************************//**
|
||
|
Return the resource type matching the identifier, or nullptr
|
||
|
when none matches.
|
||
|
****************************************************************************/
|
||
|
static struct extra_type *resource_by_identifier(const char identifier)
|
||
|
{
|
||
|
extra_type_by_cause_iterate(EC_RESOURCE, presource) {
|
||
|
if (presource->data.resource->id_old_save == identifier) {
|
||
|
return presource;
|
||
|
}
|
||
|
} extra_type_by_cause_iterate_end;
|
||
|
return nullptr;
|
||
|
}
|
||
|
/************************************************************************//**
|
||
|
Return the resource for the given identifier.
|
||
|
****************************************************************************/
|
||