mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
nav editor compliance
This commit is contained in:
parent
f278150185
commit
9e2666ed09
1 changed files with 12 additions and 0 deletions
|
|
@ -227,6 +227,7 @@ void GuiNavEditorCtrl::spawnPlayer(const Point3F &pos)
|
||||||
missionCleanup->addObject(obj);
|
missionCleanup->addObject(obj);
|
||||||
}
|
}
|
||||||
mPlayer = obj;
|
mPlayer = obj;
|
||||||
|
#ifdef TORQUE_NAVIGATION_ENABLED
|
||||||
AIPlayer* asAIPlayer = dynamic_cast<AIPlayer*>(obj);
|
AIPlayer* asAIPlayer = dynamic_cast<AIPlayer*>(obj);
|
||||||
if (asAIPlayer) //try direct
|
if (asAIPlayer) //try direct
|
||||||
{
|
{
|
||||||
|
|
@ -242,9 +243,12 @@ void GuiNavEditorCtrl::spawnPlayer(const Point3F &pos)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#endif
|
||||||
Con::executef(this, "onPlayerSelected");
|
Con::executef(this, "onPlayerSelected");
|
||||||
|
#ifdef TORQUE_NAVIGATION_ENABLED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -406,6 +410,7 @@ void GuiNavEditorCtrl::on3DMouseDown(const Gui3DMouseEvent & event)
|
||||||
if(ri.object)
|
if(ri.object)
|
||||||
{
|
{
|
||||||
mPlayer = ri.object;
|
mPlayer = ri.object;
|
||||||
|
#ifdef TORQUE_NAVIGATION_ENABLED
|
||||||
AIPlayer* asAIPlayer = dynamic_cast<AIPlayer*>(mPlayer.getPointer());
|
AIPlayer* asAIPlayer = dynamic_cast<AIPlayer*>(mPlayer.getPointer());
|
||||||
if (asAIPlayer) //try direct
|
if (asAIPlayer) //try direct
|
||||||
{
|
{
|
||||||
|
|
@ -421,17 +426,24 @@ void GuiNavEditorCtrl::on3DMouseDown(const Gui3DMouseEvent & event)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#endif
|
||||||
Con::executef(this, "onPlayerSelected");
|
Con::executef(this, "onPlayerSelected");
|
||||||
}
|
}
|
||||||
|
#ifdef TORQUE_NAVIGATION_ENABLED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else if (!mPlayer.isNull() && gServerContainer.castRay(startPnt, endPnt, StaticObjectType, &ri))
|
else if (!mPlayer.isNull() && gServerContainer.castRay(startPnt, endPnt, StaticObjectType, &ri))
|
||||||
{
|
{
|
||||||
AIPlayer* asAIPlayer = dynamic_cast<AIPlayer*>(mPlayer.getPointer());
|
AIPlayer* asAIPlayer = dynamic_cast<AIPlayer*>(mPlayer.getPointer());
|
||||||
if (asAIPlayer) //try direct
|
if (asAIPlayer) //try direct
|
||||||
{
|
{
|
||||||
|
#ifdef TORQUE_NAVIGATION_ENABLED
|
||||||
asAIPlayer->setPathDestination(ri.point);
|
asAIPlayer->setPathDestination(ri.point);
|
||||||
|
#else
|
||||||
|
asAIPlayer->setMoveDestination(ri.point,false);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue