diff options
Diffstat (limited to 'core/dive.h')
-rw-r--r-- | core/dive.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/dive.h b/core/dive.h index a638cfd0c..51524500f 100644 --- a/core/dive.h +++ b/core/dive.h @@ -570,11 +570,14 @@ static inline struct dive_site *get_dive_site_for_dive(struct dive *dive) return NULL; } -static inline char *get_dive_country(struct dive *dive) +static inline const char *get_dive_country(struct dive *dive) { struct dive_site *ds = get_dive_site_by_uuid(dive->dive_site_uuid); - if (ds && ds->country) - return ds->country; + if (ds) { + int idx = taxonomy_index_for_category(&ds->taxonomy, TC_COUNTRY); + if (idx >= 0) + return ds->taxonomy.category[idx].value; + } return NULL; } |