From 4dca439d8f9ec71e0dfdfe2579cb12d57200eb93 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 10 Aug 2012 19:12:01 +0000 Subject: [PATCH] Text-repl.: hitinfo variables -> hit, hit{sprite,sect,wall} members -> no "hit" This makes the code rather more readable in some places. Unlike the two preceding commits, this one is actually purely textual replacement. git-svn-id: https://svn.eduke32.com/eduke32@2877 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 2 +- polymer/eduke32/build/src/build.c | 34 +- polymer/eduke32/build/src/engine.c | 84 ++-- polymer/eduke32/build/src/polymost.c | 44 +- polymer/eduke32/source/game.c | 32 +- polymer/eduke32/source/gameexec.c | 42 +- polymer/eduke32/source/m32exec.c | 16 +- polymer/eduke32/source/player.c | 668 +++++++++++++------------- polymer/eduke32/source/sector.c | 20 +- 9 files changed, 471 insertions(+), 471 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 5ee52b609..6b1249ce1 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -559,7 +559,7 @@ typedef struct { typedef struct { vec3_t pos; - int16_t hitsprite, hitwall, hitsect; + int16_t sprite, wall, sect; } hitdata_t; #pragma pack(pop) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 426c41efc..76242fbf3 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -1252,7 +1252,7 @@ void editinput(void) if (keystatus[0x1f]) //S (insert sprite) (3D) { - hitdata_t hitinfo; + hitdata_t hit; dax = 16384; day = divscale14(searchx-(xdim>>1), xdim>>1); @@ -1260,21 +1260,21 @@ void editinput(void) hitscan((const vec3_t *)&pos,cursectnum, //Start position dax,day,(scale(searchy,200,ydim)-horiz)*2000, //vector of 3D ang - &hitinfo,CLIPMASK1); + &hit,CLIPMASK1); - if (hitinfo.hitsect >= 0) + if (hit.sect >= 0) { - dax = hitinfo.pos.x; - day = hitinfo.pos.y; + dax = hit.pos.x; + day = hit.pos.y; if (gridlock && grid > 0) { if (AIMING_AT_WALL || AIMING_AT_MASKWALL) - hitinfo.pos.z &= 0xfffffc00; + hit.pos.z &= 0xfffffc00; else locktogrid(&dax, &day); } - i = insert_sprite_common(hitinfo.hitsect, dax, day); + i = insert_sprite_common(hit.sect, dax, day); if (i < 0) message("Couldn't insert sprite."); @@ -1284,17 +1284,17 @@ void editinput(void) handle_sprite_in_clipboard(i); - getzsofslope(hitinfo.hitsect, hitinfo.pos.x, hitinfo.pos.y, &cz, &fz); + getzsofslope(hit.sect, hit.pos.x, hit.pos.y, &cz, &fz); spriteoncfz(i, &cz, &fz); - sprite[i].z = clamp(hitinfo.pos.z, cz, fz); + sprite[i].z = clamp(hit.pos.z, cz, fz); if (AIMING_AT_WALL || AIMING_AT_MASKWALL) { sprite[i].cstat &= ~48; sprite[i].cstat |= (16+64); - correct_ornamented_sprite(i, hitinfo.hitwall); + correct_ornamented_sprite(i, hit.wall); } else sprite[i].cstat |= (tilesizy[sprite[i].picnum]>=32); @@ -1999,20 +1999,20 @@ static void correct_ornamented_sprite(int32_t i, int32_t hitw) void DoSpriteOrnament(int32_t i) { - hitdata_t hitinfo; + hitdata_t hit; hitscan((const vec3_t *)&sprite[i],sprite[i].sectnum, sintable[(sprite[i].ang+1536)&2047], sintable[(sprite[i].ang+1024)&2047], 0, - &hitinfo,CLIPMASK1); + &hit,CLIPMASK1); - sprite[i].x = hitinfo.pos.x; - sprite[i].y = hitinfo.pos.y; - sprite[i].z = hitinfo.pos.z; - changespritesect(i, hitinfo.hitsect); + sprite[i].x = hit.pos.x; + sprite[i].y = hit.pos.y; + sprite[i].z = hit.pos.z; + changespritesect(i, hit.sect); - correct_ornamented_sprite(i, hitinfo.hitwall); + correct_ornamented_sprite(i, hit.wall); } void update_highlight(void) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index c3650ed20..772346452 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -11206,7 +11206,7 @@ static int32_t hitscan_hitsectcf=-1; // stat, heinum, z: either ceiling- or floor- // how: -1: behave like ceiling, 1: behave like floor -static int32_t hitscan_trysector(const vec3_t *sv, const sectortype *sec, hitdata_t *hitinfo, +static int32_t hitscan_trysector(const vec3_t *sv, const sectortype *sec, hitdata_t *hit, int32_t vx, int32_t vy, int32_t vz, int16_t stat, int16_t heinum, int32_t z, int32_t how, const intptr_t *tmp) { @@ -11246,14 +11246,14 @@ static int32_t hitscan_trysector(const vec3_t *sv, const sectortype *sec, hitdat } } - if ((x1 != INT32_MAX) && (klabs(x1-sv->x)+klabs(y1-sv->y) < klabs((hitinfo->pos.x)-sv->x)+klabs((hitinfo->pos.y)-sv->y))) + if ((x1 != INT32_MAX) && (klabs(x1-sv->x)+klabs(y1-sv->y) < klabs((hit->pos.x)-sv->x)+klabs((hit->pos.y)-sv->y))) { if (tmp==NULL) { if (inside(x1,y1,sec-sector) != 0) { - hitinfo->hitsect = sec-sector; hitinfo->hitwall = -1; hitinfo->hitsprite = -1; - hitinfo->pos.x = x1; hitinfo->pos.y = y1; hitinfo->pos.z = z1; + hit->sect = sec-sector; hit->wall = -1; hit->sprite = -1; + hit->pos.x = x1; hit->pos.y = y1; hit->pos.z = z1; hitscan_hitsectcf = (how+1)>>1; } } @@ -11267,8 +11267,8 @@ static int32_t hitscan_trysector(const vec3_t *sv, const sectortype *sec, hitdat { if (inside(x1,y1,sec-sector) != 0) { - hitinfo->hitsect = curspr->sectnum; hitinfo->hitwall = -1; hitinfo->hitsprite = curspr-sprite; - hitinfo->pos.x = x1; hitinfo->pos.y = y1; hitinfo->pos.z = z1; + hit->sect = curspr->sectnum; hit->wall = -1; hit->sprite = curspr-sprite; + hit->pos.x = x1; hit->pos.y = y1; hit->pos.z = z1; } } #ifdef HAVE_CLIPSHAPE_FEATURE @@ -11278,8 +11278,8 @@ static int32_t hitscan_trysector(const vec3_t *sv, const sectortype *sec, hitdat { if (inside(x1,y1,sectq[i]) != 0) { - hitinfo->hitsect = curspr->sectnum; hitinfo->hitwall = -1; hitinfo->hitsprite = curspr-sprite; - hitinfo->pos.x = x1; hitinfo->pos.y = y1; hitinfo->pos.z = z1; + hit->sect = curspr->sectnum; hit->wall = -1; hit->sprite = curspr-sprite; + hit->pos.x = x1; hit->pos.y = y1; hit->pos.z = z1; break; } } @@ -11298,7 +11298,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, const sectortype *sec, hitdat static int32_t clipsprite_initindex(int32_t curidx, spritetype *curspr, int32_t *clipsectcnt, const vec3_t *vect); int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int32_t vz, - hitdata_t *hitinfo, uint32_t cliptype) + hitdata_t *hit, uint32_t cliptype) { sectortype *sec; walltype *wal, *wal2; @@ -11320,7 +11320,7 @@ int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int32 vec3_t newsv; int32_t oldhitsect = -1, oldhitsect2 = -2; #endif - hitinfo->hitsect = -1; hitinfo->hitwall = -1; hitinfo->hitsprite = -1; + hit->sect = -1; hit->wall = -1; hit->sprite = -1; if (sectnum < 0) return(-1); dawalclipmask = (cliptype&65535); @@ -11328,7 +11328,7 @@ int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int32 #ifdef YAX_ENABLE restart_grand: #endif - hitinfo->pos.x = hitscangoalx; hitinfo->pos.y = hitscangoaly; + hit->pos.x = hitscangoalx; hit->pos.y = hitscangoaly; clipsectorlist[0] = sectnum; tempshortcnt = 0; tempshortnum = 1; @@ -11381,9 +11381,9 @@ restart_grand: else tmp[2] = 0; } #endif - if (hitscan_trysector(sv, sec, hitinfo, vx,vy,vz, sec->ceilingstat, sec->ceilingheinum, sec->ceilingz, -i, tmpptr)) + if (hitscan_trysector(sv, sec, hit, vx,vy,vz, sec->ceilingstat, sec->ceilingheinum, sec->ceilingz, -i, tmpptr)) continue; - if (hitscan_trysector(sv, sec, hitinfo, vx,vy,vz, sec->floorstat, sec->floorheinum, sec->floorz, i, tmpptr)) + if (hitscan_trysector(sv, sec, hit, vx,vy,vz, sec->floorstat, sec->floorheinum, sec->floorz, i, tmpptr)) continue; startwall = sec->wallptr; endwall = startwall + sec->wallnum; @@ -11397,7 +11397,7 @@ restart_grand: if ((int64_t)(x1-sv->x)*(y2-sv->y) < (int64_t)(x2-sv->x)*(y1-sv->y)) continue; if (rintersect(sv->x,sv->y,sv->z, vx,vy,vz, x1,y1, x2,y2, &intx,&inty,&intz) == 0) continue; - if (klabs(intx-sv->x)+klabs(inty-sv->y) >= klabs((hitinfo->pos.x)-sv->x)+klabs((hitinfo->pos.y)-sv->y)) + if (klabs(intx-sv->x)+klabs(inty-sv->y) >= klabs((hit->pos.x)-sv->x)+klabs((hit->pos.y)-sv->y)) continue; nextsector = wal->nextsector; @@ -11405,15 +11405,15 @@ restart_grand: { if ((nextsector < 0) || (wal->cstat&dawalclipmask)) { - hitinfo->hitsect = dasector; hitinfo->hitwall = z; hitinfo->hitsprite = -1; - hitinfo->pos.x = intx; hitinfo->pos.y = inty; hitinfo->pos.z = intz; + hit->sect = dasector; hit->wall = z; hit->sprite = -1; + hit->pos.x = intx; hit->pos.y = inty; hit->pos.z = intz; continue; } getzsofslope(nextsector,intx,inty,&daz,&daz2); if ((intz <= daz) || (intz >= daz2)) { - hitinfo->hitsect = dasector; hitinfo->hitwall = z; hitinfo->hitsprite = -1; - hitinfo->pos.x = intx; hitinfo->pos.y = inty; hitinfo->pos.z = intz; + hit->sect = dasector; hit->wall = z; hit->sprite = -1; + hit->pos.x = intx; hit->pos.y = inty; hit->pos.z = intz; continue; } } @@ -11424,8 +11424,8 @@ restart_grand: if (wal->cstat&dawalclipmask) { - hitinfo->hitsect = curspr->sectnum; hitinfo->hitwall = -1; hitinfo->hitsprite = curspr-sprite; - hitinfo->pos.x = intx; hitinfo->pos.y = inty; hitinfo->pos.z = intz; + hit->sect = curspr->sectnum; hit->wall = -1; hit->sprite = curspr-sprite; + hit->pos.x = intx; hit->pos.y = inty; hit->pos.z = intz; continue; } getzsofslope(nextsector,intx,inty,&daz,&daz2); @@ -11433,8 +11433,8 @@ restart_grand: // ceil cz daz daz2 fz floor if ((cz <= intz && intz <= daz) || (daz2 <= intz && intz <= fz)) { - hitinfo->hitsect = curspr->sectnum; hitinfo->hitwall = -1; hitinfo->hitsprite = curspr-sprite; - hitinfo->pos.x = intx; hitinfo->pos.y = inty; hitinfo->pos.z = intz; + hit->sect = curspr->sectnum; hit->wall = -1; hit->sprite = curspr-sprite; + hit->pos.x = intx; hit->pos.y = inty; hit->pos.z = intz; continue; } } @@ -11491,10 +11491,10 @@ restart_grand: intx = sv->x + scale(vx,topt,bot); inty = sv->y + scale(vy,topt,bot); - if (klabs(intx-sv->x)+klabs(inty-sv->y) > klabs((hitinfo->pos.x)-sv->x)+klabs((hitinfo->pos.y)-sv->y)) continue; + if (klabs(intx-sv->x)+klabs(inty-sv->y) > klabs((hit->pos.x)-sv->x)+klabs((hit->pos.y)-sv->y)) continue; - hitinfo->hitsect = dasector; hitinfo->hitwall = -1; hitinfo->hitsprite = z; - hitinfo->pos.x = intx; hitinfo->pos.y = inty; hitinfo->pos.z = intz; + hit->sect = dasector; hit->wall = -1; hit->sprite = z; + hit->pos.x = intx; hit->pos.y = inty; hit->pos.z = intz; break; case 16: @@ -11514,15 +11514,15 @@ restart_grand: if (rintersect(sv->x,sv->y,sv->z,vx,vy,vz,x1,y1,x2,y2,&intx,&inty,&intz) == 0) continue; - if (klabs(intx-sv->x)+klabs(inty-sv->y) > klabs((hitinfo->pos.x)-sv->x)+klabs((hitinfo->pos.y)-sv->y)) continue; + if (klabs(intx-sv->x)+klabs(inty-sv->y) > klabs((hit->pos.x)-sv->x)+klabs((hit->pos.y)-sv->y)) continue; k = ((tilesizy[spr->picnum]*spr->yrepeat)<<2); if (cstat&128) daz = spr->z+(k>>1); else daz = spr->z; if (picanm[spr->picnum]&0x00ff0000) daz -= ((int32_t)((int8_t)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2); if ((intz < daz) && (intz > daz-k)) { - hitinfo->hitsect = dasector; hitinfo->hitwall = -1; hitinfo->hitsprite = z; - hitinfo->pos.x = intx; hitinfo->pos.y = inty; hitinfo->pos.z = intz; + hit->sect = dasector; hit->wall = -1; hit->sprite = z; + hit->pos.x = intx; hit->pos.y = inty; hit->pos.z = intz; } break; @@ -11543,7 +11543,7 @@ restart_grand: inty = sv->y+scale(intz-sv->z,vy,vz); #endif - if (klabs(intx-sv->x)+klabs(inty-sv->y) > klabs((hitinfo->pos.x)-sv->x)+klabs((hitinfo->pos.y)-sv->y)) continue; + if (klabs(intx-sv->x)+klabs(inty-sv->y) > klabs((hit->pos.x)-sv->x)+klabs((hit->pos.y)-sv->y)) continue; tilenum = spr->picnum; xoff = (int32_t)((int8_t)((picanm[tilenum]>>8)&255))+((int32_t)spr->xoffset); @@ -11590,8 +11590,8 @@ restart_grand: if (clipyou != 0) { - hitinfo->hitsect = dasector; hitinfo->hitwall = -1; hitinfo->hitsprite = z; - hitinfo->pos.x = intx; hitinfo->pos.y = inty; hitinfo->pos.z = intz; + hit->sect = dasector; hit->wall = -1; hit->sprite = z; + hit->pos.x = intx; hit->pos.y = inty; hit->pos.z = intz; } break; } @@ -11608,34 +11608,34 @@ restart_grand: if (numyaxbunches == 0 || editstatus) return 0; - if (hitinfo->hitsprite==-1 && hitinfo->hitwall==-1 && hitinfo->hitsect!=oldhitsect - && hitinfo->hitsect != oldhitsect2) // 'ping-pong' infloop protection + if (hit->sprite==-1 && hit->wall==-1 && hit->sect!=oldhitsect + && hit->sect != oldhitsect2) // 'ping-pong' infloop protection { - if (hitinfo->hitsect == -1 && oldhitsect >= 0) + if (hit->sect == -1 && oldhitsect >= 0) { // this is bad: we didn't hit anything after going through a ceiling/floor - Bmemcpy(&hitinfo->pos, &newsv, sizeof(vec3_t)); - hitinfo->hitsect = oldhitsect; + Bmemcpy(&hit->pos, &newsv, sizeof(vec3_t)); + hit->sect = oldhitsect; return 0; } // 1st, 2nd, ... ceil/floor hit - // hitinfo->hitsect is >=0 because if oldhitsect's init and check above - if (SECTORFLD(hitinfo->hitsect,stat, hitscan_hitsectcf)&yax_waltosecmask(dawalclipmask)) + // hit->sect is >=0 because if oldhitsect's init and check above + if (SECTORFLD(hit->sect,stat, hitscan_hitsectcf)&yax_waltosecmask(dawalclipmask)) return 0; - i = yax_getneighborsect(hitinfo->pos.x, hitinfo->pos.y, hitinfo->hitsect, + i = yax_getneighborsect(hit->pos.x, hit->pos.y, hit->sect, hitscan_hitsectcf, NULL); if (i >= 0) { - Bmemcpy(&newsv, &hitinfo->pos, sizeof(vec3_t)); + Bmemcpy(&newsv, &hit->pos, sizeof(vec3_t)); sectnum = i; sv = &newsv; oldhitsect2 = oldhitsect; - oldhitsect = hitinfo->hitsect; - hitinfo->hitsect = -1; + oldhitsect = hit->sect; + hit->sect = -1; // sector-like sprite re-init: curspr = 0; diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 7897b7898..c5ec1cdce 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -4426,7 +4426,7 @@ void polymost_drawrooms() { int32_t vx, vy, vz; int32_t cz, fz; - hitdata_t hitinfo; + hitdata_t hit; vec3_t vect; double ratio = 1.05; @@ -4472,43 +4472,43 @@ void polymost_drawrooms() hitallsprites = 1; hitscan((const vec3_t *)&vect,globalcursectnum, //Start position - vx>>10,vy>>10,vz>>6,&hitinfo,0xffff0030); + vx>>10,vy>>10,vz>>6,&hit,0xffff0030); - if (hitinfo.hitsect != -1) // if hitsect is -1, hitscan overflowed somewhere + if (hit.sect != -1) // if hitsect is -1, hitscan overflowed somewhere { - getzsofslope(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,&cz,&fz); + getzsofslope(hit.sect,hit.pos.x,hit.pos.y,&cz,&fz); hitallsprites = 0; - searchsector = hitinfo.hitsect; - if (hitinfo.pos.zfz) searchstat = 2; - else if (hitinfo.hitwall >= 0) + searchsector = hit.sect; + if (hit.pos.zfz) searchstat = 2; + else if (hit.wall >= 0) { - searchbottomwall = searchwall = hitinfo.hitwall; searchstat = 0; - if (wall[hitinfo.hitwall].nextwall >= 0) + searchbottomwall = searchwall = hit.wall; searchstat = 0; + if (wall[hit.wall].nextwall >= 0) { int32_t cz, fz; - getzsofslope(wall[hitinfo.hitwall].nextsector,hitinfo.pos.x,hitinfo.pos.y,&cz,&fz); - if (hitinfo.pos.z > fz) + getzsofslope(wall[hit.wall].nextsector,hit.pos.x,hit.pos.y,&cz,&fz); + if (hit.pos.z > fz) { searchisbottom = 1; - if (wall[hitinfo.hitwall].cstat&2) //'2' bottoms of walls - searchbottomwall = wall[hitinfo.hitwall].nextwall; + if (wall[hit.wall].cstat&2) //'2' bottoms of walls + searchbottomwall = wall[hit.wall].nextwall; } else { searchisbottom = 0; - if ((hitinfo.pos.z > cz) && (wall[hitinfo.hitwall].cstat&(16+32))) //masking or 1-way + if ((hit.pos.z > cz) && (wall[hit.wall].cstat&(16+32))) //masking or 1-way searchstat = 4; } } } - else if (hitinfo.hitsprite >= 0) { searchwall = hitinfo.hitsprite; searchstat = 3; } + else if (hit.sprite >= 0) { searchwall = hit.sprite; searchstat = 3; } else { int32_t cz, fz; - getzsofslope(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,&cz,&fz); - if ((hitinfo.pos.z<<1) < cz+fz) searchstat = 1; else searchstat = 2; + getzsofslope(hit.sect,hit.pos.x,hit.pos.y,&cz,&fz); + if ((hit.pos.z<<1) < cz+fz) searchstat = 1; else searchstat = 2; //if (vz < 0) searchstat = 1; else searchstat = 2; //Won't work for slopes :/ } @@ -4516,10 +4516,10 @@ void polymost_drawrooms() { spritetype *tsp = &tsprite[spritesortcnt]; double dadist, x,y,z; - Bmemcpy(tsp, &hitinfo.pos, sizeof(vec3_t)); + Bmemcpy(tsp, &hit.pos, sizeof(vec3_t)); x = tsp->x-globalposx; y=tsp->y-globalposy; z=(tsp->z-globalposz)/16.0; dadist = sqrt(x*x + y*y + z*z); - tsp->sectnum = hitinfo.hitsect; + tsp->sectnum = hit.sect; tsp->picnum = 2523; // CROSSHAIR tsp->cstat = 128; tsp->owner = MAXSPRITES-1; @@ -4541,8 +4541,8 @@ void polymost_drawrooms() int32_t w1[2] = {wal[k].x, wal[k].y}; int32_t w2[2] = {wall[wal[k].point2].x, wall[wal[k].point2].y}; int32_t w21[2] = {w1[0]-w2[0], w1[1]-w2[1]}; - int32_t pw1[2] = {w1[0]-hitinfo.pos.x, w1[1]-hitinfo.pos.y}; - int32_t pw2[2] = {w2[0]-hitinfo.pos.x, w2[1]-hitinfo.pos.y}; + int32_t pw1[2] = {w1[0]-hit.pos.x, w1[1]-hit.pos.y}; + int32_t pw2[2] = {w2[0]-hit.pos.x, w2[1]-hit.pos.y}; float w1d = (float)(scrv_r[0]*pw1[0] + scrv_r[1]*pw1[1]); float w2d = (float)(scrv_r[0]*pw2[0] + scrv_r[1]*pw2[1]); int32_t ptonline[2], scrp[2]; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 823197761..ed7588408 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -2996,7 +2996,7 @@ static void G_DoThirdPerson(DukePlayer_t *pp, vec3_t *vect,int16_t *vsectnum, in int32_t i, hx, hy; int32_t daang; int32_t bakcstat = sp->cstat; - hitdata_t hitinfo; + hitdata_t hit; vec3_t n = { (sintable[(ang+1536)&2047]>>4), (sintable[(ang+1024)&2047]>>4), (horiz-100)*128 @@ -3005,7 +3005,7 @@ static void G_DoThirdPerson(DukePlayer_t *pp, vec3_t *vect,int16_t *vsectnum, in sp->cstat &= (int16_t)~0x101; updatesectorz(vect->x,vect->y,vect->z,vsectnum); - hitscan((const vec3_t *)vect,*vsectnum,n.x,n.y,n.z,&hitinfo,CLIPMASK1); + hitscan((const vec3_t *)vect,*vsectnum,n.x,n.y,n.z,&hit,CLIPMASK1); if (*vsectnum < 0) { @@ -3013,21 +3013,21 @@ static void G_DoThirdPerson(DukePlayer_t *pp, vec3_t *vect,int16_t *vsectnum, in return; } - hx = hitinfo.pos.x-(vect->x); - hy = hitinfo.pos.y-(vect->y); + hx = hit.pos.x-(vect->x); + hy = hit.pos.y-(vect->y); if (klabs(n.x)+klabs(n.y) > klabs(hx)+klabs(hy)) { - *vsectnum = hitinfo.hitsect; - if (hitinfo.hitwall >= 0) + *vsectnum = hit.sect; + if (hit.wall >= 0) { - daang = getangle(wall[wall[hitinfo.hitwall].point2].x-wall[hitinfo.hitwall].x, - wall[wall[hitinfo.hitwall].point2].y-wall[hitinfo.hitwall].y); + daang = getangle(wall[wall[hit.wall].point2].x-wall[hit.wall].x, + wall[wall[hit.wall].point2].y-wall[hit.wall].y); i = n.x*sintable[daang]+n.y*sintable[(daang+1536)&2047]; if (klabs(n.x) > klabs(n.y)) hx -= mulscale28(n.x,i); else hy -= mulscale28(n.y,i); } - else if (hitinfo.hitsprite < 0) + else if (hit.sprite < 0) { if (klabs(n.x) > klabs(n.y)) hx -= (n.x>>5); else hy -= (n.y>>5); @@ -10677,7 +10677,7 @@ int32_t G_DoMoveThings(void) if (ud.idplayers && (g_netServer || ud.multimode > 1)) { - hitdata_t hitinfo; + hitdata_t hit; DukePlayer_t *const p = g_player[screenpeek].ps; for (i=0; icursectnum, sintable[(p->ang+512)&2047], sintable[p->ang&2047], - (100-p->horiz-p->horizoff)<<11,&hitinfo,0xffff0030); + (100-p->horiz-p->horizoff)<<11,&hit,0xffff0030); for (i=0; iholoduke_on != -1) sprite[g_player[i].ps->holoduke_on].cstat ^= 256; - if ((hitinfo.hitsprite >= 0) && !(g_player[myconnectindex].ps->gm & MODE_MENU) && - sprite[hitinfo.hitsprite].picnum == APLAYER && sprite[hitinfo.hitsprite].yvel != screenpeek && - g_player[sprite[hitinfo.hitsprite].yvel].ps->dead_flag == 0) + if ((hit.sprite >= 0) && !(g_player[myconnectindex].ps->gm & MODE_MENU) && + sprite[hit.sprite].picnum == APLAYER && sprite[hit.sprite].yvel != screenpeek && + g_player[sprite[hit.sprite].yvel].ps->dead_flag == 0) { if (p->fta == 0 || p->ftq == QUOTE_RESERVED3) { - if (ldist(&sprite[p->i],&sprite[hitinfo.hitsprite]) < 9216) + if (ldist(&sprite[p->i],&sprite[hit.sprite]) < 9216) { - Bsprintf(ScriptQuotes[QUOTE_RESERVED3],"%s",&g_player[sprite[hitinfo.hitsprite].yvel].user_name[0]); + Bsprintf(ScriptQuotes[QUOTE_RESERVED3],"%s",&g_player[sprite[hit.sprite].yvel].user_name[0]); p->fta = 12, p->ftq = QUOTE_RESERVED3; } } diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 36c36c9da..916e424c0 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -242,7 +242,7 @@ int32_t A_GetFurthestAngle(int32_t iActor,int32_t angs) int32_t d; int32_t greatestd = -(1<<30); int32_t angincs = 2048/angs,j; - hitdata_t hitinfo; + hitdata_t hit; for (j=s->ang; j<(2048+s->ang); j+=angincs) { @@ -250,9 +250,9 @@ int32_t A_GetFurthestAngle(int32_t iActor,int32_t angs) hitscan((const vec3_t *)s, s->sectnum, sintable[(j+512)&2047], sintable[j&2047],0, - &hitinfo,CLIPMASK1); + &hit,CLIPMASK1); s->z += (8<<8); - d = klabs(hitinfo.pos.x-s->x) + klabs(hitinfo.pos.y-s->y); + d = klabs(hit.pos.x-s->x) + klabs(hit.pos.y-s->y); if (d > greatestd) { @@ -273,7 +273,7 @@ int32_t A_FurthestVisiblePoint(int32_t iActor,spritetype *ts,int32_t *dax,int32_ int32_t d, da;//, d, cd, ca,tempx,tempy,cx,cy; int32_t j, angincs; spritetype *s = &sprite[iActor]; - hitdata_t hitinfo; + hitdata_t hit; if ((!g_netServer && ud.multimode < 2) && ud.player_skill < 3) angincs = 2048/2; @@ -285,20 +285,20 @@ int32_t A_FurthestVisiblePoint(int32_t iActor,spritetype *ts,int32_t *dax,int32_ hitscan((const vec3_t *)ts, ts->sectnum, sintable[(j+512)&2047], sintable[j&2047],16384-(krand()&32767), - &hitinfo,CLIPMASK1); + &hit,CLIPMASK1); ts->z += (16<<8); - d = klabs(hitinfo.pos.x-ts->x)+klabs(hitinfo.pos.y-ts->y); - da = klabs(hitinfo.pos.x-s->x)+klabs(hitinfo.pos.y-s->y); + d = klabs(hit.pos.x-ts->x)+klabs(hit.pos.y-ts->y); + da = klabs(hit.pos.x-s->x)+klabs(hit.pos.y-s->y); - if (d < da && hitinfo.hitsect > -1) - if (cansee(hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z, - hitinfo.hitsect,s->x,s->y,s->z-(16<<8),s->sectnum)) + if (d < da && hit.sect > -1) + if (cansee(hit.pos.x,hit.pos.y,hit.pos.z, + hit.sect,s->x,s->y,s->z-(16<<8),s->sectnum)) { - *dax = hitinfo.pos.x; - *day = hitinfo.pos.y; - return hitinfo.hitsect; + *dax = hit.pos.x; + *day = hit.pos.y; + return hit.sect; } } return -1; @@ -2717,7 +2717,7 @@ nullquote: insptr++; { vec3_t vect; - hitdata_t hitinfo; + hitdata_t hit; vect.x = Gv_GetVarX(*insptr++); vect.y = Gv_GetVarX(*insptr++); @@ -2734,13 +2734,13 @@ nullquote: OSD_Printf(CON_ERROR "Invalid sector %d\n",g_errorLineNum,keyw[g_tw],sectnum); continue; } - hitscan((const vec3_t *)&vect, sectnum, vx, vy, vz, &hitinfo, cliptype); - Gv_SetVarX(hitsectvar, hitinfo.hitsect); - Gv_SetVarX(hitwallvar, hitinfo.hitwall); - Gv_SetVarX(hitspritevar, hitinfo.hitsprite); - Gv_SetVarX(hitxvar, hitinfo.pos.x); - Gv_SetVarX(hityvar, hitinfo.pos.y); - Gv_SetVarX(hitzvar, hitinfo.pos.z); + hitscan((const vec3_t *)&vect, sectnum, vx, vy, vz, &hit, cliptype); + Gv_SetVarX(hitsectvar, hit.sect); + Gv_SetVarX(hitwallvar, hit.wall); + Gv_SetVarX(hitspritevar, hit.sprite); + Gv_SetVarX(hitxvar, hit.pos.x); + Gv_SetVarX(hityvar, hit.pos.y); + Gv_SetVarX(hitzvar, hit.pos.z); } continue; } diff --git a/polymer/eduke32/source/m32exec.c b/polymer/eduke32/source/m32exec.c index 051d9b4b2..2134909e9 100644 --- a/polymer/eduke32/source/m32exec.c +++ b/polymer/eduke32/source/m32exec.c @@ -1853,7 +1853,7 @@ badindex: insptr++; { vec3_t vect; - hitdata_t hitinfo; + hitdata_t hit; vect.x = Gv_GetVarX(*insptr++); vect.y = Gv_GetVarX(*insptr++); @@ -1866,13 +1866,13 @@ badindex: int32_t hitxvar=*insptr++, hityvar=*insptr++, hitzvar=*insptr++, cliptype=Gv_GetVarX(*insptr++); X_ERROR_INVALIDSECT(sectnum); - hitscan((const vec3_t *)&vect, sectnum, vx, vy, vz, &hitinfo, cliptype); - Gv_SetVarX(hitsectvar, hitinfo.hitsect); - Gv_SetVarX(hitwallvar, hitinfo.hitwall); - Gv_SetVarX(hitspritevar, hitinfo.hitsprite); - Gv_SetVarX(hitxvar, hitinfo.pos.x); - Gv_SetVarX(hityvar, hitinfo.pos.y); - Gv_SetVarX(hitzvar, hitinfo.pos.z); + hitscan((const vec3_t *)&vect, sectnum, vx, vy, vz, &hit, cliptype); + Gv_SetVarX(hitsectvar, hit.sect); + Gv_SetVarX(hitwallvar, hit.wall); + Gv_SetVarX(hitspritevar, hit.sprite); + Gv_SetVarX(hitxvar, hit.pos.x); + Gv_SetVarX(hityvar, hit.pos.y); + Gv_SetVarX(hitzvar, hit.pos.z); } continue; } diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index a4621e488..c66d2749c 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -188,16 +188,16 @@ static void A_HitscanProjTrail(const vec3_t *sv, const vec3_t *dv, int32_t ang, int32_t A_GetHitscanRange(int32_t i) { int32_t zoff = (PN == APLAYER) ? PHEIGHT : 0; - hitdata_t hitinfo; + hitdata_t hit; SZ -= zoff; hitscan((const vec3_t *)&sprite[i],SECT, sintable[(SA+512)&2047], sintable[SA&2047], - 0,&hitinfo,CLIPMASK1); + 0,&hit,CLIPMASK1); SZ += zoff; - return (FindDistance2D(hitinfo.pos.x-SX,hitinfo.pos.y-SY)); + return (FindDistance2D(hit.pos.x-SX,hit.pos.y-SY)); } static int32_t A_FindTargetSprite(spritetype *s,int32_t aang,int32_t atwith) @@ -315,7 +315,7 @@ int32_t A_Shoot(int32_t i,int32_t atwith) { int16_t l, sa, j, k=-1; int32_t vel, zvel = 0, x, oldzvel, dal; - hitdata_t hitinfo; + hitdata_t hit; vec3_t srcvect; char sizx,sizy; spritetype *s = &sprite[i]; @@ -423,29 +423,29 @@ int32_t A_Shoot(int32_t i,int32_t atwith) hitscan((const vec3_t *)&srcvect,sect, sintable[(sa+512)&2047], sintable[sa&2047],zvel<<6, - &hitinfo,CLIPMASK1); + &hit,CLIPMASK1); if (ProjectileData[atwith].workslike & PROJECTILE_BLOOD) { if (ProjectileData[atwith].range == 0) ProjectileData[atwith].range = 1024; - if (FindDistance2D(srcvect.x-hitinfo.pos.x,srcvect.y-hitinfo.pos.y) < ProjectileData[atwith].range) - if (FindDistance2D(wall[hitinfo.hitwall].x-wall[wall[hitinfo.hitwall].point2].x,wall[hitinfo.hitwall].y-wall[wall[hitinfo.hitwall].point2].y) > + if (FindDistance2D(srcvect.x-hit.pos.x,srcvect.y-hit.pos.y) < ProjectileData[atwith].range) + if (FindDistance2D(wall[hit.wall].x-wall[wall[hit.wall].point2].x,wall[hit.wall].y-wall[wall[hit.wall].point2].y) > (mulscale(ProjectileData[atwith].xrepeat+8,tilesizx[ProjectileData[atwith].decal],3))) - if (hitinfo.hitwall >= 0 && wall[hitinfo.hitwall].overpicnum != BIGFORCE) - if ((wall[hitinfo.hitwall].nextsector >= 0 && hitinfo.hitsect >= 0 && - sector[wall[hitinfo.hitwall].nextsector].lotag == 0 && - sector[hitinfo.hitsect].lotag == 0 && - sector[wall[hitinfo.hitwall].nextsector].lotag == 0 && - (sector[hitinfo.hitsect].floorz-sector[wall[hitinfo.hitwall].nextsector].floorz) > + if (hit.wall >= 0 && wall[hit.wall].overpicnum != BIGFORCE) + if ((wall[hit.wall].nextsector >= 0 && hit.sect >= 0 && + sector[wall[hit.wall].nextsector].lotag == 0 && + sector[hit.sect].lotag == 0 && + sector[wall[hit.wall].nextsector].lotag == 0 && + (sector[hit.sect].floorz-sector[wall[hit.wall].nextsector].floorz) > (mulscale(ProjectileData[atwith].yrepeat,tilesizy[ProjectileData[atwith].decal],3)<<8)) || - (wall[hitinfo.hitwall].nextsector == -1 && sector[hitinfo.hitsect].lotag == 0)) - if ((wall[hitinfo.hitwall].cstat&16) == 0) + (wall[hit.wall].nextsector == -1 && sector[hit.sect].lotag == 0)) + if ((wall[hit.wall].cstat&16) == 0) { - if (wall[hitinfo.hitwall].nextsector >= 0) + if (wall[hit.wall].nextsector >= 0) { - k = headspritesect[wall[hitinfo.hitwall].nextsector]; + k = headspritesect[wall[hit.wall].nextsector]; while (k >= 0) { if (sprite[k].statnum == 3 && sprite[k].lotag == 13) @@ -454,11 +454,11 @@ int32_t A_Shoot(int32_t i,int32_t atwith) } } - if (wall[hitinfo.hitwall].nextwall >= 0 && - wall[wall[hitinfo.hitwall].nextwall].hitag != 0) + if (wall[hit.wall].nextwall >= 0 && + wall[wall[hit.wall].nextwall].hitag != 0) return -1; - if (wall[hitinfo.hitwall].hitag == 0) + if (wall[hit.wall].hitag == 0) { if (ProjectileData[atwith].decal >= 0) { @@ -468,13 +468,13 @@ int32_t A_Shoot(int32_t i,int32_t atwith) actor[k].flags |= SPRITE_DECAL; sprite[k].xvel = -1; - sprite[k].ang = getangle(wall[hitinfo.hitwall].x-wall[wall[hitinfo.hitwall].point2].x, - wall[hitinfo.hitwall].y-wall[wall[hitinfo.hitwall].point2].y)+512; - Bmemcpy(&sprite[k],&hitinfo.pos,sizeof(vec3_t)); + sprite[k].ang = getangle(wall[hit.wall].x-wall[wall[hit.wall].point2].x, + wall[hit.wall].y-wall[wall[hit.wall].point2].y)+512; + Bmemcpy(&sprite[k],&hit.pos,sizeof(vec3_t)); /* - sprite[k].x = hitinfo.pos.x; - sprite[k].y = hitinfo.pos.y; - sprite[k].z = hitinfo.pos.z; + sprite[k].x = hit.pos.x; + sprite[k].y = hit.pos.y; + sprite[k].z = hit.pos.z; */ if (ProjectileData[atwith].workslike & PROJECTILE_RANDDECALSIZE) { @@ -520,18 +520,18 @@ int32_t A_Shoot(int32_t i,int32_t atwith) return -1; } - if (hitinfo.hitsect < 0) return -1; + if (hit.sect < 0) return -1; if ((ProjectileData[atwith].range == 0) && (ProjectileData[atwith].workslike & PROJECTILE_KNEE)) ProjectileData[atwith].range = 1024; - if ((ProjectileData[atwith].range > 0) && ((klabs(srcvect.x-hitinfo.pos.x)+klabs(srcvect.y-hitinfo.pos.y)) > ProjectileData[atwith].range)) + if ((ProjectileData[atwith].range > 0) && ((klabs(srcvect.x-hit.pos.x)+klabs(srcvect.y-hit.pos.y)) > ProjectileData[atwith].range)) return -1; else { - if (hitinfo.hitwall >= 0 || hitinfo.hitsprite >= 0) + if (hit.wall >= 0 || hit.sprite >= 0) { - j = A_InsertSprite(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,atwith,-15,0,0,sa,32,0,i,4); + j = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,atwith,-15,0,0,sa,32,0,i,4); SpriteProjectile[j].workslike = ProjectileData[sprite[j].picnum].workslike; sprite[j].extra = ProjectileData[atwith].extra; if (ProjectileData[atwith].extra_rand > 0) @@ -542,9 +542,9 @@ int32_t A_Shoot(int32_t i,int32_t atwith) { k = A_Spawn(j,ProjectileData[atwith].spawns); sprite[k].z -= (8<<8); - actor[k].t_data[6] = hitinfo.hitwall; - actor[k].t_data[7] = hitinfo.hitsect; - actor[k].t_data[8] = hitinfo.hitsprite; + actor[k].t_data[6] = hit.wall; + actor[k].t_data[7] = hit.sect; + actor[k].t_data[8] = hit.sprite; } if (ProjectileData[atwith].sound >= 0) A_PlaySound(ProjectileData[atwith].sound,j); } @@ -552,31 +552,31 @@ int32_t A_Shoot(int32_t i,int32_t atwith) if (p >= 0 && ps->inv_amount[GET_STEROIDS] > 0 && ps->inv_amount[GET_STEROIDS] < 400) sprite[j].extra += (ps->max_player_health>>2); - if (hitinfo.hitsprite >= 0 && sprite[hitinfo.hitsprite].picnum != ACCESSSWITCH && sprite[hitinfo.hitsprite].picnum != ACCESSSWITCH2) + if (hit.sprite >= 0 && sprite[hit.sprite].picnum != ACCESSSWITCH && sprite[hit.sprite].picnum != ACCESSSWITCH2) { - A_DamageObject(hitinfo.hitsprite,j); - if (p >= 0) P_ActivateSwitch(p,hitinfo.hitsprite,1); + A_DamageObject(hit.sprite,j); + if (p >= 0) P_ActivateSwitch(p,hit.sprite,1); } - else if (hitinfo.hitwall >= 0) + else if (hit.wall >= 0) { - if (wall[hitinfo.hitwall].cstat&2) - if (wall[hitinfo.hitwall].nextsector >= 0) - if (hitinfo.pos.z >= (sector[wall[hitinfo.hitwall].nextsector].floorz)) - hitinfo.hitwall = wall[hitinfo.hitwall].nextwall; + if (wall[hit.wall].cstat&2) + if (wall[hit.wall].nextsector >= 0) + if (hit.pos.z >= (sector[wall[hit.wall].nextsector].floorz)) + hit.wall = wall[hit.wall].nextwall; - if (hitinfo.hitwall >= 0 && wall[hitinfo.hitwall].picnum != ACCESSSWITCH && wall[hitinfo.hitwall].picnum != ACCESSSWITCH2) + if (hit.wall >= 0 && wall[hit.wall].picnum != ACCESSSWITCH && wall[hit.wall].picnum != ACCESSSWITCH2) { - A_DamageWall(j,hitinfo.hitwall,&hitinfo.pos,atwith); - if (p >= 0) P_ActivateSwitch(p,hitinfo.hitwall,0); + A_DamageWall(j,hit.wall,&hit.pos,atwith); + if (p >= 0) P_ActivateSwitch(p,hit.wall,0); } } } - else if (p >= 0 && zvel > 0 && sector[hitinfo.hitsect].lotag == 1) + else if (p >= 0 && zvel > 0 && sector[hit.sect].lotag == 1) { j = A_Spawn(g_player[p].ps->i,WATERSPLASH2); - sprite[j].x = hitinfo.pos.x; - sprite[j].y = hitinfo.pos.y; + sprite[j].x = hit.pos.x; + sprite[j].y = hit.pos.y; sprite[j].ang = g_player[p].ps->ang; // Total tweek sprite[j].xvel = 32; A_SetSprite(i,CLIPMASK0); @@ -612,9 +612,9 @@ int32_t A_Shoot(int32_t i,int32_t atwith) dal -= (8<<8); // return -1; } - hitinfo.pos.x = ldist(&sprite[ps->i], &sprite[j]); - if (hitinfo.pos.x == 0) hitinfo.pos.x++; - zvel = ((sprite[j].z-srcvect.z-dal)<<8) / hitinfo.pos.x; + hit.pos.x = ldist(&sprite[ps->i], &sprite[j]); + if (hit.pos.x == 0) hit.pos.x++; + zvel = ((sprite[j].z-srcvect.z-dal)<<8) / hit.pos.x; sa = getangle(sprite[j].x-srcvect.x,sprite[j].y-srcvect.y); } @@ -634,11 +634,11 @@ int32_t A_Shoot(int32_t i,int32_t atwith) zvel = (100-ps->horiz-ps->horizoff)<<5; if (actor[i].shootzvel) zvel = actor[i].shootzvel; hitscan((const vec3_t *)&srcvect,sect,sintable[(sa+512)&2047],sintable[sa&2047], - zvel<<6,&hitinfo,CLIPMASK1); - if (hitinfo.hitsprite != -1) + zvel<<6,&hit,CLIPMASK1); + if (hit.sprite != -1) { - if (sprite[hitinfo.hitsprite].statnum == STAT_ACTOR || sprite[hitinfo.hitsprite].statnum == STAT_ZOMBIEACTOR || sprite[hitinfo.hitsprite].statnum == STAT_PLAYER || sprite[hitinfo.hitsprite].statnum == STAT_DUMMYPLAYER) - j = hitinfo.hitsprite; + if (sprite[hit.sprite].statnum == STAT_ACTOR || sprite[hit.sprite].statnum == STAT_ZOMBIEACTOR || sprite[hit.sprite].statnum == STAT_PLAYER || sprite[hit.sprite].statnum == STAT_DUMMYPLAYER) + j = hit.sprite; } } @@ -671,10 +671,10 @@ int32_t A_Shoot(int32_t i,int32_t atwith) { j = A_FindPlayer(s,&x); srcvect.z -= (4<<8); - hitinfo.pos.x = ldist(&sprite[g_player[j].ps->i], s); - if (hitinfo.pos.x == 0) - hitinfo.pos.x++; - zvel = ((g_player[j].ps->pos.z-srcvect.z) <<8) / hitinfo.pos.x; + hit.pos.x = ldist(&sprite[g_player[j].ps->i], s); + if (hit.pos.x == 0) + hit.pos.x++; + zvel = ((g_player[j].ps->pos.z-srcvect.z) <<8) / hit.pos.x; if (s->picnum != BOSS1) { if (!(ProjectileData[atwith].workslike & PROJECTILE_ACCURATE)) @@ -702,68 +702,68 @@ int32_t A_Shoot(int32_t i,int32_t atwith) hitscan((const vec3_t *)&srcvect,sect, sintable[(sa+512)&2047], sintable[sa&2047], - zvel<<6,&hitinfo,CLIPMASK1); + zvel<<6,&hit,CLIPMASK1); if (ProjectileData[atwith].cstat >= 0) s->cstat |= ProjectileData[atwith].cstat; else s->cstat |= 257; - if (hitinfo.hitsect < 0) return -1; + if (hit.sect < 0) return -1; if ((ProjectileData[atwith].range > 0) && - ((klabs(srcvect.x-hitinfo.pos.x)+klabs(srcvect.y-hitinfo.pos.y)) > ProjectileData[atwith].range)) + ((klabs(srcvect.x-hit.pos.x)+klabs(srcvect.y-hit.pos.y)) > ProjectileData[atwith].range)) return -1; if (ProjectileData[atwith].trail >= 0) - A_HitscanProjTrail(&srcvect,&hitinfo.pos,sa,atwith); + A_HitscanProjTrail(&srcvect,&hit.pos,sa,atwith); if (ProjectileData[atwith].workslike & PROJECTILE_WATERBUBBLES) { - if ((krand()&15) == 0 && sector[hitinfo.hitsect].lotag == 2) - A_DoWaterTracers(hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,srcvect.x,srcvect.y,srcvect.z,8-(ud.multimode>>1)); + if ((krand()&15) == 0 && sector[hit.sect].lotag == 2) + A_DoWaterTracers(hit.pos.x,hit.pos.y,hit.pos.z,srcvect.x,srcvect.y,srcvect.z,8-(ud.multimode>>1)); } if (p >= 0) { - k = A_InsertSprite(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,SHOTSPARK1,-15,10,10,sa,0,0,i,4); + k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,SHOTSPARK1,-15,10,10,sa,0,0,i,4); sprite[k].extra = ProjectileData[atwith].extra; if (ProjectileData[atwith].extra_rand > 0) sprite[k].extra += (krand()%ProjectileData[atwith].extra_rand); sprite[k].yvel = atwith; // this is a hack to allow you to detect which weapon spawned a SHOTSPARK1 - actor[k].t_data[6] = hitinfo.hitwall; - actor[k].t_data[7] = hitinfo.hitsect; - actor[k].t_data[8] = hitinfo.hitsprite; + actor[k].t_data[6] = hit.wall; + actor[k].t_data[7] = hit.sect; + actor[k].t_data[8] = hit.sprite; - if (hitinfo.hitwall == -1 && hitinfo.hitsprite == -1) + if (hit.wall == -1 && hit.sprite == -1) { if (zvel < 0) { - if (sector[hitinfo.hitsect].ceilingstat&1) + if (sector[hit.sect].ceilingstat&1) { sprite[k].xrepeat = 0; sprite[k].yrepeat = 0; return -1; } else - Sect_DamageCeiling(hitinfo.hitsect); + Sect_DamageCeiling(hit.sect); } if (ProjectileData[atwith].spawns >= 0) { int32_t wh=A_Spawn(k,ProjectileData[atwith].spawns); if (ProjectileData[atwith].sxrepeat > 4) sprite[wh].xrepeat=ProjectileData[atwith].sxrepeat; if (ProjectileData[atwith].syrepeat > 4) sprite[wh].yrepeat=ProjectileData[atwith].syrepeat; - actor[wh].t_data[6] = hitinfo.hitwall; - actor[wh].t_data[7] = hitinfo.hitsect; - actor[wh].t_data[8] = hitinfo.hitsprite; + actor[wh].t_data[6] = hit.wall; + actor[wh].t_data[7] = hit.sect; + actor[wh].t_data[8] = hit.sprite; } } - if (hitinfo.hitsprite >= 0) + if (hit.sprite >= 0) { - A_DamageObject(hitinfo.hitsprite,k); - if (sprite[hitinfo.hitsprite].picnum == APLAYER && + A_DamageObject(hit.sprite,k); + if (sprite[hit.sprite].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_TDM) && - g_player[sprite[hitinfo.hitsprite].yvel].ps->team != g_player[sprite[i].yvel].ps->team))) + g_player[sprite[hit.sprite].yvel].ps->team != g_player[sprite[i].yvel].ps->team))) { l = A_Spawn(k,JIBS6); sprite[k].xrepeat = sprite[k].yrepeat = 0; @@ -779,64 +779,64 @@ int32_t A_Shoot(int32_t i,int32_t atwith) int32_t wh=A_Spawn(k,ProjectileData[atwith].spawns); if (ProjectileData[atwith].sxrepeat > 4) sprite[wh].xrepeat=ProjectileData[atwith].sxrepeat; if (ProjectileData[atwith].syrepeat > 4) sprite[wh].yrepeat=ProjectileData[atwith].syrepeat; - actor[wh].t_data[6] = hitinfo.hitwall; - actor[wh].t_data[7] = hitinfo.hitsect; - actor[wh].t_data[8] = hitinfo.hitsprite; + actor[wh].t_data[6] = hit.wall; + actor[wh].t_data[7] = hit.sect; + actor[wh].t_data[8] = hit.sprite; } } if (p >= 0 && ( - sprite[hitinfo.hitsprite].picnum == DIPSWITCH || - sprite[hitinfo.hitsprite].picnum == DIPSWITCH+1 || - sprite[hitinfo.hitsprite].picnum == DIPSWITCH2 || - sprite[hitinfo.hitsprite].picnum == DIPSWITCH2+1 || - sprite[hitinfo.hitsprite].picnum == DIPSWITCH3 || - sprite[hitinfo.hitsprite].picnum == DIPSWITCH3+1 || - sprite[hitinfo.hitsprite].picnum == HANDSWITCH || - sprite[hitinfo.hitsprite].picnum == HANDSWITCH+1)) + sprite[hit.sprite].picnum == DIPSWITCH || + sprite[hit.sprite].picnum == DIPSWITCH+1 || + sprite[hit.sprite].picnum == DIPSWITCH2 || + sprite[hit.sprite].picnum == DIPSWITCH2+1 || + sprite[hit.sprite].picnum == DIPSWITCH3 || + sprite[hit.sprite].picnum == DIPSWITCH3+1 || + sprite[hit.sprite].picnum == HANDSWITCH || + sprite[hit.sprite].picnum == HANDSWITCH+1)) { - P_ActivateSwitch(p,hitinfo.hitsprite,1); + P_ActivateSwitch(p,hit.sprite,1); return -1; } } - else if (hitinfo.hitwall >= 0) + else if (hit.wall >= 0) { if (ProjectileData[atwith].spawns >= 0) { int32_t wh=A_Spawn(k,ProjectileData[atwith].spawns); if (ProjectileData[atwith].sxrepeat > 4) sprite[wh].xrepeat=ProjectileData[atwith].sxrepeat; if (ProjectileData[atwith].syrepeat > 4) sprite[wh].yrepeat=ProjectileData[atwith].syrepeat; - actor[wh].t_data[6] = hitinfo.hitwall; - actor[wh].t_data[7] = hitinfo.hitsect; - actor[wh].t_data[8] = hitinfo.hitsprite; + actor[wh].t_data[6] = hit.wall; + actor[wh].t_data[7] = hit.sect; + actor[wh].t_data[8] = hit.sprite; } - if (CheckDoorTile(wall[hitinfo.hitwall].picnum) == 1) + if (CheckDoorTile(wall[hit.wall].picnum) == 1) goto DOSKIPBULLETHOLE; if (p >= 0 && ( - wall[hitinfo.hitwall].picnum == DIPSWITCH || - wall[hitinfo.hitwall].picnum == DIPSWITCH+1 || - wall[hitinfo.hitwall].picnum == DIPSWITCH2 || - wall[hitinfo.hitwall].picnum == DIPSWITCH2+1 || - wall[hitinfo.hitwall].picnum == DIPSWITCH3 || - wall[hitinfo.hitwall].picnum == DIPSWITCH3+1 || - wall[hitinfo.hitwall].picnum == HANDSWITCH || - wall[hitinfo.hitwall].picnum == HANDSWITCH+1)) + wall[hit.wall].picnum == DIPSWITCH || + wall[hit.wall].picnum == DIPSWITCH+1 || + wall[hit.wall].picnum == DIPSWITCH2 || + wall[hit.wall].picnum == DIPSWITCH2+1 || + wall[hit.wall].picnum == DIPSWITCH3 || + wall[hit.wall].picnum == DIPSWITCH3+1 || + wall[hit.wall].picnum == HANDSWITCH || + wall[hit.wall].picnum == HANDSWITCH+1)) { - P_ActivateSwitch(p,hitinfo.hitwall,0); + P_ActivateSwitch(p,hit.wall,0); return -1; } - if (wall[hitinfo.hitwall].hitag != 0 || (wall[hitinfo.hitwall].nextwall >= 0 && wall[wall[hitinfo.hitwall].nextwall].hitag != 0)) + if (wall[hit.wall].hitag != 0 || (wall[hit.wall].nextwall >= 0 && wall[wall[hit.wall].nextwall].hitag != 0)) goto DOSKIPBULLETHOLE; - if (hitinfo.hitsect >= 0 && sector[hitinfo.hitsect].lotag == 0) - if (wall[hitinfo.hitwall].overpicnum != BIGFORCE) - if ((wall[hitinfo.hitwall].nextsector >= 0 && sector[wall[hitinfo.hitwall].nextsector].lotag == 0) || - (wall[hitinfo.hitwall].nextsector == -1 && sector[hitinfo.hitsect].lotag == 0)) - if ((wall[hitinfo.hitwall].cstat&16) == 0) + if (hit.sect >= 0 && sector[hit.sect].lotag == 0) + if (wall[hit.wall].overpicnum != BIGFORCE) + if ((wall[hit.wall].nextsector >= 0 && sector[wall[hit.wall].nextsector].lotag == 0) || + (wall[hit.wall].nextsector == -1 && sector[hit.sect].lotag == 0)) + if ((wall[hit.wall].cstat&16) == 0) { - if (wall[hitinfo.hitwall].nextsector >= 0) + if (wall[hit.wall].nextsector >= 0) { - l = headspritesect[wall[hitinfo.hitwall].nextsector]; + l = headspritesect[wall[hit.wall].nextsector]; while (l >= 0) { if (sprite[l].statnum == 3 && sprite[l].lotag == 13) @@ -861,8 +861,8 @@ int32_t A_Shoot(int32_t i,int32_t atwith) actor[l].flags |= SPRITE_DECAL; sprite[l].xvel = -1; - sprite[l].ang = getangle(wall[hitinfo.hitwall].x-wall[wall[hitinfo.hitwall].point2].x, - wall[hitinfo.hitwall].y-wall[wall[hitinfo.hitwall].point2].y)+512; + sprite[l].ang = getangle(wall[hit.wall].x-wall[wall[hit.wall].point2].x, + wall[hit.wall].y-wall[wall[hit.wall].point2].y)+512; if (ProjectileData[atwith].workslike & PROJECTILE_RANDDECALSIZE) { int32_t wh = (krand()&ProjectileData[atwith].xrepeat); @@ -887,48 +887,48 @@ int32_t A_Shoot(int32_t i,int32_t atwith) DOSKIPBULLETHOLE: - if (wall[hitinfo.hitwall].cstat&2) - if (wall[hitinfo.hitwall].nextsector >= 0) - if (hitinfo.pos.z >= (sector[wall[hitinfo.hitwall].nextsector].floorz)) - hitinfo.hitwall = wall[hitinfo.hitwall].nextwall; + if (wall[hit.wall].cstat&2) + if (wall[hit.wall].nextsector >= 0) + if (hit.pos.z >= (sector[wall[hit.wall].nextsector].floorz)) + hit.wall = wall[hit.wall].nextwall; - A_DamageWall(k,hitinfo.hitwall,&hitinfo.pos,atwith); + A_DamageWall(k,hit.wall,&hit.pos,atwith); } } else { - k = A_InsertSprite(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,SHOTSPARK1,-15,24,24,sa,0,0,i,4); + k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,SHOTSPARK1,-15,24,24,sa,0,0,i,4); sprite[k].extra = ProjectileData[atwith].extra; if (ProjectileData[atwith].extra_rand > 0) sprite[k].extra += (krand()%ProjectileData[atwith].extra_rand); sprite[k].yvel = atwith; // this is a hack to allow you to detect which weapon spawned a SHOTSPARK1 - actor[k].t_data[6] = hitinfo.hitwall; - actor[k].t_data[7] = hitinfo.hitsect; - actor[k].t_data[8] = hitinfo.hitsprite; + actor[k].t_data[6] = hit.wall; + actor[k].t_data[7] = hit.sect; + actor[k].t_data[8] = hit.sprite; - if (hitinfo.hitsprite >= 0) + if (hit.sprite >= 0) { - A_DamageObject(hitinfo.hitsprite,k); - if (sprite[hitinfo.hitsprite].picnum != APLAYER) + A_DamageObject(hit.sprite,k); + if (sprite[hit.sprite].picnum != APLAYER) { if (ProjectileData[atwith].spawns >= 0) { int32_t wh=A_Spawn(k,ProjectileData[atwith].spawns); if (ProjectileData[atwith].sxrepeat > 4) sprite[wh].xrepeat=ProjectileData[atwith].sxrepeat; if (ProjectileData[atwith].syrepeat > 4) sprite[wh].yrepeat=ProjectileData[atwith].syrepeat; - actor[wh].t_data[6] = hitinfo.hitwall; - actor[wh].t_data[7] = hitinfo.hitsect; - actor[wh].t_data[8] = hitinfo.hitsprite; + actor[wh].t_data[6] = hit.wall; + actor[wh].t_data[7] = hit.sect; + actor[wh].t_data[8] = hit.sprite; } } else sprite[k].xrepeat = sprite[k].yrepeat = 0; } - else if (hitinfo.hitwall >= 0) - A_DamageWall(k,hitinfo.hitwall,&hitinfo.pos,atwith); + else if (hit.wall >= 0) + A_DamageWall(k,hit.wall,&hit.pos,atwith); } if ((krand()&255) < 4 && ProjectileData[atwith].isound >= 0) - S_PlaySound3D(ProjectileData[atwith].isound,k,&hitinfo.pos); + S_PlaySound3D(ProjectileData[atwith].isound,k,&hit.pos); return -1; } @@ -959,12 +959,12 @@ DOSKIPBULLETHOLE: if (j >= 0) { dal = ((sprite[j].yrepeat*tilesizy[sprite[j].picnum])<<1)+(8<<8); - hitinfo.pos.x = ldist(&sprite[ps->i], &sprite[j]); + hit.pos.x = ldist(&sprite[ps->i], &sprite[j]); - if (hitinfo.pos.x == 0) - hitinfo.pos.x++; + if (hit.pos.x == 0) + hit.pos.x++; - zvel = ((sprite[j].z-srcvect.z-dal)*vel) / hitinfo.pos.x; + zvel = ((sprite[j].z-srcvect.z-dal)*vel) / hit.pos.x; if (sprite[j].picnum != RECON) sa = getangle(sprite[j].x-srcvect.x,sprite[j].y-srcvect.y); @@ -1083,23 +1083,23 @@ DOSKIPBULLETHOLE: hitscan((const vec3_t *)&srcvect,sect, sintable[(sa+512)&2047], sintable[sa&2047],zvel<<6, - &hitinfo,CLIPMASK1); + &hit,CLIPMASK1); if (atwith >= BLOODSPLAT1 && atwith <= BLOODSPLAT4) { - if (FindDistance2D(srcvect.x-hitinfo.pos.x,srcvect.y-hitinfo.pos.y) < 1024) - if (hitinfo.hitwall >= 0 && wall[hitinfo.hitwall].overpicnum != BIGFORCE) - if ((wall[hitinfo.hitwall].nextsector >= 0 && hitinfo.hitsect >= 0 && - sector[wall[hitinfo.hitwall].nextsector].lotag == 0 && - sector[hitinfo.hitsect].lotag == 0 && - sector[wall[hitinfo.hitwall].nextsector].lotag == 0 && - (sector[hitinfo.hitsect].floorz-sector[wall[hitinfo.hitwall].nextsector].floorz) > (16<<8)) || - (wall[hitinfo.hitwall].nextsector == -1 && sector[hitinfo.hitsect].lotag == 0)) - if ((wall[hitinfo.hitwall].cstat&16) == 0) + if (FindDistance2D(srcvect.x-hit.pos.x,srcvect.y-hit.pos.y) < 1024) + if (hit.wall >= 0 && wall[hit.wall].overpicnum != BIGFORCE) + if ((wall[hit.wall].nextsector >= 0 && hit.sect >= 0 && + sector[wall[hit.wall].nextsector].lotag == 0 && + sector[hit.sect].lotag == 0 && + sector[wall[hit.wall].nextsector].lotag == 0 && + (sector[hit.sect].floorz-sector[wall[hit.wall].nextsector].floorz) > (16<<8)) || + (wall[hit.wall].nextsector == -1 && sector[hit.sect].lotag == 0)) + if ((wall[hit.wall].cstat&16) == 0) { - if (wall[hitinfo.hitwall].nextsector >= 0) + if (wall[hit.wall].nextsector >= 0) { - k = headspritesect[wall[hitinfo.hitwall].nextsector]; + k = headspritesect[wall[hit.wall].nextsector]; while (k >= 0) { if (sprite[k].statnum == 3 && sprite[k].lotag == 13) @@ -1108,19 +1108,19 @@ DOSKIPBULLETHOLE: } } - if (wall[hitinfo.hitwall].nextwall >= 0 && - wall[wall[hitinfo.hitwall].nextwall].hitag != 0) + if (wall[hit.wall].nextwall >= 0 && + wall[wall[hit.wall].nextwall].hitag != 0) return -1; - if (wall[hitinfo.hitwall].hitag == 0) + if (wall[hit.wall].hitag == 0) { k = A_Spawn(i,atwith); sprite[k].xvel = -12; - sprite[k].ang = getangle(wall[hitinfo.hitwall].x-wall[wall[hitinfo.hitwall].point2].x, - wall[hitinfo.hitwall].y-wall[wall[hitinfo.hitwall].point2].y)+512; - sprite[k].x = hitinfo.pos.x; - sprite[k].y = hitinfo.pos.y; - sprite[k].z = hitinfo.pos.z; + sprite[k].ang = getangle(wall[hit.wall].x-wall[wall[hit.wall].point2].x, + wall[hit.wall].y-wall[wall[hit.wall].point2].y)+512; + sprite[k].x = hit.pos.x; + sprite[k].y = hit.pos.y; + sprite[k].z = hit.pos.z; sprite[k].cstat |= (krand()&4); A_SetSprite(k,CLIPMASK0); setsprite(k,(vec3_t *)&sprite[k]); @@ -1131,52 +1131,52 @@ DOSKIPBULLETHOLE: return -1; } - if (hitinfo.hitsect < 0) break; + if (hit.sect < 0) break; - if ((klabs(srcvect.x-hitinfo.pos.x)+klabs(srcvect.y-hitinfo.pos.y)) < 1024) + if ((klabs(srcvect.x-hit.pos.x)+klabs(srcvect.y-hit.pos.y)) < 1024) { - if (hitinfo.hitwall >= 0 || hitinfo.hitsprite >= 0) + if (hit.wall >= 0 || hit.sprite >= 0) { - j = A_InsertSprite(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,KNEE,-15,0,0,sa,32,0,i,4); + j = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,KNEE,-15,0,0,sa,32,0,i,4); sprite[j].extra += (krand()&7); if (p >= 0) { k = A_Spawn(j,SMALLSMOKE); sprite[k].z -= (8<<8); A_PlaySound(KICK_HIT,j); - actor[k].t_data[6] = hitinfo.hitwall; - actor[k].t_data[7] = hitinfo.hitsect; - actor[k].t_data[8] = hitinfo.hitsprite; + actor[k].t_data[6] = hit.wall; + actor[k].t_data[7] = hit.sect; + actor[k].t_data[8] = hit.sprite; } if (p >= 0 && ps->inv_amount[GET_STEROIDS] > 0 && ps->inv_amount[GET_STEROIDS] < 400) sprite[j].extra += (ps->max_player_health>>2); - if (hitinfo.hitsprite >= 0 && sprite[hitinfo.hitsprite].picnum != ACCESSSWITCH && sprite[hitinfo.hitsprite].picnum != ACCESSSWITCH2) + if (hit.sprite >= 0 && sprite[hit.sprite].picnum != ACCESSSWITCH && sprite[hit.sprite].picnum != ACCESSSWITCH2) { - A_DamageObject(hitinfo.hitsprite,j); - if (p >= 0) P_ActivateSwitch(p,hitinfo.hitsprite,1); + A_DamageObject(hit.sprite,j); + if (p >= 0) P_ActivateSwitch(p,hit.sprite,1); } - else if (hitinfo.hitwall >= 0) + else if (hit.wall >= 0) { - if (wall[hitinfo.hitwall].cstat&2) - if (wall[hitinfo.hitwall].nextsector >= 0) - if (hitinfo.pos.z >= (sector[wall[hitinfo.hitwall].nextsector].floorz)) - hitinfo.hitwall = wall[hitinfo.hitwall].nextwall; + if (wall[hit.wall].cstat&2) + if (wall[hit.wall].nextsector >= 0) + if (hit.pos.z >= (sector[wall[hit.wall].nextsector].floorz)) + hit.wall = wall[hit.wall].nextwall; - if (hitinfo.hitwall >= 0 && wall[hitinfo.hitwall].picnum != ACCESSSWITCH && wall[hitinfo.hitwall].picnum != ACCESSSWITCH2) + if (hit.wall >= 0 && wall[hit.wall].picnum != ACCESSSWITCH && wall[hit.wall].picnum != ACCESSSWITCH2) { - A_DamageWall(j,hitinfo.hitwall,&hitinfo.pos,atwith); - if (p >= 0) P_ActivateSwitch(p,hitinfo.hitwall,0); + A_DamageWall(j,hit.wall,&hit.pos,atwith); + if (p >= 0) P_ActivateSwitch(p,hit.wall,0); } } } - else if (p >= 0 && zvel > 0 && sector[hitinfo.hitsect].lotag == 1) + else if (p >= 0 && zvel > 0 && sector[hit.sect].lotag == 1) { j = A_Spawn(g_player[p].ps->i,WATERSPLASH2); - sprite[j].x = hitinfo.pos.x; - sprite[j].y = hitinfo.pos.y; + sprite[j].x = hit.pos.x; + sprite[j].y = hit.pos.y; sprite[j].ang = g_player[p].ps->ang; // Total tweek sprite[j].xvel = 32; A_SetSprite(i,CLIPMASK0); @@ -1214,9 +1214,9 @@ DOSKIPBULLETHOLE: dal -= (8<<8); } - hitinfo.pos.x = ldist(&sprite[ps->i], &sprite[j]); - if (hitinfo.pos.x == 0) hitinfo.pos.x++; - zvel = ((sprite[j].z-srcvect.z-dal)<<8) / hitinfo.pos.x; + hit.pos.x = ldist(&sprite[ps->i], &sprite[j]); + if (hit.pos.x == 0) hit.pos.x++; + zvel = ((sprite[j].z-srcvect.z-dal)<<8) / hit.pos.x; sa = getangle(sprite[j].x-srcvect.x,sprite[j].y-srcvect.y); } @@ -1236,12 +1236,12 @@ DOSKIPBULLETHOLE: zvel = (100-ps->horiz-ps->horizoff)<<5; if (actor[i].shootzvel) zvel = actor[i].shootzvel; hitscan((const vec3_t *)&srcvect,sect,sintable[(sa+512)&2047],sintable[sa&2047], - zvel<<6,&hitinfo,CLIPMASK1); - if (hitinfo.hitsprite != -1) + zvel<<6,&hit,CLIPMASK1); + if (hit.sprite != -1) { - if (sprite[hitinfo.hitsprite].statnum == STAT_ACTOR || sprite[hitinfo.hitsprite].statnum == STAT_ZOMBIEACTOR || - sprite[hitinfo.hitsprite].statnum == STAT_PLAYER || sprite[hitinfo.hitsprite].statnum == STAT_DUMMYPLAYER) - j = hitinfo.hitsprite; + if (sprite[hit.sprite].statnum == STAT_ACTOR || sprite[hit.sprite].statnum == STAT_ZOMBIEACTOR || + sprite[hit.sprite].statnum == STAT_PLAYER || sprite[hit.sprite].statnum == STAT_DUMMYPLAYER) + j = hit.sprite; } } @@ -1269,10 +1269,10 @@ DOSKIPBULLETHOLE: { j = A_FindPlayer(s,&x); srcvect.z -= (4<<8); - hitinfo.pos.x = ldist(&sprite[g_player[j].ps->i], s); - if (hitinfo.pos.x == 0) - hitinfo.pos.x++; - zvel = ((g_player[j].ps->pos.z-srcvect.z) <<8) / hitinfo.pos.x; + hit.pos.x = ldist(&sprite[g_player[j].ps->i], s); + if (hit.pos.x == 0) + hit.pos.x++; + zvel = ((g_player[j].ps->pos.z-srcvect.z) <<8) / hit.pos.x; if (s->picnum != BOSS1) { zvel += 128-(krand()&255); @@ -1290,50 +1290,50 @@ DOSKIPBULLETHOLE: hitscan((const vec3_t *)&srcvect,sect, sintable[(sa+512)&2047], sintable[sa&2047], - zvel<<6,&hitinfo,CLIPMASK1); + zvel<<6,&hit,CLIPMASK1); s->cstat |= 257; - if (hitinfo.hitsect < 0) return -1; + if (hit.sect < 0) return -1; - if ((krand()&15) == 0 && sector[hitinfo.hitsect].lotag == 2) - A_DoWaterTracers(hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z, + if ((krand()&15) == 0 && sector[hit.sect].lotag == 2) + A_DoWaterTracers(hit.pos.x,hit.pos.y,hit.pos.z, srcvect.x,srcvect.y,srcvect.z,8-(ud.multimode>>1)); if (p >= 0) { - k = A_InsertSprite(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,SHOTSPARK1,-15,10,10,sa,0,0,i,4); + k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,SHOTSPARK1,-15,10,10,sa,0,0,i,4); sprite[k].extra = *actorscrptr[atwith]; sprite[k].extra += (krand()%6); sprite[k].yvel = atwith; // this is a hack to allow you to detect which weapon spawned a SHOTSPARK1 - actor[k].t_data[6] = hitinfo.hitwall; - actor[k].t_data[7] = hitinfo.hitsect; - actor[k].t_data[8] = hitinfo.hitsprite; + actor[k].t_data[6] = hit.wall; + actor[k].t_data[7] = hit.sect; + actor[k].t_data[8] = hit.sprite; - if (hitinfo.hitwall == -1 && hitinfo.hitsprite == -1) + if (hit.wall == -1 && hit.sprite == -1) { if (zvel < 0) { - if (sector[hitinfo.hitsect].ceilingstat&1) + if (sector[hit.sect].ceilingstat&1) { sprite[k].xrepeat = 0; sprite[k].yrepeat = 0; return -1; } else - Sect_DamageCeiling(hitinfo.hitsect); + Sect_DamageCeiling(hit.sect); } l = A_Spawn(k,SMALLSMOKE); - actor[l].t_data[6] = hitinfo.hitwall; - actor[l].t_data[7] = hitinfo.hitsect; - actor[l].t_data[8] = hitinfo.hitsprite; + actor[l].t_data[6] = hit.wall; + actor[l].t_data[7] = hit.sect; + actor[l].t_data[8] = hit.sprite; } - if (hitinfo.hitsprite >= 0) + if (hit.sprite >= 0) { - A_DamageObject(hitinfo.hitsprite,k); - if (sprite[hitinfo.hitsprite].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_PLAYERSFRIENDLY) && - GTFLAGS(GAMETYPE_TDM) && g_player[sprite[hitinfo.hitsprite].yvel].ps->team != g_player[sprite[i].yvel].ps->team))) + A_DamageObject(hit.sprite,k); + if (sprite[hit.sprite].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_PLAYERSFRIENDLY) && + GTFLAGS(GAMETYPE_TDM) && g_player[sprite[hit.sprite].yvel].ps->team != g_player[sprite[i].yvel].ps->team))) { l = A_Spawn(k,JIBS6); sprite[k].xrepeat = sprite[k].yrepeat = 0; @@ -1345,60 +1345,60 @@ DOSKIPBULLETHOLE: else { l = A_Spawn(k,SMALLSMOKE); - actor[l].t_data[6] = hitinfo.hitwall; - actor[l].t_data[7] = hitinfo.hitsect; - actor[l].t_data[8] = hitinfo.hitsprite; + actor[l].t_data[6] = hit.wall; + actor[l].t_data[7] = hit.sect; + actor[l].t_data[8] = hit.sprite; } if (p >= 0 && ( - sprite[hitinfo.hitsprite].picnum == DIPSWITCH || - sprite[hitinfo.hitsprite].picnum == DIPSWITCH+1 || - sprite[hitinfo.hitsprite].picnum == DIPSWITCH2 || - sprite[hitinfo.hitsprite].picnum == DIPSWITCH2+1 || - sprite[hitinfo.hitsprite].picnum == DIPSWITCH3 || - sprite[hitinfo.hitsprite].picnum == DIPSWITCH3+1 || - sprite[hitinfo.hitsprite].picnum == HANDSWITCH || - sprite[hitinfo.hitsprite].picnum == HANDSWITCH+1)) + sprite[hit.sprite].picnum == DIPSWITCH || + sprite[hit.sprite].picnum == DIPSWITCH+1 || + sprite[hit.sprite].picnum == DIPSWITCH2 || + sprite[hit.sprite].picnum == DIPSWITCH2+1 || + sprite[hit.sprite].picnum == DIPSWITCH3 || + sprite[hit.sprite].picnum == DIPSWITCH3+1 || + sprite[hit.sprite].picnum == HANDSWITCH || + sprite[hit.sprite].picnum == HANDSWITCH+1)) { - P_ActivateSwitch(p,hitinfo.hitsprite,1); + P_ActivateSwitch(p,hit.sprite,1); return -1; } } - else if (hitinfo.hitwall >= 0) + else if (hit.wall >= 0) { l = A_Spawn(k,SMALLSMOKE); - actor[l].t_data[6] = hitinfo.hitwall; - actor[l].t_data[7] = hitinfo.hitsect; - actor[l].t_data[8] = hitinfo.hitsprite; + actor[l].t_data[6] = hit.wall; + actor[l].t_data[7] = hit.sect; + actor[l].t_data[8] = hit.sprite; - if (CheckDoorTile(wall[hitinfo.hitwall].picnum) == 1) + if (CheckDoorTile(wall[hit.wall].picnum) == 1) goto SKIPBULLETHOLE; if (p >= 0 && ( - wall[hitinfo.hitwall].picnum == DIPSWITCH || - wall[hitinfo.hitwall].picnum == DIPSWITCH+1 || - wall[hitinfo.hitwall].picnum == DIPSWITCH2 || - wall[hitinfo.hitwall].picnum == DIPSWITCH2+1 || - wall[hitinfo.hitwall].picnum == DIPSWITCH3 || - wall[hitinfo.hitwall].picnum == DIPSWITCH3+1 || - wall[hitinfo.hitwall].picnum == HANDSWITCH || - wall[hitinfo.hitwall].picnum == HANDSWITCH+1)) + wall[hit.wall].picnum == DIPSWITCH || + wall[hit.wall].picnum == DIPSWITCH+1 || + wall[hit.wall].picnum == DIPSWITCH2 || + wall[hit.wall].picnum == DIPSWITCH2+1 || + wall[hit.wall].picnum == DIPSWITCH3 || + wall[hit.wall].picnum == DIPSWITCH3+1 || + wall[hit.wall].picnum == HANDSWITCH || + wall[hit.wall].picnum == HANDSWITCH+1)) { - P_ActivateSwitch(p,hitinfo.hitwall,0); + P_ActivateSwitch(p,hit.wall,0); return -1; } - if (wall[hitinfo.hitwall].hitag != 0 || (wall[hitinfo.hitwall].nextwall >= 0 && wall[wall[hitinfo.hitwall].nextwall].hitag != 0)) + if (wall[hit.wall].hitag != 0 || (wall[hit.wall].nextwall >= 0 && wall[wall[hit.wall].nextwall].hitag != 0)) goto SKIPBULLETHOLE; - if (hitinfo.hitsect >= 0 && sector[hitinfo.hitsect].lotag == 0) - if (wall[hitinfo.hitwall].overpicnum != BIGFORCE) - if ((wall[hitinfo.hitwall].nextsector >= 0 && sector[wall[hitinfo.hitwall].nextsector].lotag == 0) || - (wall[hitinfo.hitwall].nextsector == -1 && sector[hitinfo.hitsect].lotag == 0)) - if ((wall[hitinfo.hitwall].cstat&16) == 0) + if (hit.sect >= 0 && sector[hit.sect].lotag == 0) + if (wall[hit.wall].overpicnum != BIGFORCE) + if ((wall[hit.wall].nextsector >= 0 && sector[wall[hit.wall].nextsector].lotag == 0) || + (wall[hit.wall].nextsector == -1 && sector[hit.sect].lotag == 0)) + if ((wall[hit.wall].cstat&16) == 0) { - if (wall[hitinfo.hitwall].nextsector >= 0) + if (wall[hit.wall].nextsector >= 0) { - l = headspritesect[wall[hitinfo.hitwall].nextsector]; + l = headspritesect[wall[hit.wall].nextsector]; while (l >= 0) { if (sprite[l].statnum == 3 && sprite[l].lotag == 13) @@ -1421,12 +1421,12 @@ DOSKIPBULLETHOLE: actor[l].flags |= SPRITE_DECAL; sprite[l].xvel = -1; - sprite[l].x = hitinfo.pos.x; - sprite[l].y = hitinfo.pos.y; - sprite[l].z = hitinfo.pos.z; + sprite[l].x = hit.pos.x; + sprite[l].y = hit.pos.y; + sprite[l].z = hit.pos.z; - sprite[l].ang = getangle(wall[hitinfo.hitwall].x-wall[wall[hitinfo.hitwall].point2].x, - wall[hitinfo.hitwall].y-wall[wall[hitinfo.hitwall].point2].y)+512; + sprite[l].ang = getangle(wall[hit.wall].x-wall[wall[hit.wall].point2].x, + wall[hit.wall].y-wall[wall[hit.wall].point2].y)+512; sprite[l].x -= mulscale13(1,sintable[(sprite[l].ang+2560)&2047]); sprite[l].y -= mulscale13(1,sintable[(sprite[l].ang+2048)&2047]); @@ -1435,41 +1435,41 @@ DOSKIPBULLETHOLE: SKIPBULLETHOLE: - if (wall[hitinfo.hitwall].cstat&2) - if (wall[hitinfo.hitwall].nextsector >= 0) - if (hitinfo.pos.z >= (sector[wall[hitinfo.hitwall].nextsector].floorz)) - hitinfo.hitwall = wall[hitinfo.hitwall].nextwall; + if (wall[hit.wall].cstat&2) + if (wall[hit.wall].nextsector >= 0) + if (hit.pos.z >= (sector[wall[hit.wall].nextsector].floorz)) + hit.wall = wall[hit.wall].nextwall; - A_DamageWall(k,hitinfo.hitwall,&hitinfo.pos,SHOTSPARK1); + A_DamageWall(k,hit.wall,&hit.pos,SHOTSPARK1); } } else { - k = A_InsertSprite(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,SHOTSPARK1,-15,24,24,sa,0,0,i,4); + k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,SHOTSPARK1,-15,24,24,sa,0,0,i,4); sprite[k].extra = *actorscrptr[atwith]; sprite[k].yvel = atwith; // this is a hack to allow you to detect which weapon spawned a SHOTSPARK1 - actor[k].t_data[6] = hitinfo.hitwall; - actor[k].t_data[7] = hitinfo.hitsect; - actor[k].t_data[8] = hitinfo.hitsprite; + actor[k].t_data[6] = hit.wall; + actor[k].t_data[7] = hit.sect; + actor[k].t_data[8] = hit.sprite; - if (hitinfo.hitsprite >= 0) + if (hit.sprite >= 0) { - A_DamageObject(hitinfo.hitsprite,k); - if (sprite[hitinfo.hitsprite].picnum != APLAYER) + A_DamageObject(hit.sprite,k); + if (sprite[hit.sprite].picnum != APLAYER) { l = A_Spawn(k,SMALLSMOKE); - actor[l].t_data[6] = hitinfo.hitwall; - actor[l].t_data[7] = hitinfo.hitsect; - actor[l].t_data[8] = hitinfo.hitsprite; + actor[l].t_data[6] = hit.wall; + actor[l].t_data[7] = hit.sect; + actor[l].t_data[8] = hit.sprite; } else sprite[k].xrepeat = sprite[k].yrepeat = 0; } - else if (hitinfo.hitwall >= 0) - A_DamageWall(k,hitinfo.hitwall,&hitinfo.pos,SHOTSPARK1); + else if (hit.wall >= 0) + A_DamageWall(k,hit.wall,&hit.pos,SHOTSPARK1); } if ((krand()&255) < 4) - S_PlaySound3D(PISTOL_RICOCHET,k, &hitinfo.pos); + S_PlaySound3D(PISTOL_RICOCHET,k, &hit.pos); return -1; @@ -1510,9 +1510,9 @@ SKIPBULLETHOLE: if (j >= 0) { dal = ((sprite[j].yrepeat*tilesizy[sprite[j].picnum])<<1)-(12<<8); - hitinfo.pos.x = ldist(&sprite[ps->i], &sprite[j]); - if (hitinfo.pos.x == 0) hitinfo.pos.x++; - zvel = ((sprite[j].z-srcvect.z-dal)*vel) / hitinfo.pos.x; + hit.pos.x = ldist(&sprite[ps->i], &sprite[j]); + if (hit.pos.x == 0) hit.pos.x++; + zvel = ((sprite[j].z-srcvect.z-dal)*vel) / hit.pos.x; sa = getangle(sprite[j].x-srcvect.x,sprite[j].y-srcvect.y); } else @@ -1523,9 +1523,9 @@ SKIPBULLETHOLE: j = A_FindPlayer(s,&x); // sa = getangle(g_player[j].ps->opos.x-sx,g_player[j].ps->opos.y-sy); sa += 16-(krand()&31); - hitinfo.pos.x = ldist(&sprite[g_player[j].ps->i],s); - if (hitinfo.pos.x == 0) hitinfo.pos.x++; - zvel = ((g_player[j].ps->opos.z - srcvect.z + (3<<8))*vel) / hitinfo.pos.x; + hit.pos.x = ldist(&sprite[g_player[j].ps->i],s); + if (hit.pos.x == 0) hit.pos.x++; + zvel = ((g_player[j].ps->opos.z - srcvect.z + (3<<8))*vel) / hit.pos.x; } if (actor[i].shootzvel) zvel = actor[i].shootzvel; oldzvel = zvel; @@ -1600,9 +1600,9 @@ SKIPBULLETHOLE: if (j >= 0) { dal = ((sprite[j].yrepeat*tilesizy[sprite[j].picnum])<<1)+(8<<8); - hitinfo.pos.x = ldist(&sprite[ps->i], &sprite[j]); - if (hitinfo.pos.x == 0) hitinfo.pos.x++; - zvel = ((sprite[j].z-srcvect.z-dal)*vel) / hitinfo.pos.x; + hit.pos.x = ldist(&sprite[ps->i], &sprite[j]); + if (hit.pos.x == 0) hit.pos.x++; + zvel = ((sprite[j].z-srcvect.z-dal)*vel) / hit.pos.x; if (sprite[j].picnum != RECON) sa = getangle(sprite[j].x-srcvect.x,sprite[j].y-srcvect.y); } @@ -1728,28 +1728,28 @@ SKIPBULLETHOLE: hitscan((const vec3_t *)&srcvect,sect, sintable[(sa+512)&2047], sintable[sa&2047], - zvel<<6,&hitinfo,CLIPMASK1); + zvel<<6,&hit,CLIPMASK1); srcvect.z += g_player[p].ps->pyoff; j = 0; - if (hitinfo.hitsprite >= 0) break; + if (hit.sprite >= 0) break; - if (hitinfo.hitwall >= 0 && hitinfo.hitsect >= 0) - if (((hitinfo.pos.x-srcvect.x)*(hitinfo.pos.x-srcvect.x)+(hitinfo.pos.y-srcvect.y)*(hitinfo.pos.y-srcvect.y)) < (290*290)) + if (hit.wall >= 0 && hit.sect >= 0) + if (((hit.pos.x-srcvect.x)*(hit.pos.x-srcvect.x)+(hit.pos.y-srcvect.y)*(hit.pos.y-srcvect.y)) < (290*290)) { - if (wall[hitinfo.hitwall].nextsector >= 0) + if (wall[hit.wall].nextsector >= 0) { - if (sector[wall[hitinfo.hitwall].nextsector].lotag <= 2 && sector[hitinfo.hitsect].lotag <= 2) + if (sector[wall[hit.wall].nextsector].lotag <= 2 && sector[hit.sect].lotag <= 2) j = 1; } - else if (sector[hitinfo.hitsect].lotag <= 2) + else if (sector[hit.sect].lotag <= 2) j = 1; } if (j == 1) { int32_t lTripBombControl=Gv_GetVarByLabel("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, g_player[p].ps->i, p); - k = A_InsertSprite(hitinfo.hitsect,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,TRIPBOMB,-16,4,5,sa,0,0,i,6); + k = A_InsertSprite(hit.sect,hit.pos.x,hit.pos.y,hit.pos.z,TRIPBOMB,-16,4,5,sa,0,0,i,6); if (lTripBombControl & TRIPBOMB_TIMER) { int32_t lLifetime=Gv_GetVarByLabel("STICKYBOMB_LIFETIME", NAM_GRENADE_LIFETIME, g_player[p].ps->i, p); @@ -1767,7 +1767,7 @@ SKIPBULLETHOLE: sprite[k].xvel = -20; A_SetSprite(k,CLIPMASK0); sprite[k].cstat = 16; - actor[k].t_data[5] = sprite[k].ang = getangle(wall[hitinfo.hitwall].x-wall[wall[hitinfo.hitwall].point2].x,wall[hitinfo.hitwall].y-wall[wall[hitinfo.hitwall].point2].y)-512; + actor[k].t_data[5] = sprite[k].ang = getangle(wall[hit.wall].x-wall[wall[hit.wall].point2].x,wall[hit.wall].y-wall[wall[hit.wall].point2].y)-512; } @@ -1815,10 +1815,10 @@ SKIPBULLETHOLE: dal -= (8<<8); } - hitinfo.pos.x = ldist(&sprite[ps->i], &sprite[j]); - if (hitinfo.pos.x == 0) - hitinfo.pos.x++; - zvel = ((sprite[j].z-srcvect.z-dal)<<8) / hitinfo.pos.x; + hit.pos.x = ldist(&sprite[ps->i], &sprite[j]); + if (hit.pos.x == 0) + hit.pos.x++; + zvel = ((sprite[j].z-srcvect.z-dal)<<8) / hit.pos.x; sa = getangle(sprite[j].x-srcvect.x,sprite[j].y-srcvect.y); } else @@ -1834,10 +1834,10 @@ SKIPBULLETHOLE: { j = A_FindPlayer(s,&x); srcvect.z -= (4<<8); - hitinfo.pos.x = ldist(&sprite[g_player[j].ps->i], s); - if (hitinfo.pos.x == 0) - hitinfo.pos.x++; - zvel = ((g_player[j].ps->pos.z-srcvect.z) <<8) / hitinfo.pos.x; + hit.pos.x = ldist(&sprite[g_player[j].ps->i], s); + if (hit.pos.x == 0) + hit.pos.x++; + zvel = ((g_player[j].ps->pos.z-srcvect.z) <<8) / hit.pos.x; zvel += 128-(krand()&255); sa += 32-(krand()&63); } @@ -1852,34 +1852,34 @@ SKIPBULLETHOLE: hitscan((const vec3_t *)&srcvect,sect, sintable[(sa+512)&2047], sintable[sa&2047], - zvel<<6,&hitinfo,CLIPMASK1); + zvel<<6,&hit,CLIPMASK1); s->cstat |= 257; - j = A_InsertSprite(sect,hitinfo.pos.x,hitinfo.pos.y,hitinfo.pos.z,GROWSPARK,-16,28,28,sa,0,0,i,1); + j = A_InsertSprite(sect,hit.pos.x,hit.pos.y,hit.pos.z,GROWSPARK,-16,28,28,sa,0,0,i,1); sprite[j].pal = 2; sprite[j].cstat |= 130; sprite[j].xrepeat = sprite[j].yrepeat = 1; - if (hitinfo.hitwall == -1 && hitinfo.hitsprite == -1 && hitinfo.hitsect >= 0) + if (hit.wall == -1 && hit.sprite == -1 && hit.sect >= 0) { - if (zvel < 0 && (sector[hitinfo.hitsect].ceilingstat&1) == 0) - Sect_DamageCeiling(hitinfo.hitsect); + if (zvel < 0 && (sector[hit.sect].ceilingstat&1) == 0) + Sect_DamageCeiling(hit.sect); } - else if (hitinfo.hitsprite >= 0) A_DamageObject(hitinfo.hitsprite,j); - else if (hitinfo.hitwall >= 0 && wall[hitinfo.hitwall].picnum != ACCESSSWITCH && wall[hitinfo.hitwall].picnum != ACCESSSWITCH2) + else if (hit.sprite >= 0) A_DamageObject(hit.sprite,j); + else if (hit.wall >= 0 && wall[hit.wall].picnum != ACCESSSWITCH && wall[hit.wall].picnum != ACCESSSWITCH2) { - /* if(wall[hitinfo.hitwall].overpicnum == MIRROR && k == 0) + /* if(wall[hit.wall].overpicnum == MIRROR && k == 0) { l = getangle( - wall[wall[hitinfo.hitwall].point2].x-wall[hitinfo.hitwall].x, - wall[wall[hitinfo.hitwall].point2].y-wall[hitinfo.hitwall].y); + wall[wall[hit.wall].point2].x-wall[hit.wall].x, + wall[wall[hit.wall].point2].y-wall[hit.wall].y); - sx = hitinfo.pos.x; - sy = hitinfo.pos.y; - srcvect.z = hitinfo.pos.z; - sect = hitinfo.hitsect; + sx = hit.pos.x; + sy = hit.pos.y; + srcvect.z = hit.pos.z; + sect = hit.sect; sa = ((l<<1) - sa)&2047; sx += sintable[(sa+512)&2047]>>12; sy += sintable[sa&2047]>>12; @@ -1888,7 +1888,7 @@ SKIPBULLETHOLE: goto RESHOOTGROW; } else */ - A_DamageWall(j,hitinfo.hitwall,&hitinfo.pos,atwith); + A_DamageWall(j,hit.wall,&hit.pos,atwith); } break; @@ -1910,10 +1910,10 @@ SKIPBULLETHOLE: if (j >= 0) { dal = ((sprite[j].yrepeat*tilesizy[sprite[j].picnum])<<1); - hitinfo.pos.x = ldist(&sprite[ps->i], &sprite[j]); - if (hitinfo.pos.x == 0) - hitinfo.pos.x++; - zvel = ((sprite[j].z-srcvect.z-dal-(4<<8))*768) / hitinfo.pos.x; + hit.pos.x = ldist(&sprite[ps->i], &sprite[j]); + if (hit.pos.x == 0) + hit.pos.x++; + zvel = ((sprite[j].z-srcvect.z-dal-(4<<8))*768) / hit.pos.x; sa = getangle(sprite[j].x-srcvect.x,sprite[j].y-srcvect.y); } else zvel = (100-ps->horiz-ps->horizoff)*98; @@ -3973,39 +3973,39 @@ void P_ProcessWeapon(int32_t snum) case TRIPBOMB_WEAPON: if (p->ammo_amount[p->curr_weapon] > 0) { - hitdata_t hitinfo; + hitdata_t hit; hitscan((const vec3_t *)p, p->cursectnum, sintable[(p->ang+512)&2047], sintable[p->ang&2047], (100-p->horiz-p->horizoff)*32, - &hitinfo,CLIPMASK1); + &hit,CLIPMASK1); - if (hitinfo.hitsect < 0 || hitinfo.hitsprite >= 0) + if (hit.sect < 0 || hit.sprite >= 0) break; - if (hitinfo.hitwall >= 0 && sector[hitinfo.hitsect].lotag > 2) + if (hit.wall >= 0 && sector[hit.sect].lotag > 2) break; - if (hitinfo.hitwall >= 0 && wall[hitinfo.hitwall].overpicnum >= 0) - if (wall[hitinfo.hitwall].overpicnum == BIGFORCE) + if (hit.wall >= 0 && wall[hit.wall].overpicnum >= 0) + if (wall[hit.wall].overpicnum == BIGFORCE) break; - j = headspritesect[hitinfo.hitsect]; + j = headspritesect[hit.sect]; while (j >= 0) { if (sprite[j].picnum == TRIPBOMB && - klabs(sprite[j].z-hitinfo.pos.z) < (12<<8) && - ((sprite[j].x-hitinfo.pos.x)*(sprite[j].x-hitinfo.pos.x)+ - (sprite[j].y-hitinfo.pos.y)*(sprite[j].y-hitinfo.pos.y)) < (290*290)) + klabs(sprite[j].z-hit.pos.z) < (12<<8) && + ((sprite[j].x-hit.pos.x)*(sprite[j].x-hit.pos.x)+ + (sprite[j].y-hit.pos.y)*(sprite[j].y-hit.pos.y)) < (290*290)) break; j = nextspritesect[j]; } - if (j == -1 && hitinfo.hitwall >= 0 && (wall[hitinfo.hitwall].cstat&16) == 0) - if ((wall[hitinfo.hitwall].nextsector >= 0 && - sector[wall[hitinfo.hitwall].nextsector].lotag <= 2) || - (wall[hitinfo.hitwall].nextsector == -1 && sector[hitinfo.hitsect].lotag <= 2)) - if (((hitinfo.pos.x-p->pos.x)*(hitinfo.pos.x-p->pos.x) + - (hitinfo.pos.y-p->pos.y)*(hitinfo.pos.y-p->pos.y)) < (290*290)) + if (j == -1 && hit.wall >= 0 && (wall[hit.wall].cstat&16) == 0) + if ((wall[hit.wall].nextsector >= 0 && + sector[wall[hit.wall].nextsector].lotag <= 2) || + (wall[hit.wall].nextsector == -1 && sector[hit.sect].lotag <= 2)) + if (((hit.pos.x-p->pos.x)*(hit.pos.x-p->pos.x) + + (hit.pos.y-p->pos.y)*(hit.pos.y-p->pos.y)) < (290*290)) { p->pos.z = p->opos.z; p->vel.z = 0; @@ -5590,7 +5590,7 @@ void computergetinput(int32_t snum, input_t *syn) int32_t i, j, k, l, x1, y1, z1, x2, y2, z2, x3, y3, z3, dx, dy; int32_t dist, daang, zang, fightdist, damyang, damysect; int32_t startsect, endsect, splc, send, startwall, endwall; - hitdata_t hitinfo; + hitdata_t hit; DukePlayer_t *p = g_player[snum].ps; walltype *wal; @@ -5706,10 +5706,10 @@ void computergetinput(int32_t snum, input_t *syn) mulscale14(sprite[j].xvel,sintable[(sprite[j].ang+512)&2047]), mulscale14(sprite[j].xvel,sintable[sprite[j].ang&2047]), (int32_t)sprite[j].zvel, - &hitinfo,CLIPMASK1); - x3 = hitinfo.pos.x; - y3 = hitinfo.pos.y; - z3 = hitinfo.pos.z; + &hit,CLIPMASK1); + x3 = hit.pos.x; + y3 = hit.pos.y; + z3 = hit.pos.z; } } } @@ -5735,10 +5735,10 @@ void computergetinput(int32_t snum, input_t *syn) vect.y = y1; vect.z = z1-PHEIGHT; hitscan((const vec3_t *)&vect,damysect,sintable[(damyang+512)&2047],sintable[damyang&2047], - (100-p->horiz-p->horizoff)*32,&hitinfo,CLIPMASK1); - x3 = hitinfo.pos.x; - y3 = hitinfo.pos.y; - z3 = hitinfo.pos.z; + (100-p->horiz-p->horizoff)*32,&hit,CLIPMASK1); + x3 = hit.pos.x; + y3 = hit.pos.y; + z3 = hit.pos.z; if ((x3-x1)*(x3-x1)+(y3-y1)*(y3-y1) < 2560*2560) syn->bits &= ~BIT(SK_FIRE); } diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index c6c1f63ff..c40bcd927 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -2975,7 +2975,7 @@ CHECKINV1: int32_t A_CheckHitSprite(int32_t i, int16_t *hitsp) { - hitdata_t hitinfo; + hitdata_t hit; int32_t zoff = 0; if (A_CheckEnemySprite(&sprite[i])) @@ -2986,31 +2986,31 @@ int32_t A_CheckHitSprite(int32_t i, int16_t *hitsp) hitscan((const vec3_t *)&sprite[i],SECT, sintable[(SA+512)&2047], sintable[SA&2047], - 0,&hitinfo,CLIPMASK1); + 0,&hit,CLIPMASK1); SZ += zoff; - *hitsp = hitinfo.hitsprite; + *hitsp = hit.sprite; - if (hitinfo.hitwall >= 0 && (wall[hitinfo.hitwall].cstat&16) && A_CheckEnemySprite(&sprite[i])) + if (hit.wall >= 0 && (wall[hit.wall].cstat&16) && A_CheckEnemySprite(&sprite[i])) return((1<<30)); - return (FindDistance2D(hitinfo.pos.x-SX,hitinfo.pos.y-SY)); + return (FindDistance2D(hit.pos.x-SX,hit.pos.y-SY)); } static int32_t P_FindWall(DukePlayer_t *p,int16_t *hitw) { - hitdata_t hitinfo; + hitdata_t hit; hitscan((const vec3_t *)p,p->cursectnum, sintable[(p->ang+512)&2047], sintable[p->ang&2047], - 0,&hitinfo,CLIPMASK0); + 0,&hit,CLIPMASK0); - *hitw = hitinfo.hitwall; - if (hitinfo.hitwall < 0) + *hitw = hit.wall; + if (hit.wall < 0) return INT32_MAX; - return (FindDistance2D(hitinfo.pos.x-p->pos.x,hitinfo.pos.y-p->pos.y)); + return (FindDistance2D(hit.pos.x-p->pos.x,hit.pos.y-p->pos.y)); } // returns 1 if sprite i should not be considered by neartag