fix a bug where if you had "Use Costume" ticked, any Battle Gear or Costume choice would be added to your costume, never to Battle Gear

This commit is contained in:
Alys
2015-07-12 18:18:31 +10:00
parent 18db504d2a
commit 92bfc66c67
3 changed files with 7 additions and 6 deletions

View File

@@ -211,12 +211,13 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
}
// @TODO: Extract equip and purchase into equipment service
$rootScope.equip = function(itemKey) {
var equipType = user.preferences.costume ? 'costume' : 'equipped';
$rootScope.equip = function(itemKey, equipType) {
var equipParams = {
type: equipType,
type: equipType || 'costume',
key: itemKey
};
// 'costume' default is in case I have missed any code that uses this.
// @TODO: Remove when we're sure it's not needed.
user.ops.equip({ params: equipParams });
}