Sends a chat message from the player on the given channel.
| 632 | if (!unit) |
| 633 | { |
| 634 | continue; |
| 635 | } |
| 636 | if (!unit->GetPerson()->IsRemotePlayer()) |
| 637 | { |
| 638 | continue; |
| 639 | } |
| 640 | if (!unit->IsFreeSoldier()) |
| 641 | { |
| 642 | continue; |
| 643 | } |
| 644 | PoseidonAssert(unit->GetPerson() == veh); |
| 645 | |
| 646 | float dist2 = pos.Distance2(obj->Position()); |
| 647 | if (dist2 <= Square(maxDist)) |
| 648 | { |
| 649 | units.Add(veh); |
| 650 | } |
| 651 | } |
| 652 | } |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | // Players that can receive a message on the given channel from object. |
| 657 | void WhatUnits(RefArray<NetworkObject>& units, ChatChannel channel, NetworkObject* object) |
| 658 | { |
| 659 | switch (channel) |
| 660 | { |
| 661 | case CCVehicle: |
| 662 | { |
| 663 | Transport* veh = dynamic_cast<Transport*>(object); |
| 664 | if (veh) |
| 665 | { |
| 666 | WhatUnitsVehicle(units, veh); |
no test coverage detected