From e2fe946d3585863efa848c819898d53e5bedaf27 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 28 Apr 2007 21:24:36 +0000 Subject: [PATCH] Crash fix git-svn-id: https://svn.eduke32.com/eduke32@542 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/astub.c | 4 ++-- polymer/eduke32/source/game.c | 7 +++++++ polymer/eduke32/source/gameexec.c | 29 ++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index cecdc5c79..118534120 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -2358,7 +2358,7 @@ static long DrawTiles(long iTopLeft, long iSelected, long nXTiles, long nYTiles, DivInc++; } - if (1 == DivInc) + if (DivInc == 1 && s_TileZoom) { while (((TileSizeX*(MulInc+1)) <= TileDim) && ((TileSizeY*(MulInc+1)) <= TileDim)) @@ -5148,7 +5148,7 @@ int ExtPreInit(int argc,char **argv) OSD_SetLogFile("mapster32.log"); OSD_SetVersionString("Mapster32"VERSION,0,2); initprintf("Mapster32"VERSION" ("__DATE__" "__TIME__")\n"); - initprintf("Copyright (c) 2007 EDuke32 team\n\n"); + initprintf("Copyright (c) 2007 EDuke32 team\n"); checkcommandline(argc,argv); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 531c750f8..c762a5e05 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8663,6 +8663,13 @@ static void checkcommandline(int argc,char **argv) i++; continue; } + if (!Bstrcasecmp(c+1,"nosetup")) + { + NoSetup = 1; + CommandSetup = 0; + i++; + continue; + } if (!Bstrcasecmp(c+1,"keepaddr")) { keepaddr = 1; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 05952caac..427d34424 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -41,7 +41,12 @@ static void DoUserDef(int iSet, int lLabelID, int lVar2) { long lValue; - if (g_p != myconnectindex) return; + if (g_p != myconnectindex) + { + if (lVar2 == MAXGAMEVARS) + insptr++; + return; + } lValue=GetGameVarID(lVar2, g_i, g_p); @@ -709,6 +714,8 @@ static void DoThisProjectile(int iSet, int lVar1, int lLabelID, int lVar2) if (proj < 0 || proj >= MAXSPRITES) { OSD_Printf("DoThisProjectile(): invalid projectile (%d)\n",proj); + if (lVar2 == MAXGAMEVARS) + insptr++; return; } @@ -928,7 +935,11 @@ static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) iPlayer=GetGameVarID(lVar1, g_i, g_p); if (iPlayer<0 || iPlayer >= MAXPLAYERS) + { + if (lVar2 == MAXGAMEVARS) + insptr++; return; + } lValue=GetGameVarID(lVar2, g_i, g_p); @@ -1958,7 +1969,11 @@ static void DoInput(int iSet, int lVar1, int lLabelID, int lVar2) iPlayer=GetGameVarID(lVar1, g_i, g_p); if (iPlayer<0 || iPlayer >= MAXPLAYERS) + { + if (lVar2 == MAXGAMEVARS) + insptr++; return; + } lValue=GetGameVarID(lVar2, g_i, g_p); @@ -2017,7 +2032,11 @@ static void DoWall(int iSet, int lVar1, int lLabelID, int lVar2) int iWall = GetGameVarID(lVar1, g_i, g_p); if (iWall<0 || iWall >= MAXWALLS) + { + if (lVar2 == MAXGAMEVARS) + insptr++; return; + } lValue=GetGameVarID(lVar2, g_i, g_p); @@ -2156,7 +2175,11 @@ static void DoSector(int iSet, int lVar1, int lLabelID, int lVar2) iSector=GetGameVarID(lVar1, g_i, g_p); if (iSector<0 || iSector >= MAXSECTORS) + { + if (lVar2 == MAXGAMEVARS) + insptr++; return; + } lValue=GetGameVarID(lVar2, g_i, g_p); @@ -2334,6 +2357,8 @@ static void DoActor(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) if (iActor < 0 || iActor >= MAXSPRITES) { OSD_Printf("DoActor(): invalid target sprite (%d) %d %d\n",iActor,g_i,g_sp->picnum); + if (lVar2 == MAXGAMEVARS) + insptr++; return; } @@ -2684,6 +2709,8 @@ static void DoProjectile(int iSet, int lVar1, int lLabelID, int lVar2) if (lVar1 < 0 || lVar1 >= MAXTILES) { OSD_Printf("DoProjectile(): invalid tile (%d)\n",lVar1); + if (lVar2 == MAXGAMEVARS) + insptr++; return; }