fix: removePlayer
This commit is contained in:
parent
4292f2cd75
commit
271886de78
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user