Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NormanTUD committed Oct 21, 2023
1 parent adf4026 commit 9c057e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions asanai.js
Original file line number Diff line number Diff line change
Expand Up @@ -3852,9 +3852,13 @@ class asanAI {

set_asanai_name (name) {
if(eval(`window.${name}`)) {
this.#asanai_name = name;
if(window[name].constructor.name == "asanAI") {
this.#asanai_name = name;
} else {
this.err(`Variable ${name} could be found but is not an asanAI class..`);
}
} else {
this.err(`Could not find global variable ${name}. Cannot use it as asanai name.`);
this.err(`Could not find global variable ${name}. Cannot use it as asanAI name.`);
}
}
}

0 comments on commit 9c057e9

Please sign in to comment.