From 79de2ba2ed747fa7c051f26cd3fe2205624c7a91 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 1 May 2017 13:26:17 +0200 Subject: [PATCH] compatibility code for old data that contains a caldera. --- src/helpers.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/helpers.c b/src/helpers.c index 59695e9b4..e30daf278 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -18,6 +18,7 @@ without prior permission by the authors of Eressea. #include #include #include +#include #include #include #include @@ -455,6 +456,21 @@ use_item_lua(unit *u, const item_type *itype, int amount, struct order *ord) return result; } +/* compat code for old data files */ +static int caldera_read(trigger * t, struct gamedata *data) +{ + UNUSED_ARG(t); + read_building_reference(data); + return AT_READ_FAIL; +} + +struct trigger_type tt_caldera = { + "caldera", + NULL, NULL, NULL, NULL, + caldera_read +}; + + int tolua_toid(lua_State * L, int idx, int def) { int no = 0; @@ -471,6 +487,7 @@ int tolua_toid(lua_State * L, int idx, int def) void register_tolua_helpers(void) { + tt_register(&tt_caldera); at_register(&at_direction); at_register(&at_building_action);