The Pennsylvania Senate passed a bill Monday banning municipal gun ordinances more restrictive than state law.

The 30-19 vote comes four months after the State Supreme Court struck down similar legislation, Act 192, because of technicalities in the way lawmakers originally passed it two years earlier.

Act 192, the court ruled, violated the state’s single-subject rule — meaning it addressed too many subjects in one bill — making it unconstitutional. Republicans had amended the law’s language into a scrap metal theft bill and pushed it across then-Gov. Tom Corbett’s desk just days before he lost his re-election bid to Democrat Tom Wolf in 2014.

So lawmakers started over, drafting similar pieces of legislation — House Bill 2258 and Senate Bill 1330 — in hopes of passing the law before the end of legislative session in December.

The House Judiciary Committee advanced HB 2258 to the chamber floor for a final vote last month, though no timeline for its consideration has been scheduled.

While the House bill enjoys some bipartisan support, Senate Democrats unanimously panned SB 1330 Monday because it allows any gun owner or well-financed membership organization, like the National Rifle Association, to sue municipalities.

It’s happened before. The NRA filed suit against Philadelphia, Pittsburgh and Lancaster less than two weeks after Act 192 took effect in January 2015.

Because of this, Republican Sen. Pat Vance, R-Cumberland, sided with Democrats Monday in casting a no-vote. Fellow Republican Sen. Stewart Greenleaf, R-Montgomery, also voted against the bill.

Meanwhile, SB 1330’s supporters argue the law brings consistency and prevents a patchwork of contradictory local gun ordinances. Pennsylvania has more than 2,500 municipalities statewide.

“Where so many different ordinances are allowed to exist, citizens with no criminal intent are placed in danger of breaking restrictions where they don’t know they exist,” said Sen. Rich Alloway, R-Franklin, the bill’s prime sponsor, in a memo circulated to Senate lawmakers in June. “Furthermore, it is unreasonable to require residents of Pennsylvania and citizens passing through from other states to memorize every firearm ordinance as they pass through each local jurisdiction.”

The bill awaits consideration in the House Judiciary Committee. Even if lawmakers pass the bill before the end of the year, the governor has indicated he doesn’t currently support either version.