Just don't do it.
Use the grenade launcher instead; its quicker, more accurate, and has a faster reload time. Plus, you are less likely to TK your teammates and your base's shit. My HoF/HD loadout doesn't even have a mortar in it. True story.
Still want insta-gib power of the mortar indoors?
Use SSminenade script. It (simultaneously) throws then detonates a mine and grenade..used in combo with the grenade launcher and/or plasma rifle while fighting indoors its power cannot be denied. Vets hate this tactic used against them, but goes a long way to evening up the playing field between you and them: a plas/nade launcher combo with this script gives you fast reload times (unlike the mortar) and you wont need to be terribly accurate. Just make sure to back away so you don't blow yourself up!
Hope that helps.