Open rdebath opened 3 years ago
Probably better off changing HandlePhysics
delegate to instead return a bool for whether to remove the PhysicsCheck
entry from the checks list or not.
Trying to remember to do C.Data.Data = PhysicsArgs.RemoveFromChecks
everywhere seems to just be fraught with issues
Agreed, though, returning a bool would normally be taken as an indication of success not that you want to do it again. To me it doesn't seem to fit exactly.
Personally I thought it should just delete the timed physics task unless explicitly told that it's to be retriggered; do nothing and it's deleted. After all for performance reasons the primary method of triggering physics changes should be via events not a repeated poll.
If you have a physics-5 map
DoorPhysics.Do
is placed as the handler for air blocks. Deleting a block then places an item on the physics check queue, this block doesn't haveType1
set toCustom
so it is ignored every tick. The below change (for example) cleans up these items.