| 210 | } |
| 211 | |
| 212 | void GuiNavEditorCtrl::spawnPlayer(const Point3F &pos) |
| 213 | { |
| 214 | SceneObject *obj = (SceneObject*)Sim::spawnObject(mSpawnClass, mSpawnDatablock); |
| 215 | if(obj) |
| 216 | { |
| 217 | MatrixF mat(true); |
| 218 | mat.setPosition(pos); |
| 219 | obj->setTransform(mat); |
| 220 | SimObject* cleanup = Sim::findObject("MissionCleanup"); |
| 221 | if(cleanup) |
| 222 | { |
| 223 | SimGroup* missionCleanup = dynamic_cast<SimGroup*>(cleanup); |
| 224 | missionCleanup->addObject(obj); |
| 225 | } |
| 226 | mPlayer = static_cast<AIPlayer*>(obj); |
| 227 | Con::executef(this, "onPlayerSelected", Con::getIntArg(mPlayer->mLinkTypes.getFlags())); |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | DefineEngineMethod(GuiNavEditorCtrl, spawnPlayer, void, (),, |
| 232 | "@brief Spawn an AIPlayer at the centre of the screen.") |
no test coverage detected