From c634a708aace7f0053f921c6f52b2f0847f9883d Mon Sep 17 00:00:00 2001 From: hnt_ts Date: Wed, 4 Jun 2008 13:36:37 +0000 Subject: [PATCH] 1. Fixed this crash (http://forums.3drealms.com/vb/showpost.php?p=706802&postcount=533) 2. Optimized the setactorvar,setplayervar,getactorvar,getplayervar commands. They may be compiled as the setvarvar command. git-svn-id: https://svn.eduke32.com/eduke32@761 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/engine.c | 8 +++++++- polymer/eduke32/source/gamedef.c | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/polymer/build/src/engine.c b/polymer/build/src/engine.c index 113e132f7..e611f5ffb 100644 --- a/polymer/build/src/engine.c +++ b/polymer/build/src/engine.c @@ -6845,7 +6845,7 @@ int loadboard(char *filename, char fromwhere, int *daposx, int *daposy, int *dap if (sprite[i].sectnum<0||sprite[i].sectnum>=MYMAXSECTORS) { - initprintf("Map error: sprite #%d(%d,%d) with wrong sector(%d)\n",i,sprite[i].x,sprite[i].y,sprite[i].sectnum); + initprintf("Map error: sprite #%d(%d,%d) with an illegal sector(%d)\n",i,sprite[i].x,sprite[i].y,sprite[i].sectnum); sprite[i].sectnum=MYMAXSECTORS-1; } } @@ -7594,6 +7594,12 @@ int saveboard(char *filename, int *daposx, int *daposy, int *daposz, if ((fil = Bopen(filename,BO_BINARY|BO_TRUNC|BO_CREAT|BO_WRONLY,BS_IREAD|BS_IWRITE)) == -1) return(-1); + for (j=0;jMAXSTATUS) + { + initprintf("Map error: sprite #%d(%d,%d) with an illegal statnum(%d)\n",j,sprite[j].x,sprite[j].y,sprite[j].statnum); + changespritestat(j,0); + } + numsprites = 0; for (j=0;j