Fix Object behaviors and SpriteObject animations not properly unserialized with an exisiting object

This commit is contained in:
Florian Rival
2017-10-28 17:13:22 +02:00
parent 8c1028a28b
commit 119d588619
3 changed files with 8 additions and 6 deletions

View File

@@ -38,12 +38,10 @@ before_install:
install:
#Install newIDE tests dependencies
- cd newIDE/app
- npm install
- cd newIDE/app && npm install
- cd ../..
#Install GDJS tests dependencies
- cd GDJS/tests
- npm install
- cd GDJS/tests && npm install
- cd ../..
#Get the correct version of gcc/g++
- if [ "$CXX" = "g++" ]; then export CXX="g++-${GCC_VERSION}" CC="gcc-${GCC_VERSION}"; fi
@@ -56,9 +54,11 @@ install:
script:
#newIDE tests:
- cd newIDE/app && npm test && cd ../..
- cd newIDE/app && npm test
- cd ../..
#GDJS game engine tests:
- cd GDJS/tests && npm test && cd ../..
- cd GDJS/tests && npm test
- cd ../..
#GDCore and GDCpp game engine tests:
- cd .build-tests
- Core/GDCore_tests

View File

@@ -47,6 +47,7 @@ void SpriteObject::DoUnserializeFrom(gd::Project & project, const gd::Serializer
{
updateIfNotVisible = element.GetBoolAttribute("updateIfNotVisible", true);
RemoveAllAnimations();
const gd::SerializerElement & animationsElement = element.GetChild("animations", 0, "Animations");
animationsElement.ConsiderAsArrayOf("animation", "Animation");
for (std::size_t i = 0; i < animationsElement.GetChildrenCount(); ++i)

View File

@@ -154,6 +154,7 @@ void Object::UnserializeFrom(gd::Project & project, const SerializerElement & el
{
//Name and type are already loaded.
objectVariables.UnserializeFrom(element.GetChild("variables", 0, "Variables"));
behaviors.clear();
//Compatibility with GD <= 3.3
if (element.HasChild("Automatism"))