distinguish global variables that get written to savefile
The g? structs had a mix of variables that were written to
the savefile, and those that were not.
For better clarity and to distinguish those that end up in
the savefile, relocate some g? variables that get written
directly to the savefile into different structs.
This updates EDITLEVEL, although technically it probably
didn't need to, since savefile contents are not changing.
Details:
gb.bases -> svb.bases
gb.bbubbles -> svb.bbubbles
gb.branches -> svb.branches
gc.context -> svc.context
gd.disco -> svd.disco
gd.dndest -> svd.dndest
gd.doors -> svd.doors
gd.doors_alloc -> svd.doors_alloc
gd.dungeon_topology -> svd.dungeon_topology
gd.dungeons -> svd.dungeons
ge.exclusion_zones -> sve.exclusion_zones
gh.hackpid -> svh.hackpid
gi.inv_pos -> svi.inv_pos
gk.killer -> svk.killer
gl.lastseentyp -> svl.lastseentyp
gl.level -> svl.level
gl.level_info -> svl.level_info
gm.mapseenchn -> svm.mapseenchn
gm.moves -> svm.moves
gm.mvitals -> svm.mvitals
gn.n_dgns -> svn.n_dgns
gn.n_regions -> svn.n_regions
gn.nroom -> svn.nroom
go.oracle_cnt -> svo.oracle_cnt
gp.pl_character -> svp.pl_character
gp.pl_fruit -> svp.pl_fruit
gp.plname -> svp.plname
gp.program_state -> svp.program_state
gq.quest_status -> svq.quest_status
gr.rooms -> svr.rooms
gs.sp_levchn -> svs.sp_levchn
gs.spl_book -> svs.spl_book
gt.timer_id -> svt.timer_id
gt.tune -> svt.tune
gu.updest -> svu.updest
gx.xmax -> svx.xmax
gx.xmin -> svx.xmin
gy.ymax -> svy.ymax
gy.ymin -> svy.ymin
Related note:
There are some pointer variables that are heads of chains that were not
moved from 'g?' to 'sv?', because they are not actually written to the
savefile directly, but the objects/monst/trap/lightsource/timer in the
chains they point to are. That can be changed, if desired.
Examples: gi.invent, gm.migrating_objs, gb.billobjs, gm.migrating_mons,
gf.ftrap, gl.light_base, gt.timer_base
This commit is contained in:
@@ -185,7 +185,7 @@ time_t when;
|
||||
SetDrMd(rp, JAM1);
|
||||
|
||||
/* Put name on stone */
|
||||
Sprintf(buf, "%s", gp.plname);
|
||||
Sprintf(buf, "%s", svp.plname);
|
||||
buf[STONE_LINE_LEN] = 0;
|
||||
tomb_text(buf);
|
||||
|
||||
|
||||
@@ -357,7 +357,7 @@ menu_item **retmip;
|
||||
nw->Screen = HackScreen;
|
||||
|
||||
if (win == WIN_INVEN) {
|
||||
sprintf(title, "%s the %s's Inventory", gp.plname, gp.pl_character);
|
||||
sprintf(title, "%s the %s's Inventory", svp.plname, svp.pl_character);
|
||||
nw->Title = title;
|
||||
if (lastinvent.MaxX != 0) {
|
||||
nw->LeftEdge = lastinvent.MinX;
|
||||
|
||||
@@ -438,10 +438,10 @@ amii_askname()
|
||||
amii_getlin("Who are you?", plnametmp);
|
||||
} while (strlen(plnametmp) == 0);
|
||||
|
||||
strncpy(gp.plname, plnametmp, PL_NSIZ - 1); /* Avoid overflowing plname[] */
|
||||
gp.plname[PL_NSIZ - 1] = 0;
|
||||
strncpy(svp.plname, plnametmp, PL_NSIZ - 1); /* Avoid overflowing plname[] */
|
||||
svp.plname[PL_NSIZ - 1] = 0;
|
||||
|
||||
if (*gp.plname == '\33') {
|
||||
if (*svp.plname == '\33') {
|
||||
clearlocks();
|
||||
exit_nhwindows(NULL);
|
||||
nh_terminate(0);
|
||||
@@ -475,9 +475,9 @@ amii_player_selection()
|
||||
#if 0 /* Don't query the user ... instead give random character -jhsa */
|
||||
|
||||
#if 0 /* OBSOLETE */
|
||||
if( *gp.pl_character ){
|
||||
gp.pl_character[ 0 ] = toupper( gp.pl_character[ 0 ] );
|
||||
if( strchr( pl_classes, gp.pl_character[ 0 ] ) )
|
||||
if( *svp.pl_character ){
|
||||
svp.pl_character[ 0 ] = toupper( svp.pl_character[ 0 ] );
|
||||
if( strchr( pl_classes, svp.pl_character[ 0 ] ) )
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -531,19 +531,19 @@ amii_player_selection()
|
||||
case VANILLAKEY:
|
||||
if( strchr( pl_classes, toupper( code ) ) )
|
||||
{
|
||||
gp.pl_character[0] = toupper( code );
|
||||
svp.pl_character[0] = toupper( code );
|
||||
aredone = 1;
|
||||
}
|
||||
else if( code == ' ' || code == '\n' || code == '\r' )
|
||||
{
|
||||
flags.initrole = randrole(FALSE);
|
||||
#if 0 /* OBSOLETE */
|
||||
strcpy( gp.pl_character, roles[ rnd( 11 ) ] );
|
||||
strcpy( svp.pl_character, roles[ rnd( 11 ) ] );
|
||||
#endif
|
||||
aredone = 1;
|
||||
amii_clear_nhwindow( WIN_BASE );
|
||||
CloseShWindow( cwin );
|
||||
RandomWindow( gp.pl_character );
|
||||
RandomWindow( svp.pl_character );
|
||||
return;
|
||||
}
|
||||
else if( code == 'q' || code == 'Q' )
|
||||
@@ -563,15 +563,15 @@ amii_player_selection()
|
||||
case 1: /* Random Character */
|
||||
flags.initrole = randrole(FALSE);
|
||||
#if 0 /* OBSOLETE */
|
||||
strcpy( gp.pl_character, roles[ rnd( 11 ) ] );
|
||||
strcpy( svp.pl_character, roles[ rnd( 11 ) ] );
|
||||
#endif
|
||||
amii_clear_nhwindow( WIN_BASE );
|
||||
CloseShWindow( cwin );
|
||||
RandomWindow( gp.pl_character );
|
||||
RandomWindow( svp.pl_character );
|
||||
return;
|
||||
|
||||
default:
|
||||
gp.pl_character[0] = gd->GadgetID;
|
||||
svp.pl_character[0] = gd->GadgetID;
|
||||
break;
|
||||
}
|
||||
aredone = 1;
|
||||
|
||||
@@ -132,14 +132,14 @@ whoami(void)
|
||||
*/
|
||||
char *s;
|
||||
|
||||
if (*gp.plname)
|
||||
if (*svp.plname)
|
||||
return;
|
||||
if (s = nh_getenv("USER")) {
|
||||
(void) strncpy(gp.plname, s, sizeof(gp.plname) - 1);
|
||||
(void) strncpy(svp.plname, s, sizeof(svp.plname) - 1);
|
||||
return;
|
||||
}
|
||||
if (s = nh_getenv("LOGNAME")) {
|
||||
(void) strncpy(gp.plname, s, sizeof(gp.plname) - 1);
|
||||
(void) strncpy(svp.plname, s, sizeof(svp.plname) - 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -177,11 +177,11 @@ process_options(int argc, char **argv)
|
||||
#endif
|
||||
case 'u':
|
||||
if (argv[0][2])
|
||||
(void) strncpy(gp.plname, argv[0] + 2, sizeof(gp.plname) - 1);
|
||||
(void) strncpy(svp.plname, argv[0] + 2, sizeof(svp.plname) - 1);
|
||||
else if (argc > 1) {
|
||||
argc--;
|
||||
argv++;
|
||||
(void) strncpy(gp.plname, argv[0], sizeof(gp.plname) - 1);
|
||||
(void) strncpy(svp.plname, argv[0], sizeof(svp.plname) - 1);
|
||||
} else
|
||||
raw_print("Player name expected after -u");
|
||||
break;
|
||||
@@ -236,15 +236,15 @@ getlock(void)
|
||||
{
|
||||
int fd;
|
||||
|
||||
Sprintf(gl.lock, "%d%s", getuid(), gp.plname);
|
||||
Sprintf(gl.lock, "%d%s", getuid(), svp.plname);
|
||||
regularize(gl.lock);
|
||||
set_levelfile_name(gl.lock, 0);
|
||||
fd = creat(gl.lock, FCMASK);
|
||||
if (fd == -1) {
|
||||
error("cannot creat lock file.");
|
||||
} else {
|
||||
if (write(fd, (genericptr_t) &gh.hackpid, sizeof(gh.hackpid))
|
||||
!= sizeof(gh.hackpid)) {
|
||||
if (write(fd, (genericptr_t) &svh.hackpid, sizeof(svh.hackpid))
|
||||
!= sizeof(svh.hackpid)) {
|
||||
error("cannot write lock");
|
||||
}
|
||||
if (close(fd) == -1) {
|
||||
|
||||
@@ -228,7 +228,7 @@ macopen(const char *name, int flags, long fileType)
|
||||
Handle name;
|
||||
Str255 plnamep;
|
||||
|
||||
C2P(gp.plname, plnamep);
|
||||
C2P(svp.plname, plnamep);
|
||||
name = (Handle)NewString(plnamep);
|
||||
if (name)
|
||||
replace_resource(name, 'STR ', PLAYER_NAME_RES_ID,
|
||||
|
||||
@@ -225,7 +225,7 @@ process_openfile(short src_vol, long src_dir, Str255 fName, OSType ftype)
|
||||
Handle name = Get1Resource('STR ', PLAYER_NAME_RES_ID);
|
||||
if (name) {
|
||||
Str255 save_f_p;
|
||||
P2C(*(StringHandle) name, gp.plname);
|
||||
P2C(*(StringHandle) name, svp.plname);
|
||||
set_savefile_name(TRUE);
|
||||
C2P(fqname(gs.SAVEF, SAVEPREFIX, 0), save_f_p);
|
||||
force_hdelete(theDirs.dataRefNum, theDirs.dataDirID,
|
||||
|
||||
@@ -493,8 +493,8 @@ mac_askname()
|
||||
SetPortDialogPort(askdialog);
|
||||
|
||||
/* Initialize the name text item */
|
||||
ask_restring(gp.plname, str);
|
||||
if (gp.plname[0]) {
|
||||
ask_restring(svp.plname, str);
|
||||
if (svp.plname[0]) {
|
||||
GetDialogItem(askdialog, RSRC_ASK_NAME, &type, &handle, &rect);
|
||||
SetDialogItemText(handle, str);
|
||||
}
|
||||
@@ -502,8 +502,8 @@ mac_askname()
|
||||
{
|
||||
Str32 pName;
|
||||
pName [0] = 0;
|
||||
if (gp.plname && gp.plname [0]) {
|
||||
strcpy ((char *) pName, gp.plname);
|
||||
if (svp.plname && svp.plname [0]) {
|
||||
strcpy ((char *) pName, svp.plname);
|
||||
c2pstr ((char *) pName);
|
||||
} else {
|
||||
Handle h;
|
||||
@@ -548,7 +548,7 @@ mac_askname()
|
||||
if (flags.initrole >= 0)
|
||||
currrole = flags.initrole;
|
||||
/* Check for backward compatibility */
|
||||
else if ((currrole = str2role(gp.pl_character)) < 0)
|
||||
else if ((currrole = str2role(svp.pl_character)) < 0)
|
||||
currrole = randrole(FALSE);
|
||||
|
||||
/* Initialize the race popup menu */
|
||||
@@ -735,8 +735,8 @@ mac_askname()
|
||||
GetDialogItemText(handle, str);
|
||||
if (str[0] > PL_NSIZ - 1)
|
||||
str[0] = PL_NSIZ - 1;
|
||||
BlockMove(&str[1], gp.plname, str[0]);
|
||||
gp.plname[str[0]] = '\0';
|
||||
BlockMove(&str[1], svp.plname, str[0]);
|
||||
svp.plname[str[0]] = '\0';
|
||||
|
||||
/* Destroy the dialog */
|
||||
for (i = RSRC_ASK_ROLE; i <= RSRC_ASK_MODE; i++) {
|
||||
@@ -758,14 +758,14 @@ mac_askname()
|
||||
break;
|
||||
case 2: /* Debug */
|
||||
wizard = 1;
|
||||
strcpy(gp.plname, WIZARD_NAME);
|
||||
strcpy(svp.plname, WIZARD_NAME);
|
||||
break;
|
||||
default: /* Quit */
|
||||
ExitToShell();
|
||||
}
|
||||
|
||||
/* Process the role */
|
||||
strcpy(gp.pl_character, roles[currrole].name.m);
|
||||
strcpy(svp.pl_character, roles[currrole].name.m);
|
||||
flags.initrole = currrole;
|
||||
|
||||
/* Process the race */
|
||||
|
||||
@@ -24,7 +24,7 @@ getlock(void)
|
||||
int fd;
|
||||
int pid = getpid(); /* Process ID */
|
||||
|
||||
Sprintf(gl.lock, "%d%s", getuid(), gp.plname);
|
||||
Sprintf(gl.lock, "%d%s", getuid(), svp.plname);
|
||||
set_levelfile_name(gl.lock, 0);
|
||||
|
||||
if ((fd = open(gl.lock, O_RDWR | O_EXCL | O_CREAT, LEVL_TYPE)) == -1) {
|
||||
|
||||
@@ -459,7 +459,7 @@ plselInitDialog(HWND hWnd)
|
||||
TCHAR wbuf[BUFSZ];
|
||||
|
||||
/* set player name */
|
||||
SetDlgItemText(hWnd, IDC_PLSEL_NAME, NH_A2W(gp.plname, wbuf, sizeof(wbuf)));
|
||||
SetDlgItemText(hWnd, IDC_PLSEL_NAME, NH_A2W(svp.plname, wbuf, sizeof(wbuf)));
|
||||
|
||||
/* check flags for consistency */
|
||||
if (flags.initrole >= 0) {
|
||||
|
||||
@@ -39,7 +39,7 @@ mswin_have_input()
|
||||
return
|
||||
#ifdef SAFERHANGUP
|
||||
/* we always have input (ESC) if hangup was requested */
|
||||
gp.program_state.done_hup ||
|
||||
svp.program_state.done_hup ||
|
||||
#endif
|
||||
(nhi_read_pos != nhi_write_pos);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ mswin_input_pop()
|
||||
|
||||
#ifdef SAFERHANGUP
|
||||
/* always return ESC when hangup was requested */
|
||||
if (gp.program_state.done_hup) {
|
||||
if (svp.program_state.done_hup) {
|
||||
static MSNHEvent hangup_event;
|
||||
hangup_event.type = NHEVENT_CHAR;
|
||||
hangup_event.kbd.ch = '\033';
|
||||
@@ -98,7 +98,7 @@ mswin_input_peek()
|
||||
|
||||
#ifdef SAFERHANGUP
|
||||
/* always return ESC when hangup was requested */
|
||||
if (gp.program_state.done_hup) {
|
||||
if (svp.program_state.done_hup) {
|
||||
static MSNHEvent hangup_event;
|
||||
hangup_event.type = NHEVENT_CHAR;
|
||||
hangup_event.kbd.ch = '\033';
|
||||
|
||||
@@ -826,7 +826,7 @@ mswin_layout_main_window(HWND changed_child)
|
||||
/* show command window only if it exists and
|
||||
the game is ready (plname is set) */
|
||||
if (GetNHApp()->bCmdPad && cmd_size.cx > 0 && cmd_size.cy > 0
|
||||
&& *gp.plname) {
|
||||
&& *svp.plname) {
|
||||
MoveWindow(GetNHApp()->hCmdWnd, cmd_org.x, cmd_org.y, cmd_size.cx,
|
||||
cmd_size.cy, TRUE);
|
||||
ShowWindow(GetNHApp()->hCmdWnd, SW_SHOW);
|
||||
|
||||
@@ -533,7 +533,7 @@ onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
if (!data->text.text) {
|
||||
data->text.text = mswin_init_text_buffer(
|
||||
gp.program_state.gameover ? FALSE : GetNHApp()->bWrapText);
|
||||
svp.program_state.gameover ? FALSE : GetNHApp()->bWrapText);
|
||||
if (!data->text.text)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ FormatStatusString(char *text, int format)
|
||||
int hp, hpmax;
|
||||
int cap = near_capacity();
|
||||
|
||||
Strcpy(text, gp.plname);
|
||||
Strcpy(text, svp.plname);
|
||||
if ('a' <= text[0] && text[0] <= 'z')
|
||||
text[0] += 'A' - 'a';
|
||||
text[10] = 0;
|
||||
@@ -253,7 +253,7 @@ FormatStatusString(char *text, int format)
|
||||
|
||||
/* forth line */
|
||||
if (flags.time)
|
||||
Sprintf(nb = eos(nb), "T:%ld ", gm.moves);
|
||||
Sprintf(nb = eos(nb), "T:%ld ", svm.moves);
|
||||
|
||||
if (strcmp(hu_stat[u.uhs], " ")) {
|
||||
Strcat(text, hu_stat[u.uhs]);
|
||||
|
||||
@@ -39,7 +39,7 @@ mswin_init_text_window()
|
||||
|
||||
ZeroMemory(data, sizeof(NHTextWindow));
|
||||
data->window_text = mswin_init_text_buffer(
|
||||
gp.program_state.gameover ? FALSE : GetNHApp()->bWrapText);
|
||||
svp.program_state.gameover ? FALSE : GetNHApp()->bWrapText);
|
||||
SetWindowLong(ret, GWL_USERDATA, (LONG) data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ mswin_askname(void)
|
||||
{
|
||||
logDebug("mswin_askname()\n");
|
||||
|
||||
if (mswin_getlin_window("who are you?", gp.plname, PL_NSIZ) == IDCANCEL) {
|
||||
if (mswin_getlin_window("who are you?", svp.plname, PL_NSIZ) == IDCANCEL) {
|
||||
bail("bye-bye");
|
||||
/* not reached */
|
||||
}
|
||||
|
||||
@@ -226,8 +226,8 @@ gotlock:
|
||||
if (fd == -1) {
|
||||
error("cannot creat lock file (%s.)", fq_lock);
|
||||
} else {
|
||||
if (write(fd, (char *) &gh.hackpid, sizeof(gh.hackpid))
|
||||
!= sizeof(gh.hackpid)) {
|
||||
if (write(fd, (char *) &svh.hackpid, sizeof(svh.hackpid))
|
||||
!= sizeof(svh.hackpid)) {
|
||||
error("cannot write lock (%s)", fq_lock);
|
||||
}
|
||||
if (close(fd) == -1) {
|
||||
|
||||
@@ -1031,9 +1031,9 @@ NetHackQtPlayerSelector::NetHackQtPlayerSelector(NetHackQtKeyBuffer& ks) :
|
||||
|
||||
QButtonGroup* namebox = new QButtonGroup(1,Horizontal,"Name",this);
|
||||
QLineEdit* name = new QLineEdit(namebox);
|
||||
name->setMaxLength(sizeof(gp.plname)-1);
|
||||
if ( strncmp(gp.plname,"player",6) && strncmp(gp.plname,"games",5) )
|
||||
name->setText(gp.plname);
|
||||
name->setMaxLength(sizeof(svp.plname)-1);
|
||||
if ( strncmp(svp.plname,"player",6) && strncmp(svp.plname,"games",5) )
|
||||
name->setText(svp.plname);
|
||||
connect(name, SIGNAL(textChanged(const QString&)),
|
||||
this, SLOT(selectName(const QString&)) );
|
||||
name->setFocus();
|
||||
@@ -1189,7 +1189,7 @@ NetHackQtPlayerSelector::NetHackQtPlayerSelector(NetHackQtKeyBuffer& ks) :
|
||||
|
||||
void NetHackQtPlayerSelector::selectName(const QString& n)
|
||||
{
|
||||
strncpy(gp.plname,n.latin1(),sizeof(gp.plname)-1);
|
||||
strncpy(svp.plname,n.latin1(),sizeof(svp.plname)-1);
|
||||
}
|
||||
|
||||
void NetHackQtPlayerSelector::selectRole()
|
||||
@@ -2535,7 +2535,7 @@ void NetHackQtStatusWindow::updateStats()
|
||||
encumber.setLabel(enc);
|
||||
encumber.show();
|
||||
}
|
||||
Strcpy(buf, gp.plname);
|
||||
Strcpy(buf, svp.plname);
|
||||
if ('a' <= buf[0] && buf[0] <= 'z') buf[0] += 'A'-'a';
|
||||
Strcat(buf, " the ");
|
||||
if (u.mtimedone) {
|
||||
@@ -2598,7 +2598,7 @@ void NetHackQtStatusWindow::updateStats()
|
||||
align.setLabel("Lawful");
|
||||
}
|
||||
|
||||
if (::flags.time) time.setLabel("Time:",(long)gm.moves);
|
||||
if (::flags.time) time.setLabel("Time:",(long)svm.moves);
|
||||
else time.setLabel("");
|
||||
#ifdef SCORE_ON_BOTL
|
||||
if (::flags.showscore) {
|
||||
@@ -3310,7 +3310,7 @@ static char** rip_line=0;
|
||||
long year;
|
||||
|
||||
/* Put name on stone */
|
||||
Sprintf(rip_line[NAME_LINE], "%s", gp.plname);
|
||||
Sprintf(rip_line[NAME_LINE], "%s", svp.plname);
|
||||
|
||||
/* Put $ on stone */
|
||||
Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money);
|
||||
@@ -4037,7 +4037,7 @@ void NetHackQtMainWindow::keyPressEvent(QKeyEvent* event)
|
||||
|
||||
void NetHackQtMainWindow::closeEvent(QCloseEvent* e)
|
||||
{
|
||||
if ( gp.program_state.something_worth_saving ) {
|
||||
if ( svp.program_state.something_worth_saving ) {
|
||||
switch ( QMessageBox::information( this, "NetHack",
|
||||
"This will end your NetHack session",
|
||||
"&Save", "&Cancel", 0, 1 ) )
|
||||
@@ -4629,7 +4629,7 @@ void NetHackQtBind::qt_askname()
|
||||
NetHackQtSavedGameSelector sgsel((const char**)saved);
|
||||
ch = sgsel.choose();
|
||||
if ( ch >= 0 )
|
||||
strcpy(gp.plname,saved[ch]);
|
||||
strcpy(svp.plname,saved[ch]);
|
||||
}
|
||||
free_saved_games(saved);
|
||||
|
||||
@@ -4849,7 +4849,7 @@ void NetHackQtBind::qt_update_inventory()
|
||||
if (main)
|
||||
main->updateInventory();
|
||||
/* doesn't work yet
|
||||
if (gp.program_state.something_worth_saving && iflags.perm_invent)
|
||||
if (svp.program_state.something_worth_saving && iflags.perm_invent)
|
||||
display_inventory(NULL, FALSE);
|
||||
*/
|
||||
}
|
||||
@@ -4903,14 +4903,14 @@ int NetHackQtBind::qt_nhgetch()
|
||||
//
|
||||
while (keybuffer.Empty()
|
||||
#ifdef SAFERHANGUP
|
||||
&& !gp.program_state.done_hup
|
||||
&& !svp.program_state.done_hup
|
||||
#endif
|
||||
) {
|
||||
qApp->enter_loop();
|
||||
}
|
||||
|
||||
#ifdef SAFERHANGUP
|
||||
if (gp.program_state.done_hup && keybuffer.Empty()) return '\033';
|
||||
if (svp.program_state.done_hup && keybuffer.Empty()) return '\033';
|
||||
#endif
|
||||
return keybuffer.GetAscii();
|
||||
}
|
||||
@@ -4924,13 +4924,13 @@ int NetHackQtBind::qt_nh_poskey(int *x, int *y, int *mod)
|
||||
//
|
||||
while (keybuffer.Empty() && clickbuffer.Empty()
|
||||
#ifdef SAFERHANGUP
|
||||
&& !gp.program_state.done_hup
|
||||
&& !svp.program_state.done_hup
|
||||
#endif
|
||||
) {
|
||||
qApp->enter_loop();
|
||||
}
|
||||
#ifdef SAFERHANGUP
|
||||
if (gp.program_state.done_hup && keybuffer.Empty()) return '\033';
|
||||
if (svp.program_state.done_hup && keybuffer.Empty()) return '\033';
|
||||
#endif
|
||||
if (!keybuffer.Empty()) {
|
||||
return keybuffer.GetAscii();
|
||||
@@ -5179,7 +5179,7 @@ bool NetHackQtBind::notify(QObject *receiver, QEvent *event)
|
||||
|
||||
bool result=QApplication::notify(receiver,event);
|
||||
#ifdef SAFERHANGUP
|
||||
if (gp.program_state.done_hup) {
|
||||
if (svp.program_state.done_hup) {
|
||||
keybuffer.Put('\033');
|
||||
qApp->exit_loop();
|
||||
return TRUE;
|
||||
|
||||
@@ -501,7 +501,7 @@ Gem_player_selection()
|
||||
void
|
||||
Gem_askname()
|
||||
{
|
||||
strncpy(gp.plname, mar_ask_name(), PL_NSIZ);
|
||||
strncpy(svp.plname, mar_ask_name(), PL_NSIZ);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1074,7 +1074,7 @@ time_t when;
|
||||
}
|
||||
/* Follows same algorithm as genl_outrip() */
|
||||
/* Put name on stone */
|
||||
Sprintf(rip_line[NAME_LINE], "%s", gp.plname);
|
||||
Sprintf(rip_line[NAME_LINE], "%s", svp.plname);
|
||||
/* Put $ on stone */
|
||||
Sprintf(rip_line[GOLD_LINE], "%ld Au", done_money);
|
||||
/* Put together death description */
|
||||
|
||||
@@ -354,7 +354,7 @@ gnome_askname()
|
||||
|
||||
/* Ask for a name and stuff the response into plname, a nethack global */
|
||||
ret = ghack_ask_string_dialog("What is your name?", "gandalf",
|
||||
"GnomeHack", gp.plname);
|
||||
"GnomeHack", svp.plname);
|
||||
|
||||
/* Quit if they want to quit... */
|
||||
if (ret == -1) {
|
||||
@@ -907,7 +907,7 @@ gnome_nhgetch()
|
||||
g_askingQuestion = 1;
|
||||
/* Process events until a key press event arrives. */
|
||||
while (g_numKeys == 0) {
|
||||
if (gp.program_state.done_hup)
|
||||
if (svp.program_state.done_hup)
|
||||
return '\033';
|
||||
gtk_main_iteration();
|
||||
}
|
||||
@@ -945,7 +945,7 @@ gnome_nh_poskey(int *x, int *y, int *mod)
|
||||
g_askingQuestion = 0;
|
||||
/* Process events until a key or map-click arrives. */
|
||||
while (g_numKeys == 0 && g_numClicks == 0) {
|
||||
if (gp.program_state.done_hup)
|
||||
if (svp.program_state.done_hup)
|
||||
return '\033';
|
||||
gtk_main_iteration();
|
||||
}
|
||||
@@ -1169,7 +1169,7 @@ gnome_outrip(winid wid, int how, time_t when)
|
||||
long year;
|
||||
|
||||
/* Put name on stone */
|
||||
Sprintf(buf, "%s\n", gp.plname);
|
||||
Sprintf(buf, "%s\n", svp.plname);
|
||||
Strcat(ripString, buf);
|
||||
|
||||
/* Put $ on stone */
|
||||
|
||||
@@ -440,7 +440,7 @@ ghack_status_window_update_stats()
|
||||
long umoney;
|
||||
|
||||
/* First, fill in the player name and the dungeon level */
|
||||
strcpy(buf, gp.plname);
|
||||
strcpy(buf, svp.plname);
|
||||
if ('a' <= buf[0] && buf[0] <= 'z')
|
||||
buf[0] += 'A' - 'a';
|
||||
strcat(buf, " the ");
|
||||
@@ -662,7 +662,7 @@ ghack_status_window_update_stats()
|
||||
}
|
||||
|
||||
if (flags.time) {
|
||||
sprintf(buf, "Time:%ld", gm.moves);
|
||||
sprintf(buf, "Time:%ld", svm.moves);
|
||||
gtk_label_set(GTK_LABEL(timeLabel), buf);
|
||||
} else
|
||||
gtk_label_set(GTK_LABEL(timeLabel), "");
|
||||
|
||||
Reference in New Issue
Block a user