My understanding of using the EntityOrder command is that it disregards which triangles come first (from greater distance to lesser distance) and instead draws the triangles in the order they are read from the file. Therefore, perspective remains, but triangles that are supposed to be behind something are in front of it sometimes, for example. At least, I think this is how it causes the problems.
My only suggestion is to do this: Completely get rid of the EntityOrder, as it only messes up the meshes. To solve the problem involving guns stuck in walls, try attaching an invisible sphere as a parent entity to the camera. Position it in front of the camera and scale so it creates a semi-'shield' in front of the camera. Then, perform sphere collision testing (as accurately as possible with both x and y radii) with your invisible sphere, and therefore the camera's regular radius remains except for the 'shield' in the front.
So, basically, it'll be shielding your player from moving into a wall too far forward, yet allowing the usual radius collision testing for +y,-y,+x,-x, and -z.
Sorry if it's counfusing. I'd make some code for you, but I haven't the faintest idea how big the gun is, your usual player radius, and other stuff like that.
My only suggestion is to do this: Completely get rid of the EntityOrder, as it only messes up the meshes. To solve the problem involving guns stuck in walls, try attaching an invisible sphere as a parent entity to the camera. Position it in front of the camera and scale so it creates a semi-'shield' in front of the camera. Then, perform sphere collision testing (as accurately as possible with both x and y radii) with your invisible sphere, and therefore the camera's regular radius remains except for the 'shield' in the front.
So, basically, it'll be shielding your player from moving into a wall too far forward, yet allowing the usual radius collision testing for +y,-y,+x,-x, and -z.
Sorry if it's counfusing. I'd make some code for you, but I haven't the faintest idea how big the gun is, your usual player radius, and other stuff like that.