From 665a322312ba4c67f4075f3dd4494302149fca8c Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 30 Jul 2006 01:48:52 +0000 Subject: [PATCH] Mapster32 crash fix and a couple of small projectile system changes git-svn-id: https://svn.eduke32.com/eduke32@252 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 9 ++++----- polymer/eduke32/source/astub.c | 15 +++++++++++++-- polymer/eduke32/source/gamedef.c | 3 ++- polymer/eduke32/source/player.c | 5 ++++- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 407763863..836a8fc94 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -2391,11 +2391,10 @@ void moveweapons(void) j = spawn(i,thisprojectile[i].trail); if (thisprojectile[i].toffset != 0) sprite[j].z += (thisprojectile[i].toffset<<8); - else - sprite[j].z += (1<<8); - if (thisprojectile[i].txrepeat >= 0) sprite[j].xrepeat=thisprojectile[i].txrepeat; - if (thisprojectile[i].tyrepeat >= 0) sprite[j].yrepeat=thisprojectile[i].tyrepeat; - + if (thisprojectile[i].txrepeat >= 0) + sprite[j].xrepeat=thisprojectile[i].txrepeat; + if (thisprojectile[i].tyrepeat >= 0) + sprite[j].yrepeat=thisprojectile[i].tyrepeat; } } diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 0b646b2f6..313fbd47f 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -2824,8 +2824,19 @@ void Keys3d(void) Bsprintf(tempbuf,"LOCK"); if(tempbuf[0] != 0) { - printext256(searchx+4+2,searchy+4+2,0,-1,tempbuf,!(xdimgame > 640)); - printext256(searchx+4,searchy+4,whitecol,-1,tempbuf,!(xdimgame > 640)); + i = (Bstrlen(tempbuf)<<3)+6; + if((searchx+i) < (xdim-1)) + i = 0; + else i = (searchx+i)-(xdim-1); + if((searchy+16) < (ydim-1)) + j = 0; + else j = (searchy+16)-(ydim-1); +// printext16(searchx+6-i,searchy+6-j,11,-1,tempbuf,0); + printext256(searchx+4+2-i,searchy+4+2-j,0,-1,tempbuf,!(xdimgame > 640)); + printext256(searchx+4-i,searchy+4-j,whitecol,-1,tempbuf,!(xdimgame > 640)); + +// printext256(searchx+4+2,searchy+4+2,0,-1,tempbuf,!(xdimgame > 640)); +// printext256(searchx+4,searchy+4,whitecol,-1,tempbuf,!(xdimgame > 640)); } if(helpon==1) { diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 7e4a160cf..ce217b347 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -5581,7 +5581,8 @@ void InitProjectiles(void) projectile[i].extra = 100; projectile[i].decal = BULLETHOLE; projectile[i].trail = -1; - projectile[i].tnum = projectile[i].toffset = 0; + projectile[i].tnum = 0; + projectile[i].toffset = 1; projectile[i].txrepeat = projectile[i].tyrepeat = -1; projectile[i].drop = projectile[i].range = 0; projectile[i].cstat = -1; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 73d3e923f..ee7ba80ce 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -160,7 +160,10 @@ void hitscantrail(long x1, long y1, long z1, long x2, long y2, long z2, short an n = ((FindDistance2D(x1-x2,y1-y2))>>8)+1; - z1 += (projectile[atwith].toffset<<8)+1024; + if(projectile[atwith].toffset != 0) + z1 += (projectile[atwith].toffset<<8); + + z1 += 1024; xv = (x2-x1)/n; yv = (y2-y1)/n;