| 370 | } |
| 371 | |
| 372 | void CScriptGameObject::SetNpcPosition(Fvector pos, bool skipCollisionCorrect) |
| 373 | { |
| 374 | CCustomMonster* obj = smart_cast<CCustomMonster*>(&object()); |
| 375 | if (obj) |
| 376 | { |
| 377 | if (skipCollisionCorrect) |
| 378 | { |
| 379 | Fmatrix F = obj->XFORM(); |
| 380 | F.c = pos; |
| 381 | obj->XFORM().set(F); |
| 382 | if (obj->character_physics_support()->movement()->CharacterExist()) |
| 383 | { |
| 384 | obj->character_physics_support()->movement()->SetPosition(F.c); |
| 385 | obj->character_physics_support()->movement()->SetVelocity(0.f, 0.f, 0.f); |
| 386 | } |
| 387 | } |
| 388 | else |
| 389 | { |
| 390 | Fmatrix F = obj->XFORM(); |
| 391 | F.c = pos; |
| 392 | obj->ForceTransform(F); |
| 393 | } |
| 394 | |
| 395 | obj->movement().detail().make_inactual(); |
| 396 | if (obj->animation_movement_controlled()) |
| 397 | obj->destroy_anim_mov_ctrl(); |
| 398 | |
| 399 | } |
| 400 | else |
| 401 | ai().script_engine().script_log(ScriptStorage::eLuaMessageTypeError, "ScriptGameObject : attempt to call SetNpcPosition method for non-CCustomMonster object"); |
| 402 | } |
| 403 | |
| 404 | CHolderCustom* CScriptGameObject::get_current_holder() |
| 405 | { |
nothing calls this directly
no test coverage detected