mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2024-11-14 19:04:59 -05:00
handle count with number properly in packet test
This commit is contained in:
parent
c0ae9b1546
commit
4604330586
1 changed files with 3 additions and 1 deletions
|
@ -44,7 +44,9 @@ const values = {
|
||||||
buffer: Buffer.alloc(8),
|
buffer: Buffer.alloc(8),
|
||||||
array: function (typeArgs, context) {
|
array: function (typeArgs, context) {
|
||||||
let count
|
let count
|
||||||
if (typeof typeArgs.count === 'object') {
|
if (typeof typeArgs.count === 'number') {
|
||||||
|
count = typeArgs.count
|
||||||
|
} else if (typeof typeArgs.count === 'object') {
|
||||||
count = evalCount(typeArgs.count, context)
|
count = evalCount(typeArgs.count, context)
|
||||||
} else if (typeArgs.count !== undefined) {
|
} else if (typeArgs.count !== undefined) {
|
||||||
count = getField(typeArgs.count, context)
|
count = getField(typeArgs.count, context)
|
||||||
|
|
Loading…
Reference in a new issue