If, in any action brought to recover the possession of demised premises upon a forfeiture for the nonpayment of rent, the tenant, before judgment given in such action, pays or tenders the rent due and the costs of the action, all further proceedings in such action shall cease. If the plaintiff further prosecutes his action, and the defendant pays into court for the use of the plaintiff a sum equal to that which shall be found to be due, and the costs, to the time of such payment, or to the time of a tender and refusal, if one has occurred, the defendant shall recover from the plaintiff all subsequent costs; the plaintiff shall be allowed to receive the sum paid into court for his use, and the proceedings shall be stayed.
N.C. Gen. Stat. § 42-33