Patrick Kaleta has been rebuffed in his attempt to locate a sports center at the former Walmart in Hamburg.

State Supreme Court Justice Patrick H. NeMoyer dismissed Kaleta’s challenge to a change in the zoning code the Town of Hamburg made earlier this year.

The Sabres forward, his family members and the foundation they created wanted to buy the former big-box store and convert it into two NHL-regulation ice rinks, a field house, an educational center and a home for the foundation, Helping Individuals To Smile, or HITS.

They claimed Hamburg improperly changed the zoning code earlier this year to allow Worldwide Protective Products of Orchard Park to relocate to the Seven Corners location. The company bid $2 million for the building, while the Kaleta group had offered $1.3 million. The Kaleta interests and a neighbor on McKinley Parkway challenged the action in State Supreme Court.

The town code was ambiguous on whether Worldwide would have been able to engage in light manufacturing by assembling work gloves and protective clothing at the building without a clarification, the town said.

Kaleta challenged the change in the law on three grounds: It constituted spot zoning, it was passed on the same vote that repealed the previous law, and a super-majority of votes on the Town Board was necessary for passage.

But NeMoyer turned down all three claims.

“We didn’t think it was even close on spot zoning, and the judge said the same,” said Town Attorney Kenneth J. Farrell.

The judge did think the town changed the rules for the Orchard Park firm.

“The court has little doubt from the materials before it that the Town Board’s change of the zoning ordinance was intended (or at least motivated) to benefit an entity known as Worldwide Protective Products,” NeMoyer stated.

Terrence M. Connors, attorney for the Kaleta interests, said that is a significant statement.

“We think it is significant that the court confirmed our position that the zoning change was intended or motivated to benefit Worldwide,” Connors said. “That’s not the way zoning should work.”

The judge ruled that the repeal of the old law could be made with the enactment of the zoning law. He also said there were not enough signatures of property owners asking for a supermajority vote, since the signatures were not from all the C-2 districts in town. A supermajority vote on the three-person Town Board requires a unanimous vote, and the final vote on this change was 2-1.

The judge also dismissed a petition brought by Mary Coughlin that challenged the process taken by the board on the vote. The challenge is moot because the town passed the law a second time.

Connors said he will review the decision with his clients and determine a “future course of action.”