recipe.product.type doesn't return string but number

This subforum contains all the issues which we already resolved.
MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

recipe.product.type doesn't return string but number

Post by MrDoomah »

When calling

Code: Select all

game.forces.player.recipes['any recipe'].product.type
it return 0 or 1 (the numbers) instead of "item" or "fluid" (the strings) as the api indicates.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5410
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: recipe.product.type doesn't return string but number

Post by Klonan »

Thanks for the report,
Can confirm it return a number, not the name:
Image
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: recipe.product.type doesn't return string but number

Post by Oxyd »

Thanks. Also, product.amount is a floating-point number, not an uint.

The docs will be fixed in the next release.
Post Reply

Return to “Resolved Problems and Bugs”