Is a move illegal because of a future threat, or only an immediate one?

These answers restate the rules implemented by our open-source engine, which follows the WXF laws and is regression-tested against the official 110-diagram repetition casebook. Where an answer refers to a specific position, that position lives on the linked reference page, where the build verifies it against the engine before publishing.

Direct answer

Only an immediate one. A move is illegal if it leaves your own general in check the instant it is made, nothing more, nothing less. It does not matter that the resulting position hands your opponent a devastating follow-up next move, or the move after that; if your general is safe right now, the move is legal, however bad it turns out to be.

Legality and quality are different questions

A completely legal move can lose the game outright. Walking a chariot into a square where it will be captured next move is a bad move, not an illegal one, and the rules make no distinction between a slightly worse move and a catastrophic one, both are simply legal.

Where this matters most

New players sometimes expect the interface to stop them from playing something that is merely unwise. It will not, and should not: xiangqi's rules police only the current position's legality, and every question of whether a legal move is actually good is left entirely to calculation.

Related questions

So the engine will let me blunder my chariot?

Yes, as long as the move itself is legal. Preventing bad moves is not the rules' job.

Does check work the same way, only the immediate position?

Yes. Check is evaluated on the position as it stands after the move, not on anything further ahead.

Try it on a real board

Reading an answer is one thing; playing it is another. Free, instant, and nothing to install.