Click code rework, 2nd try

See #1520, this is a cleanup of click code
Fixes #1524 and #1525, also adds attack delay to windoors.

I really hope this works, its a miracle its even mergeable