Solid Block Arrays
#1
Dobrý den!

We need two solid block arrays - one to list all blocks that microblocks (torches, levers, buttons, etc.) cannot be placed on, and one to list blocks without collision.

For example:

g_BlockIsTorchPlaceable
Sign = false
Piston = false etc etc
Crafting table
Leaves
Glass
...

g_BlockIsSolid
Sign = false
Flower = false etc etc
Ferns
Bushes
etc.

This will fix xoft's arrows going through blocks like glass because g_BlockIsSolid tells the code the glass isn't solid (which it is, just not torchable), and also hopefully fix torches being able to be placed on non-solid blocks.

The only problem is that I am not sure how to do it. g_BlockIsSolid has code at the top setting looping everything to true, but it doesn't seem to do anything. Doing a g_BlockIsSolid[E_BLOCK_GLASS] will return false, even though everything was apparently set to true. Wut.

So yeah.
Reply
Thanks given by:
#2
Dobrý den i tobě Smile

Making it into a separate array is only reasonable if the sets of allowed blocks are the same for all the "apertures" (what else to call those levers, buttons, torches etc?). If they are not the same, then listing "exceptions" in the appropriate cBlockHandler is a better option.

Btw, you can place all of them on the side of a crafting table - while holding the crouch key.
Reply
Thanks given by:
#3
Just for the record, the memsets make the array default to false, and the looping through setting to true make the array default to true.
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)