# TArray sort - networking problem

**URL:** <https://forums.unrealengine.com/t/tarray-sort-networking-problem/325124>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, Replication, tarray, unreal-engine, question\
**Created:** [July 13, 2015, 6:40pm UTC](https://forums.unrealengine.com/t/tarray-sort-networking-problem/325124 "2015-07-13T18:40:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kochab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kochab](https://forums.unrealengine.com/u/Kochab)\
**Post date:** [July 13, 2015, 6:40pm UTC](https://forums.unrealengine.com/t/tarray-sort-networking-problem/325124/1 "2015-07-13T18:40:33Z")

</div>

I have a TArray of cards that get sorted in a function called `OrganizeHand()`. This function is called from a NetMulticast function. The problem is only 2 cards are sorted if you’re playing as a client. As the server, all cards get sorted. I also change the color of every card in the hand and that works as expected. Here is the function:

```
 void ASPawn::OrganizeHand()
 {
      // sort hand - only sorts 2 cards if client
      ClientHand.Sort(AClientCard::SortHand);

      // disable hand - works as expected on both server and client
      for (int32 i = 0; i < ClientHand.Num(); i++)
      {
           ClientHand[i]->SetDisabled();
      }
 }

```

And here is the sort:

```
 inline static bool SortHand(const ASCard& c1, const ASCard& c2)
 {
      return ((c1.suit < c2.suit) || (c1.suit == c2.suit && c1.cardValue < c2.cardValue));
 }
```

---

<div class="post-metadata">

**Author:** ![Kochab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kochab](https://forums.unrealengine.com/u/Kochab)\
**Post date:** [July 13, 2015, 7:31pm UTC](https://forums.unrealengine.com/t/tarray-sort-networking-problem/325124/2 "2015-07-13T19:31:12Z")

</div>

The problem was that I was calling a NetMulticast function on the cards (for animation stuff) every tick, which stopped the other calls from going through.
