Check for born using property instead of name

pull/11/head
Daniel Asher Resnick 2 years ago
parent bac1626f31
commit e9361b625b
  1. 11
      src/public/js/burning.js

@ -2006,13 +2006,6 @@ function calculatePTGS($scope) {
}
function isBornLifepath(lifepathName) {
return lifepathName.indexOf("Born") >= 0 ||
lifepathName == "Son Of A Gun" ||
lifepathName == "Gifted Child";
}
function calculateCurrentSettingLifepathNames($scope, burningData){
var currentSettingLifepathNames = null;
@ -2024,7 +2017,7 @@ function calculateCurrentSettingLifepathNames($scope, burningData){
if ( $scope.selectedLifepaths.length == 0 ){
// Only "Born" lifepaths are allowed
for(var i = 0; i < all.length; i++){
if ( isBornLifepath(all[i]) ){
if ( burningData.lifepaths[$scope.stock][$scope.currentSetting][all[i]].born ){
currentSettingLifepathNames.push(all[i]);
}
}
@ -2034,7 +2027,7 @@ function calculateCurrentSettingLifepathNames($scope, burningData){
for(var j = 0; j < lifepathNames.length; j++){
var lifepathName = lifepathNames[j];
if ( isBornLifepath(lifepathName) )
if ( burningData.lifepaths[$scope.stock][$scope.currentSetting][lifepathName].born )
continue;
var rexpr = burningData.lifepaths[$scope.stock][$scope.currentSetting][lifepathName].requires_expr

Loading…
Cancel
Save