… | |
… | |
1219 | } |
1219 | } |
1220 | |
1220 | |
1221 | void |
1221 | void |
1222 | leave (player *pl, int draw_exit) |
1222 | leave (player *pl, int draw_exit) |
1223 | { |
1223 | { |
1224 | if (pl != NULL) |
1224 | if (pl) |
1225 | { |
1225 | { |
1226 | /* We do this so that the socket handling routine can do the final |
1226 | /* We do this so that the socket handling routine can do the final |
1227 | * cleanup. We also leave that loop to actually handle the freeing |
1227 | * cleanup. We also leave that loop to actually handle the freeing |
1228 | * of the data. |
1228 | * of the data. |
1229 | */ |
1229 | */ |
|
|
1230 | if (pl->socket) |
|
|
1231 | pl->socket->destroy (); |
|
|
1232 | |
1230 | if (pl->ob->type != DEAD_OBJECT) |
1233 | if (pl->ob->type != DEAD_OBJECT) |
1231 | { |
1234 | { |
1232 | pl->socket->status = Ns_Dead; |
|
|
1233 | |
|
|
1234 | /* If a hidden dm dropped connection do not create |
1235 | /* If a hidden dm dropped connection do not create |
1235 | * inconsistencies by showing that they have left the game |
1236 | * inconsistencies by showing that they have left the game |
1236 | */ |
1237 | */ |
1237 | if (!(QUERY_FLAG (pl->ob, FLAG_WIZ) && pl->ob->contr->hidden) |
1238 | if (!(QUERY_FLAG (pl->ob, FLAG_WIZ) && pl->ob->contr->hidden) |
1238 | && draw_exit && (pl->state != ST_GET_NAME && pl->state != ST_GET_PASSWORD && pl->state != ST_CONFIRM_PASSWORD)) |
1239 | && draw_exit && (pl->state != ST_GET_NAME && pl->state != ST_GET_PASSWORD && pl->state != ST_CONFIRM_PASSWORD)) |