Raptor007 / aq2-tng

Action Quake 2: The Next Generation. Raptor007's sandbox for testing changes. When verified stable, this code is pushed to the official aq2-tng repo:
https://github.com/aq2-tng/aq2-tng/tree/bots
4 stars 2 forks source link

sv savenodes not creating ltk file (when "action" is not set) #114

Closed darkshade9 closed 2 years ago

darkshade9 commented 2 years ago

Turning botdebug on and creating nodes, I issue the sv savenodes command and it claims to save the node table, but the ltk file never appears to get written to terrain. Is it possible I'm missing a step? Using the latest commit from the bots branch.

Raptor007 commented 2 years ago

It sounds like you're doing it correctly. You also need to create links between nodes, but this shouldn't effect whether or not it writes the file.

If it's on a Linux system, make sure the user running q2proded has write and execute permission on the terrain directory, and has the current working directory the same place as its executable.

Raptor007 commented 2 years ago

Let me know if 0e063ac solves the problem. I would prefer to set a default value rather than always ignore the variable.

This should also fix map locations and IP banlists on servers without +set game action.

Raptor007 commented 2 years ago

If for some reason this does not fix it (maybe Q2 overrides that default) another idea would be:

const char *game_str = game_dir->string;
if( ! game_str[0] )  // Assuming it's empty by default.
    game_str = "action";

... and then replace game_dir->string with game_str in the rest of the function.

darkshade9 commented 2 years ago

I think https://github.com/Raptor007/aq2-tng/commit/0e063ac73328f4c4e275970a23efe46d51e47d17 will work just fine. I also added one other instance where the game_dir is blank unless set

https://github.com/Raptor007/aq2-tng/pull/116

Raptor007 commented 2 years ago

Thanks, good catch!

For later cleanup: It looks like "game" is used in enough places that it should probably be treated like most other cvars: declared once in g_main.c, gi.cvar called once in g_save.c, and extern in g_local.h to provide all other access to it.