add can't kick host error

This commit is contained in:
zsilencer 2016-01-23 13:27:33 -07:00
parent 5f7c81083e
commit 5a43e313b5
3 changed files with 8 additions and 0 deletions

View File

@ -4002,6 +4002,7 @@ STR_5660 :Modify Groups
STR_5661 :Set Player Group
STR_5662 :N/A
STR_5663 :Clear Landscape
STR_5703 :Can't kick the host
STR_5704 :Last Action:
STR_5705 :Can't set to this group
STR_5706 :Can't remove group that players belong to

View File

@ -2291,6 +2291,7 @@ enum {
STR_ACTION_NA = 5662,
STR_ACTION_CLEAR_LANDSCAPE = 5663,
STR_CANT_KICK_THE_HOST = 5703,
STR_LAST_ACTION = 5704,
STR_CANT_SET_TO_THIS_GROUP = 5705,
STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO = 5706,

View File

@ -2142,6 +2142,12 @@ void game_command_modify_groups(int *eax, int *ebx, int *ecx, int *edx, int *esi
void game_command_kick_player(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp)
{
uint8 playerid = (uint8)*eax;
NetworkPlayer* player = gNetwork.GetPlayerByID(playerid);
if (player && player->flags & NETWORK_PLAYER_FLAG_ISSERVER) {
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16) = STR_CANT_KICK_THE_HOST;
*ebx = MONEY32_UNDEFINED;
return;
}
if (*ebx & GAME_COMMAND_FLAG_APPLY) {
if (gNetwork.GetMode() == NETWORK_MODE_SERVER) {
gNetwork.KickPlayer(playerid);