mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
don't segfault when trying to use the loc command without a map loaded
This commit is contained in:
parent
e8cce4f626
commit
755820d8b2
1 changed files with 5 additions and 1 deletions
|
@ -341,12 +341,16 @@ locs_loc (void)
|
||||||
const char *desc = NULL;
|
const char *desc = NULL;
|
||||||
|
|
||||||
// FIXME: need to check to ensure you are actually in the game and alive.
|
// FIXME: need to check to ensure you are actually in the game and alive.
|
||||||
if (Cmd_Argc () == 1) {
|
if (Cmd_Argc () == 1 || strcmp (Cmd_Argv (1), "help") == 0) {
|
||||||
Con_Printf ("loc <add|delete|rename|move|save|zsave> [<description>] "
|
Con_Printf ("loc <add|delete|rename|move|save|zsave> [<description>] "
|
||||||
":Modifies location data, add|rename take <description> "
|
":Modifies location data, add|rename take <description> "
|
||||||
"parameter\n");
|
"parameter\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!cl.worldmodel) {
|
||||||
|
Con_Printf ("No map loaded. Unable to work with location markers.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Cmd_Argc () >= 3)
|
if (Cmd_Argc () >= 3)
|
||||||
desc = Cmd_Args (2);
|
desc = Cmd_Args (2);
|
||||||
mapname = malloc (sizeof (cl.worldmodel->name));
|
mapname = malloc (sizeof (cl.worldmodel->name));
|
||||||
|
|
Loading…
Reference in a new issue