Backport flags
Fix flag drop position
Backport flag entity rendering
Remove check_pdist