diff options
author | peter1138 <peter1138@openttd.org> | 2007-06-25 15:59:37 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2007-06-25 15:59:37 +0000 |
commit | b957786ea4d338f94eb622aa4159fd2ba26abd8a (patch) | |
tree | 223695b130b4ad827c11c5763fc3aa02e0a45a01 /src/network | |
parent | d69589b3c2c1844a966ea47c568f27b86d60ce8a (diff) | |
download | openttd-b957786ea4d338f94eb622aa4159fd2ba26abd8a.tar.xz |
(svn r10325) -Fix (r10323): Missed 3 company name references
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_client.cpp | 3 | ||||
-rw-r--r-- | src/network/network_server.cpp | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index d7865beef..0cf21c2ba 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -672,7 +672,8 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CHAT) if (!IsValidPlayer(ci_to->client_playas)) return NETWORK_RECV_STATUS_OKAY; /* fallthrough */ case NETWORK_ACTION_CHAT_COMPANY: { - StringID str = IsValidPlayer(ci_to->client_playas) ? GetPlayer(ci_to->client_playas)->name_1 : (uint16)STR_NETWORK_SPECTATORS; + StringID str = IsValidPlayer(ci_to->client_playas) ? STR_COMPANY_NAME : STR_NETWORK_SPECTATORS; + SetDParam(0, ci_to->client_playas); GetString(name, str, lastof(name)); ci = NetworkFindClientInfoFromIndex(_network_own_client_index); diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 551abee0c..b8789edf6 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -1090,7 +1090,8 @@ void NetworkServer_HandleChat(NetworkAction action, DestType desttype, int dest, if (ci != NULL && show_local) { if (from_index == NETWORK_SERVER_INDEX) { char name[NETWORK_NAME_LENGTH]; - StringID str = IsValidPlayer(ci_to->client_playas) ? GetPlayer(ci_to->client_playas)->name_1 : (uint16)STR_NETWORK_SPECTATORS; + StringID str = IsValidPlayer(ci_to->client_playas) ? STR_COMPANY_NAME : STR_NETWORK_SPECTATORS; + SetDParam(0, ci_to->client_playas); GetString(name, str, lastof(name)); NetworkTextMessage(action, GetDrawStringPlayerColor(ci_own->client_playas), true, name, "%s", msg); } else { @@ -1259,9 +1260,8 @@ void NetworkPopulateCompanyInfo() ttd_strlcpy(_network_player_info[p->index].password, password, sizeof(_network_player_info[p->index].password)); // Grap the company name - SetDParam(0, p->name_1); - SetDParam(1, p->name_2); - GetString(_network_player_info[p->index].company_name, STR_JUST_STRING, lastof(_network_player_info[p->index].company_name)); + SetDParam(0, p->index); + GetString(_network_player_info[p->index].company_name, STR_COMPANY_NAME, lastof(_network_player_info[p->index].company_name)); // Check the income if (_cur_year - 1 == p->inaugurated_year) { |