Then don't release those things.
id open sourced the Doom3 engine, but didn't open the game assets. People ported it to linux. If you wanted to play doom3 on linux, you still legally needed to own the game to get the assets, you just had an open source way of running those assets on linux.
Open sourcing of the doom engine is basically why "this literal toaster runs doom" is a meme now.
Plenty of old enough games will just reverse engineer and rebuild the game engine open source from scratch. OpenMW comes to mind. And they even provide links on where to buy Morrowind in their FAQ, which even further helps drive sales.
> Do I need Morrowind to use OpenMW?
> Yes, if you wish to play Morrowind and its expansions. You must legally own Morrowind before you can use OpenMW to play Morrowind. OpenMW is a game engine recreation and only replaces the program. OpenMW does not come with any “content” or “asset” – namely the art, game data, and other copyrighted material that you need to play the game as designed by Bethesda Softworks. You have to provide this content yourself by installing Morrowind and then configuring OpenMW to use the existing installation.
Open sourcing a game engine does not mean that you have to make the game free.