Make SetActivatedBadgesComposer dynamic

This commit is contained in:
MyNameIsBatman 2022-03-16 23:48:13 -03:00
parent d3e7356b4b
commit 23d2822fa0

View File

@ -7,22 +7,21 @@ export class SetActivatedBadgesComposer implements IMessageComposer<any[]>
public getMessageArray() public getMessageArray()
{ {
const data = []; const data = [];
let local2 = 1;
while(local2 <= 5) for(let i = 0; i < this._badges.length; i++)
{ {
if(local2 <= this._badges.length) if(i <= this._badges.length)
{ {
data.push(local2); data.push(i + 1);
data.push(this._badges[(local2 - 1)]); data.push(this._badges[i]);
} }
else else
{ {
data.push(local2); data.push(i + 1);
data.push(''); data.push('');
} }
local2++;
} }
return data; return data;
} }
@ -33,8 +32,6 @@ export class SetActivatedBadgesComposer implements IMessageComposer<any[]>
public addActivatedBadge(badge: string): void public addActivatedBadge(badge: string): void
{ {
if(this._badges.length >= 5) return;
this._badges.push(badge); this._badges.push(badge);
} }
} }