forked from github/server
ignore obsolete "lua" attributes in ancient data files.
fix a small bug in the mechanism for reading deprecated attrib_types.
This commit is contained in:
parent
1ae44db7ca
commit
455b3dc90e
|
@ -81,6 +81,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
#endif
|
||||
|
||||
/* external libraries */
|
||||
#include <storage.h>
|
||||
#include <iniparser.h>
|
||||
#include <critbit.h>
|
||||
|
||||
|
@ -2132,6 +2133,16 @@ bool has_limited_skills(const struct unit * u)
|
|||
}
|
||||
}
|
||||
|
||||
static int read_ext(attrib * a, void *owner, struct storage *store)
|
||||
{
|
||||
int len;
|
||||
|
||||
READ_INT(store, &len);
|
||||
store->api->r_bin(store->handle, NULL, (size_t)len);
|
||||
return AT_READ_OK;
|
||||
}
|
||||
|
||||
|
||||
void attrib_init(void)
|
||||
{
|
||||
/* Alle speicherbaren Attribute müssen hier registriert werden */
|
||||
|
@ -2178,6 +2189,7 @@ void attrib_init(void)
|
|||
at_register(&at_germs);
|
||||
|
||||
at_deprecate("xontormiaexpress", a_readint); /* required for old datafiles */
|
||||
at_deprecate("lua", read_ext); /* required for old datafiles */
|
||||
}
|
||||
|
||||
void kernel_init(void)
|
||||
|
|
|
@ -4701,7 +4701,7 @@ int sp_gooddreams(castorder * co)
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------- */
|
||||
/* Name:
|
||||
/* Name: Seelenkopie / Doppelganger
|
||||
* Stufe: 9
|
||||
* Kategorie:
|
||||
* Wirkung:
|
||||
|
|
|
@ -299,7 +299,7 @@ int a_read(struct storage *store, attrib ** attribs, void *owner)
|
|||
na = a_new(at);
|
||||
}
|
||||
else {
|
||||
const void * kv;
|
||||
const void * kv = 0;
|
||||
cb_find_prefix(&cb_deprecated, zText, strlen(zText) + 1, &kv, 1, 0);
|
||||
if (kv) {
|
||||
cb_get_kv(kv, &reader, sizeof(reader));
|
||||
|
|
Loading…
Reference in New Issue