network_client.c
changeset 4945 c5c9bfb156fb
parent 4912 d04b3f2bca70
child 4946 42acc5fef0af
equal deleted inserted replaced
4944:c61494b1ec35 4945:c5c9bfb156fb
   621 			case NETWORK_ACTION_CHAT_CLIENT:
   621 			case NETWORK_ACTION_CHAT_CLIENT:
   622 				/* For speak to client we need the client-name */
   622 				/* For speak to client we need the client-name */
   623 				snprintf(name, sizeof(name), "%s", ci_to->client_name);
   623 				snprintf(name, sizeof(name), "%s", ci_to->client_name);
   624 				ci = NetworkFindClientInfoFromIndex(_network_own_client_index);
   624 				ci = NetworkFindClientInfoFromIndex(_network_own_client_index);
   625 				break;
   625 				break;
   626 			case NETWORK_ACTION_CHAT_COMPANY:
   626 
       
   627 			/* For speaking to company or giving money, we need the player-name */
   627 			case NETWORK_ACTION_GIVE_MONEY:
   628 			case NETWORK_ACTION_GIVE_MONEY:
   628 				/* For speaking to player or give money, we need the player-name */
   629 				if (!IsValidPlayer(ci_to->client_playas)) return NETWORK_RECV_STATUS_OKAY;
   629 				if (!IsValidPlayer(ci_to->client_playas)) return NETWORK_RECV_STATUS_OKAY; // This should never happen
   630 				/* fallthrough */
   630 
   631 			case NETWORK_ACTION_CHAT_COMPANY: {
   631 				GetString(name, GetPlayer(ci_to->client_playas)->name_1, lastof(name));
   632 				StringID str = IsValidPlayer(ci_to->client_playas) ? GetPlayer(ci_to->client_playas)->name_1 : STR_NETWORK_SPECTATORS;
       
   633 
       
   634 				GetString(name, str, lastof(name));
   632 				ci = NetworkFindClientInfoFromIndex(_network_own_client_index);
   635 				ci = NetworkFindClientInfoFromIndex(_network_own_client_index);
   633 				break;
   636 			} break;
   634 			default:
   637 			default:
   635 				/* This should never happen */
   638 				/* This should never happen */
   636 				NOT_REACHED();
   639 				NOT_REACHED();
   637 				break;
   640 				break;
   638 		}
   641 		}