diff --git a/polymer/build/include/editor.h b/polymer/build/include/editor.h index 9e3fe8218..ec34367ec 100644 --- a/polymer/build/include/editor.h +++ b/polymer/build/include/editor.h @@ -48,6 +48,7 @@ extern int ydim16, xdimgame, ydimgame, bppgame, xdim2d, ydim2d, forcesetup; extern char unrealedlook, quickmapcycling; extern int pk_turnaccel,pk_turndecel,pk_uedaccel; extern int revertCTRL,scrollamount; +extern unsigned char autosave; extern int ExtInit(void); diff --git a/polymer/build/src/config.c b/polymer/build/src/config.c index 73a0324b7..ef904c585 100644 --- a/polymer/build/src/config.c +++ b/polymer/build/src/config.c @@ -213,6 +213,8 @@ int loadsetup(const char *fn) if (readconfig(fp, "turndecel", val, VL) > 0) pk_turndecel = Batoi(val); + if (readconfig(fp, "autosave", val, VL) > 0) autosave = Batoi(val); + for (i=0;i<256;i++)remap[i]=i; remapinit=1; if (readconfig(fp, "remap", val, VL) > 0) @@ -340,6 +342,9 @@ int writesetup(const char *fn) "; Turning deceleration\n" "turndecel = %d\n" "\n" + "; Autosave map interval (minutes)\n" + "autosave = %d\n" + "\n" #if 1 "; Key Settings\n" "; Here's a map of all the keyboard scan codes: NOTE: values are listed in hex!\n" @@ -400,7 +405,7 @@ int writesetup(const char *fn) option[7]>>4, option[2], #endif option[3], msens, unrealedlook, pk_uedaccel, quickmapcycling, - revertCTRL,scrollamount,pk_turnaccel,pk_turndecel, + revertCTRL,scrollamount,pk_turnaccel,pk_turndecel,autosave, #if 1 keys[0], keys[1], keys[2], keys[3], keys[4], keys[5], keys[6], keys[7], keys[8], keys[9], keys[10], keys[11], diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index acace328a..a52cbdacf 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -2403,7 +2403,7 @@ static void moveweapons(void) if (j)break; } - if (!(hittype[i].projectile.workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS) && s->yvel >= 0) + if (!(hittype[i].projectile.workslike & PROJECTILE_FLAG_BOUNCESOFFWALLS) && s->yvel >= 0 && sprite[s->yvel].sectnum < MAXSECTORS) if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256) j = 49152|s->yvel; @@ -2861,7 +2861,7 @@ static void moveweapons(void) j = movesprite(i,(k*(sintable[(s->ang+512)&2047]))>>14,(k*(sintable[s->ang&2047]))>>14,ll,qq); - if (s->picnum == RPG && s->yvel >= 0) + if (s->picnum == RPG && s->yvel >= 0 && sprite[s->yvel].sectnum < MAXSECTORS) if (FindDistance2D(s->x-sprite[s->yvel].x,s->y-sprite[s->yvel].y) < 256) j = 49152|s->yvel; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 9f2229794..08f14da35 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -48,8 +48,8 @@ static char defaultduke3dgrp[BMAX_PATH] = "duke3d.grp"; static char *duke3dgrp = defaultduke3dgrp; static int fixmapbeforesaving = 1; static int lastsave = -180*60; -static int spnoclip=0; static int NoAutoLoad = 0; +int spnoclip=1; #if !defined(_WIN32) static int usecwd = 0; @@ -7291,7 +7291,7 @@ int ExtInit(void) getmessagetimeoff = 0; Bstrcpy(apptitle, "Mapster32"VERSION""); - autosavetimer = totalclock+120*180; + autosavetimer = totalclock+120*autosave*3; #if defined(_WIN32) && defined(DUKEOSD) OSD_SetFunctions( @@ -7520,7 +7520,7 @@ static void Keys2d3d(void) if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_A]) // ' a { keystatus[KEYSC_A] = 0; - autosave=!autosave; + autosave=autosave?0:3; if (autosave) message("Autosave ON"); else message("Autosave OFF"); } @@ -7552,7 +7552,7 @@ static void Keys2d3d(void) ExtSaveMap("autosave.map"); message("Board autosaved to AUTOSAVE.MAP"); } - autosavetimer = totalclock+120*180; + autosavetimer = totalclock+120*autosave*3; } if (eitherCTRL) //CTRL diff --git a/polymer/eduke32/source/mapster32.h b/polymer/eduke32/source/mapster32.h index bb06707dc..b2cddbbd9 100644 --- a/polymer/eduke32/source/mapster32.h +++ b/polymer/eduke32/source/mapster32.h @@ -93,7 +93,7 @@ short cursprite; int mousxplc, mousyplc, ppointhighlight; int counter=0; unsigned char nosprites=0,purpleon=0,skill=4; -unsigned char framerateon=1,shadepreview=0,autosave=1,sidemode=0; +unsigned char framerateon=1,shadepreview=0,autosave=3,sidemode=0; extern int vel, svel, hvel, angvel; int xvel, yvel, timoff;