diff --git a/client/src/components/team.jsx b/client/src/components/team.jsx
index c848dbb2..43b9e6f8 100644
--- a/client/src/components/team.jsx
+++ b/client/src/components/team.jsx
@@ -103,7 +103,7 @@ function Team(args) {
{constructDeleteId === construct.id ? 'Confirm delete...' : construct.name}
-
+
diff --git a/client/src/events.jsx b/client/src/events.jsx
index 5567b9de..1e5a20f5 100644
--- a/client/src/events.jsx
+++ b/client/src/events.jsx
@@ -9,10 +9,9 @@ function registerEvents(store) {
// timeout handlers
store.subscribe(() => {
- const { game, instance, constructs, ws } = store.getState();
+ const { game, instance, ws } = store.getState();
if (!ws) return true;
-
if (!game) ws.clearGameStateTimeout();
if (!instance) ws.clearInstanceStateTimeout();
});
@@ -30,11 +29,12 @@ function registerEvents(store) {
store.dispatch(actions.setNav(v));
}
- function setConstructs(constructs) {
- console.log('EVENT ->', 'constructs', constructs);
- }
-
function setConstructList(constructs) {
+ // check team is in list
+ const { team } = store.getState();
+ const ids = constructs.map(c => c.id);
+ if (!team.every(t => t && ids.includes(t))) store.dispatch(actions.setTeam([null, null, null]));
+
store.dispatch(actions.setConstructs(constructs));
}
@@ -113,18 +113,6 @@ function registerEvents(store) {
console.log('event clear item');
}
- function setMenu() {
- console.log('EVENT ->', 'menu', true);
- }
-
- function setVbox(items) {
- console.log('EVENT ->', 'vbox', items);
- }
-
- function setScores(scores) {
- console.log('EVENT ->', 'scores', scores);
- }
-
function setAccountInstances(v) {
return store.dispatch(actions.setInstances(v));
}
@@ -146,18 +134,6 @@ function registerEvents(store) {
return store.dispatch(actions.setInstance(v));
}
- function setZone(zone) {
- console.log('EVENT ->', 'zone', zone);
- }
-
- function setGameList(gameList) {
- console.log('EVENT ->', 'gameList', gameList);
- }
-
- function setConstructStatusUpdate(id, skill, target) {
- console.log('EVENT ->', 'constructStatusUpdate', { id, skill, target });
- }
-
function setItemInfo(v) {
return store.dispatch(actions.setItemInfo(v));
}
@@ -214,20 +190,14 @@ function registerEvents(store) {
setAccount,
setActiveSkill,
setActiveItem,
- setConstructs,
setConstructList,
setGame,
clearInfo,
- setMenu,
setInstance,
setInstanceList,
setAccountInstances,
- setVbox,
setWs,
- setGameList,
- setZone,
setPing,
- setScores,
setItemInfo,
};
}
diff --git a/server/src/instance.rs b/server/src/instance.rs
index 19eb834c..c7f26e6b 100644
--- a/server/src/instance.rs
+++ b/server/src/instance.rs
@@ -641,6 +641,7 @@ pub fn instance_new(params: InstanceLobbyParams, tx: &mut Transaction, account:
let mut instance = match params.pve {
true => Instance::new()
.set_time_control(TimeControl::Practice)
+ .set_max_rounds(10)
.set_name(params.name)?
.add_bots(),