… | |
… | |
250 | } |
250 | } |
251 | |
251 | |
252 | void |
252 | void |
253 | player::disconnect () |
253 | player::disconnect () |
254 | { |
254 | { |
255 | if (!ns) |
|
|
256 | return; |
|
|
257 | |
|
|
258 | //TODO: don't be so harsh and destroy :) |
255 | //TODO: don't be so harsh and destroy :) |
|
|
256 | if (ns) |
259 | destroy (); |
257 | destroy (); |
260 | |
|
|
261 | ns->pl = 0; |
|
|
262 | ns = 0; |
|
|
263 | } |
258 | } |
264 | |
259 | |
265 | // the need for this function can be explained |
260 | // the need for this function can be explained |
266 | // by load_object not returning the object |
261 | // by load_object not returning the object |
267 | void |
262 | void |
… | |
… | |
348 | if (ob) |
343 | if (ob) |
349 | ob->destroy (true); |
344 | ob->destroy (true); |
350 | |
345 | |
351 | if (ns) |
346 | if (ns) |
352 | { |
347 | { |
|
|
348 | client *ns = this->ns; |
353 | ns->send_packet ("goodbye"); |
349 | ns->send_packet ("goodbye"); |
354 | ns->flush (); |
350 | ns->flush (); |
355 | ns->pl = 0; |
351 | ns->pl = 0; |
|
|
352 | this->ns = 0; |
356 | ns->destroy (); |
353 | ns->destroy (); |
357 | } |
354 | } |
358 | |
355 | |
359 | attachable::do_destroy (); |
356 | attachable::do_destroy (); |
360 | } |
357 | } |