Changed map and map state send order on sync

This commit is contained in:
Mitchell McCaffrey 2020-04-23 21:20:06 +10:00
parent 6f2e883e74
commit 81da404eec

View File

@ -159,12 +159,12 @@ function Game() {
function handlePeerData({ data, peer }) {
if (data.id === "sync") {
if (map) {
peer.connection.send({ id: "map", data: map });
}
if (mapState) {
peer.connection.send({ id: "mapState", data: mapState });
}
if (map) {
peer.connection.send({ id: "map", data: map });
}
}
if (data.id === "map") {
// If we have a file convert it to a url