]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Interpreter.cpp
relocate scripts
[l2e.git] / src / loader / Interpreter.cpp
index ecbb076224e225bad82cd92017c4db9d5caa33fc..d13c3c6424bfbdd60ccc5cefd19d96f85a56440a 100644 (file)
@@ -337,6 +337,7 @@ void Interpreter::ReadObject(int typeId, int id, char *object, const PropertyLis
                                array.data = alloc.Alloc(array.size);
                                array.ref = fd.IsReferenced();
                                arrays.push_back(array);
+                               std::memset(array.data, 0, array.size);
                                char *iter = reinterpret_cast<char *>(array.data);
                                if (i->second->GetLiteral().GetType() == Literal::ARRAY_PROPS) {
                                        const vector<PropertyList *> &list(i->second->GetLiteral().GetPropertyLists());
@@ -958,16 +959,18 @@ void Interpreter::CreateTypeDescriptions() {
                td.SetDescription("A signed integer.");
                td.SetSize(sizeof(int));
        }
-       {;
+       {
                TypeDescription &td(TypeDescription::Create(PATH_ID, "Path"));
                td.SetDescription("A path in the filesystem which is interpreted relative to the source file's location.");
                td.SetSize(1);
                td.AddSupertype(STRING_ID, 0);
        }
        {
+               Script s;
                TypeDescription &td(TypeDescription::Create(SCRIPT_ID, "Script"));
                td.SetDescription("Collection of commands that define a behaviour.");
                td.SetSize(sizeof(Script));
+               td.AddField("text", FieldDescription(((char *)&s.text) - ((char *)&s), STRING_ID).SetAggregate());
        }
        {
                TypeDescription &td(TypeDescription::Create(STRING_ID, "String"));