If the county designated is not the proper county and where the court changes the place of trial on account of the action having been brought in the wrong county, the court, in its order granting the change of place of trial, may in its discretion allow to the moving party such terms as to it may seem just; and in case of a dismissal of the action or change of place of trial, the payment of the amount awarded by the court shall be made a condition precedent to the commencement of another action or the further prosecution of the action where change of place of trial has been granted.
SDCL 15-5-13