enhance move_to_layer to handle failure of __mg_move_client_to_layer

This commit is contained in:
Vincent Wei
2021-03-24 11:35:34 +08:00
parent 27122b421d
commit 48b84e3100

View File

@@ -334,10 +334,14 @@ static int move_to_layer (int cli, int clifd, void* buff, size_t len)
if (!__mg_is_valid_layer (dst_layer))
goto ret;
if (__mg_move_client_to_layer (mgClients + cli, dst_layer, TRUE)) {
if (__mg_move_client_to_layer (mgClients + cli, dst_layer)) {
moved_info.layer = dst_layer;
moved_info.zo_shmid = dst_layer->zorder_shmid;
}
else {
moved_info.layer = INV_LAYER_HANDLE;
moved_info.zo_shmid = 0;
}
ret:
return ServerSendReply (clifd, &moved_info, sizeof (MOVEDCLIENTINFO));