| 386 | extern bool g_bDisableAllInput; |
| 387 | |
| 388 | void CActor::ActorUse() |
| 389 | { |
| 390 | auto pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame()); |
| 391 | if (auto Pda = GetPDA(); Pda && Pda->Is3DPDA() && psActorFlags.test(AF_3D_PDA) && pGameSP->PdaMenu->IsShown()) |
| 392 | return; |
| 393 | |
| 394 | auto active_hud = smart_cast<CHudItem*>(inventory().ActiveItem()); |
| 395 | if (active_hud && active_hud->GetState() != CHudItem::eIdle && Core.Features.test(xrCore::Feature::busy_actor_restrictions)) |
| 396 | return; |
| 397 | |
| 398 | if (g_bDisableAllInput || HUD().GetUI()->MainInputReceiver()) |
| 399 | return; |
| 400 | |
| 401 | if (m_holder) |
| 402 | { |
| 403 | CGameObject* GO = smart_cast<CGameObject*>(m_holder); |
| 404 | NET_Packet P; |
| 405 | CGameObject::u_EventGen(P, GEG_PLAYER_DETACH_HOLDER, ID()); |
| 406 | P.w_u32(GO->ID()); |
| 407 | CGameObject::u_EventSend(P); |
| 408 | return; |
| 409 | } |
| 410 | |
| 411 | if (character_physics_support()->movement()->PHCapture()) |
| 412 | { |
| 413 | character_physics_support()->movement()->PHReleaseObject(); |
| 414 | return; |
| 415 | } |
| 416 | |
| 417 | if (m_pUsableObject) |
| 418 | { |
| 419 | m_pUsableObject->use(this); |
| 420 | if (g_bDisableAllInput || HUD().GetUI()->MainInputReceiver()) |
| 421 | return; |
| 422 | } |
| 423 | |
| 424 | if (m_pInvBoxWeLookingAt && m_pInvBoxWeLookingAt->object().nonscript_usable() && m_pInvBoxWeLookingAt->IsOpened()) |
| 425 | { |
| 426 | // если контейнер открыт |
| 427 | CUIGameSP* pGameSP = smart_cast<CUIGameSP*>(HUD().GetUI()->UIGame()); |
| 428 | if (pGameSP) |
| 429 | pGameSP->StartCarBody(this, m_pInvBoxWeLookingAt); |
| 430 | return; |
| 431 | } |
| 432 | |
| 433 | else if (!m_pUsableObject || m_pUsableObject->nonscript_usable()) |
| 434 | { |
| 435 | if (m_pPersonWeLookingAt) |
| 436 | { |
| 437 | CEntityAlive* pEntityAliveWeLookingAt = smart_cast<CEntityAlive*>(m_pPersonWeLookingAt); |
| 438 | VERIFY(pEntityAliveWeLookingAt); |
| 439 | if (pEntityAliveWeLookingAt->g_Alive()) |
| 440 | { |
| 441 | TryToTalk(); |
| 442 | return; |
| 443 | } |
| 444 | //обыск трупа |
| 445 | else if (!pInput->iGetAsyncKeyState(DIK_LSHIFT)) |
nothing calls this directly
no test coverage detected