if it’s not folded, then it’s worth a go- new rotors won’t necessarily be straight either.
It’s hard to explain, but the best way to do it is in the bike. Take the caliper off, and cobble together brake adaptors so that you end up with a bolt threaded through one of them, pointing at the rotor. (on IS mount this is usually easy- undo one end from the frame/fork completely, slacken the other bolt so the adaptor moves, then swing it round til the unused bolthole is over the disc track.
You just made a precision runout gauge. By tightening/loosening the bolt, you can easily find high points in the rotor (either by eye, but I do it by contact), then true accordingly with an adjustable wrench. voila, it is straight. Unless it’s ****ed, in which case, it’s still ****ed.