In the moments before it was to be called for a vote, state lawmakers put the brakes on a change to Illinois’ gambling tax rates that would have delivered Chicago Mayor Lori Lightfoot a big win.

A spokesman for Senate President John Cullerton said late Wednesday that he “remains optimistic” lawmakers can come to an agreement on the legislation.

An amended Senate Bill 669 was on deck in Cullerton’s chamber Wednesday evening, but the lawmakers gaveled out for the evening without calling it for a vote.

Under the existing proposal, both the city and state would see less tax revenue at graduated rates, but the state’s cut would be more significant. It would also remove a number of startup costs for a potential developer of a Chicago casino.

Earlier this year, an independent study that found the state and local taxes were too high to attract private investment in the proposed Chicago casino.

The cut in state revenue would mean less money for the state’s infrastructure fund.

“How do we tell all of these other communities that are gaming in economically depressed areas that Chicago’s going to get a better deal with paying the state than everyone else?” state Sen. Dave Syverson, R-Rockford, said during a Senate Executive Committee hearing on the measure. Syverson’s community was granted a new casino under legislation passed earlier this year.

An official from Chicago said the state would get even less revenue if a Chicago casino never gets built.

Thursday is the final scheduled day for the General Assembly this year. Lightfoot was in Springfield pushing lawmakers to pass.

Lightfoot had made the rare move of traveling to Springfield in person to push for her initiatives, rather than sending a representative.

Facing a budget hole worth hundreds of millions of dollars, the freshman mayor is relying on state lawmakers to allow her to increase transfer taxes on real estate at a graduated level, something that’s seen as a nonstarter with Republicans and progressive Democrats upset that Lightfoot isn’t doing so and using the funds to aid the city’s homeless.

Lightfoot, in recent weeks, has been more vocal about the state’s pension laws and the governor’s need to do more to address their strain on local budgets. She told the Better Government Association earlier this month that she would like to see a “concerted effort to tackle pension reform for both the states and municipalities, whatever form that takes.”