| 2493 | } |
| 2494 | |
| 2495 | bool CGameScreen::OnLeftMouseButtonDoubleClick() |
| 2496 | { |
| 2497 | bool result = false; |
| 2498 | uint32_t charUnderMouse = 0; |
| 2499 | if ((g_SelectedObject.Gump != nullptr) && g_GumpManager.OnLeftMouseButtonDoubleClick(false)) |
| 2500 | { |
| 2501 | result = true; |
| 2502 | } |
| 2503 | else if (g_SelectedObject.Object != nullptr) |
| 2504 | { |
| 2505 | if (g_SelectedObject.Object->IsGameObject()) |
| 2506 | { |
| 2507 | CGameObject *obj = (CGameObject *)g_SelectedObject.Object; |
| 2508 | if (!obj->NPC) |
| 2509 | { |
| 2510 | g_Game.DoubleClick(g_SelectedObject.Serial); |
| 2511 | } |
| 2512 | else |
| 2513 | { |
| 2514 | charUnderMouse = g_SelectedObject.Serial; |
| 2515 | } |
| 2516 | result = true; |
| 2517 | } |
| 2518 | else if (g_SelectedObject.Object->IsText()) |
| 2519 | { |
| 2520 | CTextData *td = (CTextData *)g_SelectedObject.Object; |
| 2521 | if (td->Type == TT_OBJECT) |
| 2522 | { |
| 2523 | uint32_t serial = td->Serial; |
| 2524 | CGameObject *obj = g_World->FindWorldObject(serial); |
| 2525 | if (obj != nullptr && (obj->NPC || obj->IsCorpse())) |
| 2526 | { |
| 2527 | if (obj->NPC) |
| 2528 | { |
| 2529 | charUnderMouse = serial; |
| 2530 | } |
| 2531 | else |
| 2532 | { |
| 2533 | g_Game.DoubleClick(serial); |
| 2534 | } |
| 2535 | result = true; |
| 2536 | } |
| 2537 | } |
| 2538 | } |
| 2539 | } |
| 2540 | |
| 2541 | if (charUnderMouse != 0) |
| 2542 | { |
| 2543 | if (!g_ConfigManager.DisableNewTargetSystem && |
| 2544 | (charUnderMouse != g_PlayerSerial || !g_Player->IsMounted())) |
| 2545 | { |
| 2546 | g_GumpManager.CloseGump(g_NewTargetSystem.Serial, 0, GT_TARGET_SYSTEM); |
| 2547 | g_NewTargetSystem.Serial = charUnderMouse; |
| 2548 | if (g_GumpManager.UpdateContent(charUnderMouse, 0, GT_TARGET_SYSTEM) == nullptr) |
| 2549 | { |
| 2550 | CPacketStatusRequest(charUnderMouse).Send(); |
| 2551 | g_GumpManager.AddGump(new CGumpTargetSystem( |
| 2552 | charUnderMouse, g_NewTargetSystem.GumpX, g_NewTargetSystem.GumpY)); |
nothing calls this directly
no test coverage detected