Did you consent to a search?
Did they have permission from any occupant to enter the apartment?
Did they have probable cause to enter the apartment?

If the answer to any of these is yes, you are fucked.
If the answer to ALL THREE is no, your lawyer would have been able to get you off on a technicality except for the one SMALL detail...

You are on probation. You do not enjoy the same rights to privacy that other citizens have. The probation paperwork probably has written on it somewhere that the police or your PO may enter your dwelling at any time, for any reason. That's sure as hell what mine said, and why I could not grow in my home during that time.

You still need a lawyer, NOW, and a damn good reason for having a gun. Rifle or handgun? Rifle could legitimately be argued to be for strictly rabbit-huntin' purposes, and be ready to show a valid hunting license or the one from the most recent season if that is the case. Even though you are supposed to surrender all firearms when you go on probation, you want to make damn sure that when you try to explain why you had it, it does not come out sounding like 'Because it makes me look cool/tough'. A handgun looks a LOT worse to the cops when it's sitting next to some drugs...

What were you thinking?

Edit: Yup, they had probable cause... I see that you were growing in an apartment with no odor control... despite many warnings...
http://boards.cannabis.com/indoor-gr...apartment.html

Gotta listen to the oldsters, man. They been around the block already.