mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Merge branch 'Preview4_0' of https://github.com/TorqueGameEngines/Torque3D into MiscFixes2021114
This commit is contained in:
commit
f14375983b
4 changed files with 39 additions and 13 deletions
|
|
@ -348,9 +348,6 @@ bool FlyingVehicle::onAdd()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
addToScene();
|
addToScene();
|
||||||
|
|
||||||
if (isServerObject())
|
|
||||||
scriptOnAdd();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -400,7 +397,6 @@ void FlyingVehicle::onRemove()
|
||||||
SFX_DELETE( mJetSound );
|
SFX_DELETE( mJetSound );
|
||||||
SFX_DELETE( mEngineSound );
|
SFX_DELETE( mEngineSound );
|
||||||
|
|
||||||
scriptOnRemove();
|
|
||||||
removeFromScene();
|
removeFromScene();
|
||||||
Parent::onRemove();
|
Parent::onRemove();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -512,10 +512,6 @@ bool HoverVehicle::onAdd()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isServerObject())
|
|
||||||
scriptOnAdd();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -526,7 +522,6 @@ void HoverVehicle::onRemove()
|
||||||
SFX_DELETE( mEngineSound );
|
SFX_DELETE( mEngineSound );
|
||||||
SFX_DELETE( mFloatSound );
|
SFX_DELETE( mFloatSound );
|
||||||
|
|
||||||
scriptOnRemove();
|
|
||||||
removeFromScene();
|
removeFromScene();
|
||||||
Parent::onRemove();
|
Parent::onRemove();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -565,8 +565,6 @@ bool WheeledVehicle::onAdd()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
addToScene();
|
addToScene();
|
||||||
if (isServerObject())
|
|
||||||
scriptOnAdd();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -588,7 +586,6 @@ void WheeledVehicle::onRemove()
|
||||||
SFX_DELETE( mSquealSound );
|
SFX_DELETE( mSquealSound );
|
||||||
|
|
||||||
//
|
//
|
||||||
scriptOnRemove();
|
|
||||||
removeFromScene();
|
removeFromScene();
|
||||||
Parent::onRemove();
|
Parent::onRemove();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -542,7 +542,7 @@ TEST(Script, TorqueScript_Array_Testing)
|
||||||
ASSERT_EQ(value2.getInt(), 2);
|
ASSERT_EQ(value2.getInt(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Script, Basic_SimObject)
|
TEST(Script, SimObject_Tests)
|
||||||
{
|
{
|
||||||
ConsoleValue object = RunScript(R"(
|
ConsoleValue object = RunScript(R"(
|
||||||
return new SimObject(FudgeCollector)
|
return new SimObject(FudgeCollector)
|
||||||
|
|
@ -657,6 +657,44 @@ TEST(Script, Basic_SimObject)
|
||||||
)");
|
)");
|
||||||
|
|
||||||
ASSERT_EQ(fieldOpTest.getInt(), 3);
|
ASSERT_EQ(fieldOpTest.getInt(), 3);
|
||||||
|
|
||||||
|
ConsoleValue inheritedObjectTest = RunScript(R"(
|
||||||
|
function SimObject::testClass(%this)
|
||||||
|
{
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
function SuperFooBar::doSuperTest(%this)
|
||||||
|
{
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
function FooBar::test(%this)
|
||||||
|
{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
new SimObject(GrandFooBar)
|
||||||
|
{
|
||||||
|
superClass = "SuperFooBar";
|
||||||
|
};
|
||||||
|
|
||||||
|
new SimObject(Foo : GrandFooBar)
|
||||||
|
{
|
||||||
|
class = "FooBar";
|
||||||
|
};
|
||||||
|
|
||||||
|
new SimObject(Bar : Foo);
|
||||||
|
|
||||||
|
function Bar::doTheAddition(%this)
|
||||||
|
{
|
||||||
|
return %this.testClass() + %this.test() + %this.doSuperTest();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Bar.doTheAddition();
|
||||||
|
)");
|
||||||
|
|
||||||
|
ASSERT_EQ(inheritedObjectTest.getInt(), 11);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Script, Internal_Name)
|
TEST(Script, Internal_Name)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue