h1z1-server 0.20.2-1 → 0.20.2-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h1z1-server",
3
- "version": "0.20.2-1",
3
+ "version": "0.20.2-2",
4
4
  "description": "Library for emulating h1z1 servers",
5
5
  "author": "Quentin Gruber <quentingruber@gmail.com> (http://github.com/quentingruber)",
6
6
  "license": "GPL-3.0-only",
@@ -444,20 +444,22 @@ export class ZoneServer extends EventEmitter {
444
444
  }
445
445
 
446
446
  deleteClient(client: Client) {
447
- if (client.character) {
448
- this.deleteEntity(client.character.characterId, this._characters);
449
- clearTimeout(client.character?.resourcesUpdater);
450
- this.saveCharacterPosition(client);
451
- client.managedObjects?.forEach((characterId: any) => {
452
- this.dropVehicleManager(client, characterId);
453
- });
454
- }
455
- delete this._clients[client.sessionId];
456
- this._gatewayServer._soeServer.deleteClient(
457
- this.getSoeClient(client.soeClientId)
458
- );
459
- if (!this._soloMode) {
460
- this.sendZonePopulationUpdate();
447
+ if(client){
448
+ if (client.character) {
449
+ this.deleteEntity(client.character.characterId, this._characters);
450
+ clearTimeout(client.character?.resourcesUpdater);
451
+ this.saveCharacterPosition(client);
452
+ client.managedObjects?.forEach((characterId: any) => {
453
+ this.dropVehicleManager(client, characterId);
454
+ });
455
+ }
456
+ delete this._clients[client.sessionId];
457
+ this._gatewayServer._soeServer.deleteClient(
458
+ this.getSoeClient(client.soeClientId)
459
+ );
460
+ if (!this._soloMode) {
461
+ this.sendZonePopulationUpdate();
462
+ }
461
463
  }
462
464
  }
463
465