mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
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:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user