MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / SendChat

Function SendChat

engine/Poseidon/Game/Chat.cpp:634–663  ·  view source on GitHub ↗

Sends a chat message from the player on the given channel.

Source from the content-addressed store, hash-verified

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.
657void 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);

Callers 1

OnButtonClickedMethod · 0.70

Calls 10

GetFullPlayerNameFunction · 0.85
WhatUnitsFunction · 0.85
GetRealPlayerMethod · 0.80
BrainMethod · 0.80
GetLengthMethod · 0.45
AddMethod · 0.45
ProcessCommandMethod · 0.45
GetGameStateMethod · 0.45
ChatMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected