misode / brigadier-ts

TypeScript port of Mojang/brigadier
MIT License
18 stars 5 forks source link

Zero results are changed to one #5

Closed haykam821 closed 2 years ago

haykam821 commented 2 years ago

When returning a result of 0, the actual result will end up being 1 instead.

This issue is caused by 0 being a falsy value. Thus, it falls back to the default result of 1:

https://github.com/misode/brigadier-ts/blob/303e686b7479c76cf25ff63405a22b1fa63c33fd/src/CommandDispatcher.ts#L85