 During the ensuing battle, he defeated the Shu generals Liao Hua and Zhang Yi and killed Zhang Ni.However, Zhang Ni's desperate fight also inflicted a devastating damage to Xu Zhi's army, so he was forced to retreat and await reinforcements.Shu forces thus gained some foothold in the Long (隴) region (in present-day Gansu) and the battles went on and off for some time until Jiang Wei finally suffered a catastrophic defeat at the hands of the Wei general Deng Ai.