Last active
May 31, 2016 08:37
-
-
Save NoxMortem/d420523a273bf0b3a86891b98ef4530a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cleanUp = function(){ | |
var attributes_of_deleted = findObjs({type:'attribute'}); | |
var abilities_of_deleted = findObjs({type:'ability'}); | |
//log("#Attributes after delete: "+attributes_of_deleted.length); | |
var count = 0; | |
log("LIST trash attributes"); | |
for(var attr in attributes_of_deleted){ | |
attr = attributes_of_deleted[attr]; | |
var chr = findObjs({type:'character',id:attr.get('characterid')}); | |
if(chr.length == 0){ | |
log(attr); | |
count++; | |
//attr.remove(); | |
} | |
} | |
log("LIST trash abilities"); | |
for(var abil in abilities_of_deleted){ | |
abil = abilities_of_deleted[abil]; | |
var chr = findObjs({type:'character',id:abil.get('characterid')}); | |
if(chr.length == 0){ | |
log(attr); | |
count++; | |
//abil.remove(); | |
} | |
} | |
log("TOTAL:"+count); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment