The proposed patch adds a "-d /path/to/dir" option (global outdir, default .) and routes all output files (world_*, cmap, lmap, pmap) through outdir, plus prints the "Output directory set to:"/"Output directory:" lines. Note: it doesn't create the directory if missing — fopen will fail if outdir doesn't exist.
The enclosed patch was generated via Claude Sonnet 4.6 and followed the guidelines from https://sourceforge.net/p/crossfire/crossfire-server/ci/master/tree/doc/Developers/programming_guide.md
The "parent ticket" to this patch was https://sourceforge.net/p/crossfire/patches/479/
Diff:
Fixed formatting issue in the summary
Patch fails to apply for me:
Well... both disappointing and embarrassing. Sorry about that.
Second try with a recreated patch.
Ran further testing.
~/crossfire-crossfire-maps/Info$ patch -p1 --dry-run < land_outdir-2.patch
checking file land.c
~/crossfire-crossfire-maps/Info$ patch -p1 < land_outdir-2.patch
patching file land.c
No output of errors.
I wouldn't use sprintf in new code, snprintf does the same thing but also makes sure you don't write outside of the given length:
snprintf(path, sizeof(path), ....