Author Topic: brick/trust function  (Read 788 times)

could someone post the entire brick system functions?
thanks in advance

The serverCmdPlantBrick function will tell you a lot about brick placement, and trust checking is done in fxDtsBrick::plantedTrustCheck(). PlantedTrustCheck will call ::chainTrustCheckDown and see if any of the down bricks aren't at least build trust level, then ::chainTrustCheckUp for up bricks, then ::chainTrustCheckVolume for water bricks and the like. If there's a trust failure anywhere it will call ::trustCheckFailed to clean up the brick, undo stack, etc. Otherwise it will call ::trustCheckFinished, then the datablock's ::onTrustCheckFinished.

If you want to put scripted functionality into plants then only use the datablock's ::onTrustCheckFinished when you 100% know the brick won't get canceled out or anything since ::trustCheckFinished will do a little extra before it thinks the brick is 100% planted. So package ::trustCheckFinished and if there's anything that goes wrong then call .trustCheckFailed() before you call the parent.