diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 471268dd9..207ce1d5e 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -962,7 +962,7 @@ void movedummyplayers(void) p = sprite[OW].yvel; - if (g_player[p].ps->on_crane >= 0 || sector[g_player[p].ps->cursectnum].lotag != 1 || sprite[g_player[p].ps->i].extra <= 0) + if (g_player[p].ps->on_crane >= 0 || (g_player[p].ps->cursectnum > -1 && sector[g_player[p].ps->cursectnum].lotag != 1) || sprite[g_player[p].ps->i].extra <= 0) { g_player[p].ps->dummyplayersprite = -1; KILLIT(i); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 886ad6f37..1892c2c7d 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -3174,8 +3174,8 @@ static void drawoverheadmap(int cposx, int cposy, int czoom, short cang) if (j < 22000) j = 22000; else if (j > (65536<<1)) j = (65536<<1); - rotatesprite((x1<<4)+(xdim<<15),(y1<<4)+(ydim<<15),j, - daang,i,sprite[g_player[p].ps->i].shade,/*sprite[g_player[p].ps->i].pal*/sector[g_player[p].ps->cursectnum].floorpal, + rotatesprite((x1<<4)+(xdim<<15),(y1<<4)+(ydim<<15),j,daang,i,sprite[g_player[p].ps->i].shade, + (g_player[p].ps->cursectnum > -1)?sector[g_player[p].ps->cursectnum].floorpal:0, (sprite[g_player[p].ps->i].cstat&2)>>1,windowx1,windowy1,windowx2,windowy2); } } @@ -3412,11 +3412,14 @@ void displayrest(int smoothratio) SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); OnEvent(EVENT_DISPLAYSBAR, g_player[screenpeek].ps->i, screenpeek, -1); + i = usehightile; + if (r_downsize > 1) + usehightile = 0; if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) coolgaugetext(screenpeek); operatefta(); - + usehightile = i; if (KB_KeyPressed(sc_Escape) && ud.overhead_on == 0 && ud.show_help == 0 && g_player[myconnectindex].ps->newowner == -1) @@ -4265,8 +4268,13 @@ int EGS(int whatsect,int s_x,int s_y,int s_z,int s_pn,int s_s,int s_xr,int s_yr, s->clipdist = 0; s->pal = 0; s->lotag = 0; - - hittype[i].picnum = sprite[s_ow].picnum; + + if (s_ow > -1 && s_ow < MAXSPRITES) + { + hittype[i].picnum = sprite[s_ow].picnum; + hittype[i].floorz = hittype[s_ow].floorz; + hittype[i].ceilingz = hittype[s_ow].ceilingz; + } hittype[i].lastvx = 0; hittype[i].lastvy = 0; @@ -4279,8 +4287,6 @@ int EGS(int whatsect,int s_x,int s_y,int s_z,int s_pn,int s_s,int s_xr,int s_yr, hittype[i].movflag = 0; hittype[i].tempang = 0; hittype[i].dispicnum = 0; - hittype[i].floorz = hittype[s_ow].floorz; - hittype[i].ceilingz = hittype[s_ow].ceilingz; T1=T3=T4=T6=T7=T8=T9=0; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 17dc756e5..83e36c443 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -2513,12 +2513,13 @@ cheat_for_port_credits: { i = r_downsize; enabled = usehightile; - _bar(1,d+8,yy+7, &r_downsize,-1,enabled && x==io,MENUHIGHLIGHT(io),!enabled,0,5); + _bar(1,d+8,yy+7, &r_downsize,-1,enabled && x==io,MENUHIGHLIGHT(io),!enabled,0,2); if (r_downsize != i) { resetvideomode(); if (setgamemode(fullscreen,xdim,ydim,bpp)) OSD_Printf("restartvid: Reset failed...\n"); + return; } break; } diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 95bb7352a..79cd3ee25 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -1743,6 +1743,7 @@ SKIPBULLETHOLE: k = 0; // RESHOOTGROW: + if (sect < 0) break; s->cstat &= ~257; if (hittype[i].temp_data[9]) zvel = hittype[i].temp_data[9]; @@ -2113,7 +2114,7 @@ void displayweapon(int snum) { int gun_pos, looking_arc, cw; int weapon_xoffset, i, j; - int o = 0,pal; + int o = 0,pal = 0; player_struct *p = g_player[snum].ps; short *kb = &p->kickback_pic; int gs; @@ -3970,7 +3971,7 @@ void processinput(int snum) else { if (p->footprintcount > 0 && p->on_ground) - if ((sector[p->cursectnum].floorstat&2) != 2) + if (p->cursectnum > -1 && (sector[p->cursectnum].floorstat&2) != 2) { for (j=headspritesect[psect];j>=0;j=nextspritesect[j]) if (sprite[j].picnum == FOOTPRINTS || sprite[j].picnum == FOOTPRINTS2 || sprite[j].picnum == FOOTPRINTS3 || sprite[j].picnum == FOOTPRINTS4) @@ -3980,7 +3981,7 @@ void processinput(int snum) if (j < 0) { p->footprintcount--; - if (sector[p->cursectnum].lotag == 0 && sector[p->cursectnum].hitag == 0) + if (p->cursectnum > -1 && sector[p->cursectnum].lotag == 0 && sector[p->cursectnum].hitag == 0) { switch (TRAND&3) { diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index ac8efce1c..a15c4daa9 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -3044,16 +3044,19 @@ CHECKINV1: { p->inven_icon = 3; - p->holoduke_on = i = - EGS(p->cursectnum, - p->posx, - p->posy, - p->posz+(30<<8),APLAYER,-64,0,0,p->ang,0,0,-1,10); - T4 = T5 = 0; - SP = snum; - sprite[i].extra = 0; - FTA(47,p); - spritesound(TELEPORTER,p->holoduke_on); + if (p->cursectnum > -1) + { + p->holoduke_on = i = + EGS(p->cursectnum, + p->posx, + p->posy, + p->posz+(30<<8),APLAYER,-64,0,0,p->ang,0,0,-1,10); + T4 = T5 = 0; + SP = snum; + sprite[i].extra = 0; + FTA(47,p); + spritesound(TELEPORTER,p->holoduke_on); + } } else FTA(49,p); } diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index d4b6f820a..fbb8063d6 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -338,7 +338,7 @@ int xyzsound(int num,int i,int x,int y,int z) sndist += g_sounds[num].vo; if (sndist < 0) sndist = 0; - if (sndist && PN != MUSICANDSFX && !cansee(cx,cy,cz-(24<<8),cs,SX,SY,SZ-(24<<8),SECT)) + if (cs > -1 && sndist && PN != MUSICANDSFX && !cansee(cx,cy,cz-(24<<8),cs,SX,SY,SZ-(24<<8),SECT)) sndist += sndist>>5; switch (num) @@ -348,11 +348,11 @@ int xyzsound(int num,int i,int x,int y,int z) case RPG_EXPLODE: if (sndist > (6144)) sndist = 6144; - if (sector[g_player[screenpeek].ps->cursectnum].lotag == 2) + if (g_player[screenpeek].ps->cursectnum > -1 && sector[g_player[screenpeek].ps->cursectnum].lotag == 2) pitch -= 1024; break; default: - if (sector[g_player[screenpeek].ps->cursectnum].lotag == 2 && (g_sounds[num].m&4) == 0) + if (g_player[screenpeek].ps->cursectnum > -1 && sector[g_player[screenpeek].ps->cursectnum].lotag == 2 && (g_sounds[num].m&4) == 0) pitch = -768; if (sndist > 31444 && PN != MUSICANDSFX) return -1; @@ -605,7 +605,7 @@ void pan3dsound(void) sndist += g_sounds[j].vo; if (sndist < 0) sndist = 0; - if (sndist && PN != MUSICANDSFX && !cansee(cx,cy,cz-(24<<8),cs,sx,sy,sz-(24<<8),SECT)) + if (cs > -1 && sndist && PN != MUSICANDSFX && !cansee(cx,cy,cz-(24<<8),cs,sx,sy,sz-(24<<8),SECT)) sndist += sndist>>5; if (PN == MUSICANDSFX && SLT < 999)