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