Skip to content

Commit

Permalink
Allowed ACE releases and resets.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed Feb 15, 2024
1 parent 0578a23 commit b8ce8cf
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/state/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,24 @@ let OctaviaDevice = class extends CustomEventSource {
console.warn(`ACE slots are full.`);
};
};
releaseAce(cc) {
let continueScan = true, pointer = 0;
while (continueScan && pointer < allocated.ace) {
if (this.#ace[pointer] == cc) {
this.#ace[pointer] = 0;
continueScan = false;
};
pointer ++;
};
if (continueScan) {
getDebugState() && console.debug(`No ACE slot was allocated to cc${cc}.`);
};
};
resetAce() {
// Clear all allocated ACE
this.#ace.fill(0);
console.info(`All ACE slots have been reset.`);
};
getAce() {
return this.#ace;
};
Expand Down

0 comments on commit b8ce8cf

Please sign in to comment.