fix: removePlayer

This commit is contained in:
cha0s 2021-02-10 08:48:14 -06:00
parent 4292f2cd75
commit 271886de78

View File

@ -40,12 +40,14 @@ export default (latus) => class ServerJoin extends Join() {
socket,
user,
});
socket.on('disconnect', () => {
const removePlayer = () => {
const player = universe.playerForSocket(socket.id);
if (player) {
universe.removePlayer(player);
}
});
};
entity.on('destroying', removePlayer);
socket.on('disconnect', removePlayer);
return entity.instanceUuid;
}