new client misc fixes (#9033)

* show quests and open quest dialog on click

* extract questDialogContent/Drops to separate components & use those in startQuestModal & buyQuestModal

* fix market search

* remove & readd pinned gear on revive

* remove listener once destroyed
This commit is contained in:
negue
2017-09-16 23:09:31 +02:00
committed by GitHub
parent 8ccec0ed9d
commit 0b0baf2195
9 changed files with 241 additions and 134 deletions
+6
View File
@@ -9,6 +9,8 @@ import {
import randomVal from '../libs/randomVal';
import predictableRandom from '../fns/predictableRandom';
import { removePinnedGearByClass, addPinnedGearByClass } from './pinnedGearUtils';
module.exports = function revive (user, req = {}, analytics) {
if (user.stats.hp > 0) {
throw new NotAuthorized(i18n.t('cannotRevive', req.language));
@@ -81,8 +83,12 @@ module.exports = function revive (user, req = {}, analytics) {
let item = content.gear.flat[lostItem];
if (item) {
removePinnedGearByClass(user);
user.items.gear.owned[lostItem] = false;
addPinnedGearByClass(user);
if (user.items.gear.equipped[item.type] === lostItem) {
user.items.gear.equipped[item.type] = `${item.type}_base_0`;
}