| 380 | }; |
| 381 | |
| 382 | void CActor::ChangeVisual(shared_str NewVisual) |
| 383 | { |
| 384 | if (!NewVisual.size()) |
| 385 | return; |
| 386 | if (cNameVisual().size()) |
| 387 | { |
| 388 | if (cNameVisual() == NewVisual) |
| 389 | return; |
| 390 | } |
| 391 | |
| 392 | cNameVisual_set(NewVisual); |
| 393 | |
| 394 | g_SetAnimation(mstate_real); |
| 395 | Visual()->dcast_PKinematics()->CalculateBones_Invalidate(); |
| 396 | Visual()->dcast_PKinematics()->CalculateBones(); |
| 397 | |
| 398 | CCar* car; |
| 399 | if ((Holder()) && (car = smart_cast<CCar*>(Holder()))) |
| 400 | { |
| 401 | IKinematicsAnimated* V = smart_cast<IKinematicsAnimated*>(Visual()); |
| 402 | R_ASSERT(V); |
| 403 | u16 anim_type = car->DriverAnimationType(); |
| 404 | SVehicleAnimCollection& anims = m_vehicle_anims->m_vehicles_type_collections[anim_type]; |
| 405 | V->PlayCycle(anims.idles[0], FALSE); |
| 406 | |
| 407 | ResetCallbacks(); |
| 408 | u16 head_bone = V->dcast_PKinematics()->LL_BoneID("bip01_head"); |
| 409 | V->dcast_PKinematics()->LL_GetBoneInstance(u16(head_bone)).set_callback(bctPhysics, VehicleHeadCallback, this); |
| 410 | |
| 411 | character_physics_support()->movement()->DestroyCharacter(); |
| 412 | } |
| 413 | }; |
| 414 | |
| 415 | void CActor::save(NET_Packet& output_packet) |
| 416 | { |
no test coverage detected