mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-24 21:12:27 +00:00
More fixes for the loc code.
This commit is contained in:
parent
712b655c1b
commit
f6b12b12e3
3 changed files with 10 additions and 13 deletions
|
@ -42,9 +42,9 @@ void locs_load(char *filename);
|
|||
void locs_reset();
|
||||
void locs_add(vec3_t location, char *name);
|
||||
void map_to_loc (char *mapname, char *filename);
|
||||
void locs_del (char *filename, vec3_t loc);
|
||||
void locs_edit (char *filename, vec3_t loc, char *desc);
|
||||
void locs_mark (char *filename, vec3_t loc, char *desc);
|
||||
void locs_del (vec3_t loc);
|
||||
void locs_edit (vec3_t loc, char *desc);
|
||||
void locs_mark (vec3_t loc, char *desc);
|
||||
void locs_save (char *filename, qboolean gz);
|
||||
int locs_nearest (vec3_t loc);
|
||||
#endif // __locs_h
|
||||
|
|
|
@ -213,10 +213,9 @@ locs_save (char *filename, qboolean gz)
|
|||
}
|
||||
|
||||
void
|
||||
locs_mark (char *filename, vec3_t loc, char *desc)
|
||||
locs_mark (vec3_t loc, char *desc)
|
||||
{
|
||||
locs_add (loc,desc);
|
||||
locs_save (filename);
|
||||
Con_Printf ("Marked current location: %s\n",desc);
|
||||
}
|
||||
|
||||
|
@ -227,7 +226,7 @@ locs_mark (char *filename, vec3_t loc, char *desc)
|
|||
*/
|
||||
|
||||
void
|
||||
locs_edit (char *filename, vec3_t loc, char *desc)
|
||||
locs_edit (vec3_t loc, char *desc)
|
||||
{
|
||||
int i;
|
||||
if (locations_count) {
|
||||
|
@ -242,13 +241,12 @@ locs_edit (char *filename, vec3_t loc, char *desc)
|
|||
Con_Printf ("Changing location description to %s\n",
|
||||
locations[i]->name);
|
||||
}
|
||||
locs_save (filename);
|
||||
} else
|
||||
Con_Printf ("Error: No location markers to modify!\n");
|
||||
}
|
||||
|
||||
void
|
||||
locs_del (char *filename, vec3_t loc)
|
||||
locs_del (vec3_t loc)
|
||||
{
|
||||
int i;
|
||||
if (locations_count) {
|
||||
|
@ -261,7 +259,6 @@ locs_del (char *filename, vec3_t loc)
|
|||
for (; i < locations_count; i++)
|
||||
locations[i] = locations[i+1];
|
||||
locations[locations_count] = NULL;
|
||||
locs_save(filename);
|
||||
} else
|
||||
Con_Printf ("Error: No location markers to remove\n");
|
||||
}
|
||||
|
|
|
@ -381,28 +381,28 @@ locs_loc (void)
|
|||
|
||||
if (stricmp(Cmd_Argv(1),"add") == 0) {
|
||||
if (Cmd_Argc () >= 3)
|
||||
locs_mark(locfile,cl.simorg,desc);
|
||||
locs_mark(cl.simorg,desc);
|
||||
else
|
||||
Con_Printf("loc add <description> :marks the current location with the description and records the information into a loc file.\n");
|
||||
}
|
||||
|
||||
if (stricmp(Cmd_Argv(1),"rename") == 0) {
|
||||
if (Cmd_Argc () >= 3)
|
||||
locs_edit(locfile,cl.simorg,desc);
|
||||
locs_edit(cl.simorg,desc);
|
||||
else
|
||||
Con_Printf("loc rename <description> :changes the description of the nearest location marker\n");
|
||||
}
|
||||
|
||||
if (stricmp(Cmd_Argv(1),"delete") == 0) {
|
||||
if (Cmd_Argc () == 2)
|
||||
locs_del(locfile,cl.simorg);
|
||||
locs_del(cl.simorg);
|
||||
else
|
||||
Con_Printf("loc delete :removes nearest location marker\n");
|
||||
}
|
||||
|
||||
if (stricmp(Cmd_Argv(1),"move") == 0) {
|
||||
if (Cmd_Argc () == 2)
|
||||
locs_edit(locfile,cl.simorg,NULL);
|
||||
locs_edit(cl.simorg,NULL);
|
||||
else
|
||||
Con_Printf("loc move :moves the nearest location marker to your current location\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue