mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-27 15:25:40 +00:00
Merge pull request #966 from Areloch/DefaultEditorCamFallbackFix
Make sure there's a default cam for editors
This commit is contained in:
commit
a17470e2fd
2 changed files with 13 additions and 2 deletions
|
|
@ -80,8 +80,10 @@ function spawnGameObject(%name, %addToScene)
|
|||
|
||||
function GameBaseData::onNewDataBlock(%this, %obj)
|
||||
{
|
||||
%this.onRemove(%obj);
|
||||
%this.onAdd(%obj);
|
||||
if(%this.isMethod("onRemove"))
|
||||
%this.onRemove(%obj);
|
||||
if(%this.isMethod("onAdd"))
|
||||
%this.onAdd(%obj);
|
||||
}
|
||||
|
||||
function saveGameObject(%name, %tamlPath, %scriptPath)
|
||||
|
|
|
|||
|
|
@ -47,6 +47,15 @@ function serverCmdToggleCamera(%client)
|
|||
{
|
||||
if (%client.getControlObject() == %client.player)
|
||||
{
|
||||
if (!isObject(%client.camera))
|
||||
{
|
||||
%client.camera = spawnObject("Camera", Observer);
|
||||
MissionCleanup.add( %client.camera );
|
||||
%client.camera.scopeToClient(%client);
|
||||
|
||||
%client.camera.setPosition(%client.player.getPosition());
|
||||
}
|
||||
|
||||
%client.camera.setVelocity("0 0 0");
|
||||
%control = %client.camera;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue