Posts: 313
Threads: 32
Joined: Feb 2012
Thanks: 98
Given 14 thank(s) in 13 post(s)
So, iternal m_Items basically is always 3x3 (or 2x2 in inventory crafting grid case)?
Then x,y iterations are reasonable. I thought it was kind of list ^_^"
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
Isn't Lua usually 1-based, instead of 0-based? I can change the GetItem() function so that it takes number in the 1..Width, 1..Height range, if it makes it more Lua-customary
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
Actually I *think* you can do it by adding lua_State* a_LuaState to the function as the first parameter. Lua will then only call that overload of the function.
I think
Posts: 313
Threads: 32
Joined: Feb 2012
Thanks: 98
Given 14 thank(s) in 13 post(s)
06-15-2012, 01:58 AM
(This post was last modified: 06-15-2012, 02:45 AM by Taugeshtu.)
so, xoft, new crafting hooks seems to be buggy (at least NO_RECIPE one).
Looks like when plugin get such callback and set recipe output, player can get crafting result, but crafting ingridients won't clear!
Try fixies and you'll get what I mean.
Could I suggest one thing about OnChunkGenerated and OnChunkGenerating, please?
Let's sync them and give cLuaChunk to OnChunkGenerated as parameter and give cWorld to OnChunkGenerating as parameter. This will be helpful.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1074 thank(s) in 852 post(s)
OnChunkGenerated cannot have a cLuaChunk parameter, because the chunk is already stored in the cWorld and other threads may already be modifying its data.
OnChunkGenerating should probably get the cWorld parameter, because the plugin should care in which world the chunk is generating. I'll take care of that.