lock -> g.lock

This commit is contained in:
Bart House
2018-12-25 13:05:43 -08:00
parent c67f7e5122
commit 64be5fd35a
7 changed files with 54 additions and 54 deletions

View File

@@ -421,22 +421,22 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
* overwritten without confirmation when a user starts up
* another game with the same player name.
*/
Strcpy(lock, g.plname);
regularize(lock);
Strcpy(g.lock, g.plname);
regularize(g.lock);
getlock();
#else /* What follows is !PC_LOCKING */
#ifdef AMIGA /* We'll put the bones & levels in the user specified directory \
-jhsa */
Strcat(lock, g.plname);
Strcat(lock, ".99");
Strcat(g.lock, g.plname);
Strcat(g.lock, ".99");
#else
#ifndef MFLOPPY
/* I'm not sure what, if anything, is left here, but MFLOPPY has
* conflicts with set_lock_and_bones() in files.c.
*/
Strcpy(lock, g.plname);
Strcat(lock, ".99");
regularize(lock); /* is this necessary? */
Strcpy(g.lock, g.plname);
Strcat(g.lock, ".99");
regularize(g.lock); /* is this necessary? */
/* not compatible with full path a la AMIGA */
#endif
#endif

View File

@@ -85,14 +85,14 @@ eraseoldlocks()
*/
for (i = 1; i <= MAXDUNGEON * MAXLEVEL + 1; i++) {
/* try to remove all */
set_levelfile_name(lock, i);
(void) unlink(fqname(lock, LEVELPREFIX, 0));
set_levelfile_name(g.lock, i);
(void) unlink(fqname(g.lock, LEVELPREFIX, 0));
}
set_levelfile_name(lock, 0);
set_levelfile_name(g.lock, 0);
#ifdef HOLD_LOCKFILE_OPEN
really_close();
#endif
if (unlink(fqname(lock, LEVELPREFIX, 0)))
if (unlink(fqname(g.lock, LEVELPREFIX, 0)))
return 0; /* cannot remove it */
return (1); /* success! */
}
@@ -117,9 +117,9 @@ getlock()
}
/* regularize(lock); */ /* already done in pcmain */
Sprintf(tbuf, "%s", fqname(lock, LEVELPREFIX, 0));
set_levelfile_name(lock, 0);
fq_lock = fqname(lock, LEVELPREFIX, 1);
Sprintf(tbuf, "%s", fqname(g.lock, LEVELPREFIX, 0));
set_levelfile_name(g.lock, 0);
fq_lock = fqname(g.lock, LEVELPREFIX, 1);
if ((fd = open(fq_lock, 0)) == -1) {
if (errno == ENOENT)
goto gotlock; /* no such file */