mirror of
https://github.com/bra1n/townsquare.git
synced 2025-04-04 22:24:36 +00:00
tidy loose ends
This commit is contained in:
parent
17799073a0
commit
078eedbf74
2 changed files with 4 additions and 5 deletions
|
@ -238,6 +238,7 @@ export default new Vuex.Store({
|
||||||
state.modals.edition = false;
|
state.modals.edition = false;
|
||||||
},
|
},
|
||||||
updateGameState(state, data) {
|
updateGameState(state, data) {
|
||||||
|
// data from socket _sendGameState
|
||||||
const {
|
const {
|
||||||
playerState,
|
playerState,
|
||||||
isLightweight,
|
isLightweight,
|
||||||
|
@ -278,7 +279,6 @@ export default new Vuex.Store({
|
||||||
const { roleId } = state;
|
const { roleId } = state;
|
||||||
if (roleId == {} && player.role.team === "traveler" && roleId !== -1) {
|
if (roleId == {} && player.role.team === "traveler" && roleId !== -1) {
|
||||||
// special case for when a player stopped being a traveler
|
// special case for when a player stopped being a traveler
|
||||||
console.log("special case", roleId);
|
|
||||||
this.commit("players/update", {
|
this.commit("players/update", {
|
||||||
player,
|
player,
|
||||||
property: "role",
|
property: "role",
|
||||||
|
@ -290,7 +290,6 @@ export default new Vuex.Store({
|
||||||
this.getters.rolesJSONbyId.get(roleId) ||
|
this.getters.rolesJSONbyId.get(roleId) ||
|
||||||
{};
|
{};
|
||||||
if (role) {
|
if (role) {
|
||||||
console.log("normal case", roleId);
|
|
||||||
this.commit("players/update", {
|
this.commit("players/update", {
|
||||||
player,
|
player,
|
||||||
property: "role",
|
property: "role",
|
||||||
|
@ -320,7 +319,7 @@ export default new Vuex.Store({
|
||||||
});
|
});
|
||||||
this.commit("session/setMarkedPlayer", markedPlayer);
|
this.commit("session/setMarkedPlayer", markedPlayer);
|
||||||
this.commit("players/setFabled", {
|
this.commit("players/setFabled", {
|
||||||
fabled: fabled.map(f => this._store.state.fabled.get(f.id) || f)
|
fabled: fabled.map(f => state.fabled.get(f.id) || f)
|
||||||
});
|
});
|
||||||
// bluffs
|
// bluffs
|
||||||
if (bluffs !== -1) {
|
if (bluffs !== -1) {
|
||||||
|
|
|
@ -315,7 +315,7 @@ class LiveSession {
|
||||||
_updateGamestate(data) {
|
_updateGamestate(data) {
|
||||||
if (!this._isSpectator) return;
|
if (!this._isSpectator) return;
|
||||||
if (data.isRevealedGrimoire) {
|
if (data.isRevealedGrimoire) {
|
||||||
// special case: this includes ALL roles, reminders & bluffs
|
// special case: includes ALL roles, reminders & bluffs
|
||||||
// would overwrite users notes, so we have to (store and) ask before applying
|
// would overwrite users notes, so we have to (store and) ask before applying
|
||||||
this._store.commit("session/setRevealedGrimoire", data);
|
this._store.commit("session/setRevealedGrimoire", data);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue