From 4d89c076f36c3fd5d6c7a787d629d6943edd63cf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 7 May 2020 10:28:31 +0200 Subject: [PATCH] - removed old movestandables version. --- source/games/duke/src/actors.cpp | 2 + source/games/duke/src/actors_e.cpp | 1020 ---------------------------- source/games/duke/src/net.cpp | 2 - source/games/duke/src/player.h | 4 +- source/games/duke/src/premap.cpp | 3 - 5 files changed, 4 insertions(+), 1027 deletions(-) diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 58623d8b9..c3fe15e1e 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -1414,6 +1414,8 @@ void moveplayers(void) //Players execute(i, s->yvel, otherx); + p->oq16ang = p->q16ang; + if (ud.multimode > 1) if (sprite[ps[otherp].i].extra > 0) { diff --git a/source/games/duke/src/actors_e.cpp b/source/games/duke/src/actors_e.cpp index 8e296fb3f..0e45c4201 100644 --- a/source/games/duke/src/actors_e.cpp +++ b/source/games/duke/src/actors_e.cpp @@ -375,1031 +375,11 @@ static int P_Submerge(int, int, DukePlayer_t *, int, int); static int P_Emerge(int, int, DukePlayer_t *, int, int); static void P_FinishWaterChange(int, DukePlayer_t *, int, int, int); -static fix16_t P_GetQ16AngleDeltaForTic(DukePlayer_t const *pPlayer) -{ - auto oldAngle = pPlayer->oq16ang; - auto newAngle = pPlayer->q16ang; - - if (klabs(fix16_sub(oldAngle, newAngle)) < F16(1024)) - return fix16_sub(newAngle, oldAngle); - - if (newAngle > F16(1024)) - newAngle = fix16_sub(newAngle, F16(2048)); - - if (oldAngle > F16(1024)) - oldAngle = fix16_sub(oldAngle, F16(2048)); - - return fix16_sub(newAngle, oldAngle); -} - void moveplayers(); void movefx(); void movefallers(); void movestandables(); -ACTOR_STATIC void G_MoveStandables(void) -{ - int spriteNum = headspritestat[STAT_STANDABLE], j, switchPic; - - while (spriteNum >= 0) - { - const int nextSprite = nextspritestat[spriteNum]; - int32_t *const pData = &actor[spriteNum].t_data[0]; - spritetype *const pSprite = &sprite[spriteNum]; - const int sectNum = pSprite->sectnum; - - if (sectNum < 0) - DELETE_SPRITE_AND_CONTINUE(spriteNum); - - Bmemcpy(&actor[spriteNum].bpos, pSprite, sizeof(vec3_t)); - - if (PN(spriteNum) >= TILE_CRANE && PN(spriteNum) <= TILE_CRANE+3) - { - int32_t nextj; - - //t[0] = state - //t[1] = checking sector number - - if (pSprite->xvel) A_GetZLimits(spriteNum); - - if (pData[0] == 0) //Waiting to check the sector - { - for (SPRITES_OF_SECT_SAFE(pData[1], j, nextj)) - { - switch (sprite[j].statnum) - { - case STAT_ACTOR: - case STAT_ZOMBIEACTOR: - case STAT_STANDABLE: - case STAT_PLAYER: - { - vec3_t vect = { g_origins[pData[4]+1].x, g_origins[pData[4]+1].y, sprite[j].z }; - - pSprite->ang = getangle(vect.x-pSprite->x, vect.y-pSprite->y); - setsprite(j, &vect); - pData[0]++; - goto next_sprite; - } - } - } - } - - else if (pData[0]==1) - { - if (pSprite->xvel < 184) - { - pSprite->picnum = TILE_CRANE+1; - pSprite->xvel += 8; - } - A_SetSprite(spriteNum,CLIPMASK0); - if (sectNum == pData[1]) - pData[0]++; - } - else if (pData[0]==2 || pData[0]==7) - { - pSprite->z += (1024+512); - - if (pData[0]==2) - { - if (sector[sectNum].floorz - pSprite->z < (64<<8)) - if (pSprite->picnum > TILE_CRANE) pSprite->picnum--; - - if (sector[sectNum].floorz - pSprite->z < 4096+1024) - pData[0]++; - } - - if (pData[0]==7) - { - if (sector[sectNum].floorz - pSprite->z < (64<<8)) - { - if (pSprite->picnum > TILE_CRANE) pSprite->picnum--; - else - { - if (pSprite->owner==-2) - { - int32_t p = A_FindPlayer(pSprite, NULL); - A_PlaySound(RR ? 390 : DUKE_GRUNT,g_player[p].ps->i); - if (g_player[p].ps->on_crane == spriteNum) - g_player[p].ps->on_crane = -1; - } - - pData[0]++; - pSprite->owner = -1; - } - } - } - } - else if (pData[0]==3) - { - pSprite->picnum++; - if (pSprite->picnum == TILE_CRANE+2) - { - int32_t p = G_CheckPlayerInSector(pData[1]); - - if (p >= 0 && g_player[p].ps->on_ground) - { - pSprite->owner = -2; - g_player[p].ps->on_crane = spriteNum; - A_PlaySound(RR ? 390 : DUKE_GRUNT,g_player[p].ps->i); - g_player[p].ps->q16ang = fix16_from_int(pSprite->ang+1024); - } - else - { - for (SPRITES_OF_SECT(pData[1], j)) - { - switch (sprite[j].statnum) - { - case STAT_ACTOR: - case STAT_STANDABLE: - pSprite->owner = j; - break; - } - } - } - - pData[0]++;//Grabbed the sprite - pData[2]=0; - goto next_sprite; - } - } - else if (pData[0]==4) //Delay before going up - { - pData[2]++; - if (pData[2] > 10) - pData[0]++; - } - else if (pData[0]==5 || pData[0] == 8) - { - if (pData[0]==8 && pSprite->picnum < (TILE_CRANE+2)) - if ((sector[sectNum].floorz-pSprite->z) > 8192) - pSprite->picnum++; - - if (pSprite->z < g_origins[pData[4]+2].x) - { - pData[0]++; - pSprite->xvel = 0; - } - else - pSprite->z -= (1024+512); - } - else if (pData[0]==6) - { - if (pSprite->xvel < 192) - pSprite->xvel += 8; - pSprite->ang = getangle(g_origins[pData[4]].x - pSprite->x, g_origins[pData[4]].y - pSprite->y); - A_SetSprite(spriteNum,CLIPMASK0); - if (((pSprite->x-g_origins[pData[4]].x)*(pSprite->x-g_origins[pData[4]].x)+(pSprite->y-g_origins[pData[4]].y)*(pSprite->y-g_origins[pData[4]].y)) < (128*128)) - pData[0]++; - } - - else if (pData[0]==9) - pData[0] = 0; - - { - vec3_t vect; - Bmemcpy(&vect,pSprite,sizeof(vec3_t)); - vect.z -= (34<<8); - setsprite(g_origins[pData[4]+2].y, &vect); - } - - - if (pSprite->owner != -1) - { - int32_t p = A_FindPlayer(pSprite, NULL); - - if (A_IncurDamage(spriteNum) >= 0) - { - if (pSprite->owner == -2) - if (g_player[p].ps->on_crane == spriteNum) - g_player[p].ps->on_crane = -1; - pSprite->owner = -1; - pSprite->picnum = TILE_CRANE; - goto next_sprite; - } - - if (pSprite->owner >= 0) - { - setsprite(pSprite->owner,(vec3_t *)pSprite); - - Bmemcpy(&actor[pSprite->owner].bpos, pSprite, sizeof(vec3_t)); - - pSprite->zvel = 0; - } - else if (pSprite->owner == -2) - { - DukePlayer_t *const ps = g_player[p].ps; - - ps->opos.x = ps->pos.x = pSprite->x-(sintable[(fix16_to_int(ps->q16ang)+512)&2047]>>6); - ps->opos.y = ps->pos.y = pSprite->y-(sintable[fix16_to_int(ps->q16ang)&2047]>>6); - ps->opos.z = ps->pos.z = pSprite->z+(2<<8); - - setsprite(ps->i, (vec3_t *)ps); - ps->cursectnum = sprite[ps->i].sectnum; - } - } - - goto next_sprite; - } - else if (PN(spriteNum) >= TILE_WATERFOUNTAIN && PN(spriteNum) <= TILE_WATERFOUNTAIN+3) - { - if (pData[0] > 0) - { - if (pData[0] < 20) - { - pData[0]++; - - pSprite->picnum++; - - if (pSprite->picnum == (TILE_WATERFOUNTAIN+3)) - pSprite->picnum = TILE_WATERFOUNTAIN+1; - } - else - { - int32_t playerDist; - - A_FindPlayer(pSprite,&playerDist); - - if (playerDist > 512) - { - pData[0] = 0; - pSprite->picnum = TILE_WATERFOUNTAIN; - } - else pData[0] = 1; - } - } - goto next_sprite; - } - else if (AFLAMABLE(pSprite->picnum)) - { - if (T1(spriteNum) == 1) - { - if ((++T2(spriteNum)&3) > 0) goto next_sprite; - - if (pSprite->picnum == TILE_TIRE && T2(spriteNum) == 32) - { - pSprite->cstat = 0; - j = A_Spawn(spriteNum,TILE_BLOODPOOL); - sprite[j].shade = 127; - } - else - { - if (pSprite->shade < 64) pSprite->shade++; - else DELETE_SPRITE_AND_CONTINUE(spriteNum); - } - - j = pSprite->xrepeat-(krand2()&7); - if (j < 10) - DELETE_SPRITE_AND_CONTINUE(spriteNum); - - pSprite->xrepeat = j; - - j = pSprite->yrepeat-(krand2()&7); - if (j < 4) - DELETE_SPRITE_AND_CONTINUE(spriteNum); - - pSprite->yrepeat = j; - } - if (!RR && pSprite->picnum == TILE_BOX) - { - A_Fall(spriteNum); - actor[spriteNum].ceilingz = sector[pSprite->sectnum].ceilingz; - } - goto next_sprite; - } - else if (!RR && pSprite->picnum == TILE_TRIPBOMB) - { - int const tripBombMode = Gv_GetVarByLabel("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, -1, -1); - if(tripBombMode & TRIPBOMB_TIMER) - { - // we're on a timer.... - if (pSprite->extra >= 0) - { - pSprite->extra--; - if (pSprite->extra == 0) - { - T3(spriteNum) = 16; - A_PlaySound(LASERTRIP_ARMING,spriteNum); - } - } - } - if (T3(spriteNum) > 0) - { - T3(spriteNum)--; - - if (T3(spriteNum) == 8) - { - for (j=0; j<5; j++) - RANDOMSCRAP(pSprite, spriteNum); - - int const dmg = pSprite->extra; - A_RadiusDamage(spriteNum, g_tripbombRadius, dmg>>2, dmg>>1, dmg-(dmg>>2), dmg); - - j = A_Spawn(spriteNum,TILE_EXPLOSION2); - A_PlaySound(LASERTRIP_EXPLODE,j); - sprite[j].ang = pSprite->ang; - sprite[j].xvel = 348; - A_SetSprite(j,CLIPMASK0); - - for (SPRITES_OF(STAT_MISC, j)) - { - if (sprite[j].picnum == TILE_LASERLINE && pSprite->hitag == sprite[j].hitag) - sprite[j].xrepeat = sprite[j].yrepeat = 0; - } - - DELETE_SPRITE_AND_CONTINUE(spriteNum); - } - goto next_sprite; - } - else - { - int const oldExtra = pSprite->extra; - int const oldAng = pSprite->ang; - - pSprite->extra = 1; - if (A_IncurDamage(spriteNum) >= 0) - { - T3(spriteNum) = 16; - } - pSprite->extra = oldExtra; - pSprite->ang = oldAng; - } - - if (T1(spriteNum) < 32) - { - int32_t playerDist; - A_FindPlayer(pSprite, &playerDist); - if (playerDist > 768 || T1(spriteNum) > 16) T1(spriteNum)++; - } - - if (T1(spriteNum) == 32) - { - int16_t hitSprite; - int const oldAng = pSprite->ang; - - pSprite->ang = T6(spriteNum); - - T4(spriteNum) = pSprite->x; - T5(spriteNum) = pSprite->y; - - pSprite->x += sintable[(T6(spriteNum)+512)&2047]>>9; - pSprite->y += sintable[(T6(spriteNum))&2047]>>9; - pSprite->z -= (3<<8); - - setsprite(spriteNum,(vec3_t *)pSprite); - - int hitDist = A_CheckHitSprite(spriteNum, &hitSprite); - - actor[spriteNum].lastv.x = hitDist; - pSprite->ang = oldAng; - - if (tripBombMode & TRIPBOMB_TRIPWIRE) - { - // we're on a trip wire - //int16_t cursectnum; - - while (hitDist > 0) - { - j = A_Spawn(spriteNum,TILE_LASERLINE); - setsprite(j,(vec3_t *)&sprite[j]); - sprite[j].hitag = pSprite->hitag; - actor[j].t_data[1] = sprite[j].z; - - pSprite->x += sintable[(T6(spriteNum)+512)&2047]>>4; - pSprite->y += sintable[(T6(spriteNum))&2047]>>4; - - if (hitDist < 1024) - { - sprite[j].xrepeat = hitDist>>5; - break; - } - hitDist -= 1024; - - //cursectnum = pSprite->sectnum; - //updatesector(pSprite->x, pSprite->y, &cursectnum); - //if (cursectnum < 0) - // break; - } - } - - T1(spriteNum)++; - - pSprite->x = T4(spriteNum); - pSprite->y = T5(spriteNum); - pSprite->z += (3<<8); - - setsprite(spriteNum,(vec3_t *)pSprite); - T4(spriteNum) = T3(spriteNum) = 0; - - if (hitSprite >= 0 && (tripBombMode & TRIPBOMB_TRIPWIRE)) - { - T3(spriteNum) = 13; - A_PlaySound(LASERTRIP_ARMING,spriteNum); - } - } - - if (T1(spriteNum) == 33) - { - T2(spriteNum)++; - - T4(spriteNum) = pSprite->x; - T5(spriteNum) = pSprite->y; - - pSprite->x += sintable[(T6(spriteNum)+512)&2047]>>9; - pSprite->y += sintable[(T6(spriteNum))&2047]>>9; - pSprite->z -= (3<<8); - - setsprite(spriteNum, (vec3_t *) pSprite); - - int hitDist = A_CheckHitSprite(spriteNum, NULL); - - pSprite->x = T4(spriteNum); - pSprite->y = T5(spriteNum); - pSprite->z += (3<<8); - setsprite(spriteNum, (vec3_t *) pSprite); - - // if( Actor[i].lastvx != x && lTripBombControl & TRIPBOMB_TRIPWIRE) - if (actor[spriteNum].lastv.x != hitDist && (tripBombMode & TRIPBOMB_TRIPWIRE)) - { - T3(spriteNum) = 13; - A_PlaySound(LASERTRIP_ARMING, spriteNum); - } - } - - goto next_sprite; - } - else if (pSprite->picnum >= TILE_CRACK1 && pSprite->picnum <= TILE_CRACK4) - { - if (pSprite->hitag) - { - pData[0] = pSprite->cstat; - pData[1] = pSprite->ang; - - int const dmgTile = A_IncurDamage(spriteNum); - - if (dmgTile < 0) - goto crack_default; - - switch (DYNAMICTILEMAP(dmgTile)) - { - case RPG2__STATICRR: - if (!RRRA) goto crack_default; - fallthrough__; - case FIREEXT__STATIC: - if (RR) goto crack_default; - fallthrough__; - case RPG__STATIC: - case RADIUSEXPLOSION__STATIC: - case SEENINE__STATIC: - case OOZFILTER__STATIC: - for (SPRITES_OF(STAT_STANDABLE, j)) - { - if (pSprite->hitag == sprite[j].hitag && - (sprite[j].picnum == TILE_OOZFILTER || sprite[j].picnum == TILE_SEENINE)) - if (sprite[j].shade != -32) - sprite[j].shade = -32; - } - - goto DETONATE; - -crack_default: - default: - pSprite->cstat = pData[0]; - pSprite->ang = pData[1]; - pSprite->extra = 0; - - goto next_sprite; - } - } - goto next_sprite; - } - else if (!RR && pSprite->picnum == TILE_FIREEXT) - { - if (A_IncurDamage(spriteNum) < 0) - goto next_sprite; - - for (bsize_t k=0; k<16; k++) - { - int32_t const r1 = krand2(), r2 = krand2(), r3 = krand2(), r4 = krand2(), r5 = krand2(); - j = A_InsertSprite(SECT(spriteNum), SX(spriteNum), SY(spriteNum), SZ(spriteNum) - (r5 % (48 << 8)), - TILE_SCRAP3 + (r4 & 3), -8, 48, 48, r3 & 2047, (r2 & 63) + 64, - -(r1 & 4095) - (sprite[spriteNum].zvel >> 2), spriteNum, 5); - - sprite[j].pal = 2; - } - - j = A_Spawn(spriteNum,TILE_EXPLOSION2); - A_PlaySound(PIPEBOMB_EXPLODE,j); - A_PlaySound(GLASS_HEAVYBREAK,j); - - if ((int16_t)pSprite->hitag > 0) - { - for (SPRITES_OF(STAT_STANDABLE, j)) - { - // XXX: This block seems to be CODEDUP'd a lot of times. - if (pSprite->hitag == sprite[j].hitag && (sprite[j].picnum == TILE_OOZFILTER || sprite[j].picnum == TILE_SEENINE)) - if (sprite[j].shade != -32) - sprite[j].shade = -32; - } - - int const dmg = pSprite->extra; - A_RadiusDamage(spriteNum, g_pipebombRadius,dmg>>2, dmg-(dmg>>1),dmg-(dmg>>2), dmg); - j = A_Spawn(spriteNum,TILE_EXPLOSION2); - A_PlaySound(PIPEBOMB_EXPLODE,j); - - goto DETONATE; - } - else - { - A_RadiusDamage(spriteNum,g_seenineRadius,10,15,20,25); - DELETE_SPRITE_AND_CONTINUE(spriteNum); - } - goto next_sprite; - } - else if (pSprite->picnum == TILE_OOZFILTER || pSprite->picnum == TILE_SEENINE || pSprite->picnum == TILE_SEENINEDEAD || pSprite->picnum == TILE_SEENINEDEAD+1) - { - if (pSprite->shade != -32 && pSprite->shade != -33) - { - if (pSprite->xrepeat) - j = (A_IncurDamage(spriteNum) >= 0); - else - j = 0; - - if (j || pSprite->shade == -31) - { - if (j) pSprite->lotag = 0; - - pData[3] = 1; - - for (SPRITES_OF(STAT_STANDABLE, j)) - { - if (pSprite->hitag == sprite[j].hitag && (sprite[j].picnum == TILE_SEENINE || sprite[j].picnum == TILE_OOZFILTER)) - sprite[j].shade = -32; - } - } - } - else - { - if (pSprite->shade == -32) - { - if ((int16_t)pSprite->lotag > 0) - { - pSprite->lotag -= 3; - if ((int16_t)pSprite->lotag <= 0) - pSprite->lotag = -99; - } - else - pSprite->shade = -33; - } - else - { - if (pSprite->xrepeat > 0) - { - T3(spriteNum)++; - if (T3(spriteNum) == 3) - { - if (pSprite->picnum == TILE_OOZFILTER) - { - T3(spriteNum) = 0; - goto DETONATE; - } - - if (pSprite->picnum != (TILE_SEENINEDEAD+1)) - { - T3(spriteNum) = 0; - - if (pSprite->picnum == TILE_SEENINEDEAD) - pSprite->picnum++; - else if (pSprite->picnum == TILE_SEENINE) - pSprite->picnum = TILE_SEENINEDEAD; - } - else goto DETONATE; - } - goto next_sprite; - } - -DETONATE: - g_earthquakeTime = 16; - - for (SPRITES_OF(STAT_EFFECTOR, j)) - { - if (pSprite->hitag == sprite[j].hitag) - { - if (sprite[j].lotag == SE_13_EXPLOSIVE) - { - if (actor[j].t_data[2] == 0) - actor[j].t_data[2] = 1; - } - else if (sprite[j].lotag == SE_8_UP_OPEN_DOOR_LIGHTS) - actor[j].t_data[4] = 1; - else if (sprite[j].lotag == SE_18_INCREMENTAL_SECTOR_RISE_FALL) - { - if (actor[j].t_data[0] == 0) - actor[j].t_data[0] = 1; - } - else if (sprite[j].lotag == SE_21_DROP_FLOOR) - actor[j].t_data[0] = 1; - } - } - - pSprite->z -= ZOFFSET5; - - if ((pData[3] == 1 && pSprite->xrepeat) || (int16_t)pSprite->lotag == -99) - { - int const newSprite = A_Spawn(spriteNum,TILE_EXPLOSION2); - int const dmg = pSprite->extra; - - A_RadiusDamage(spriteNum,g_seenineRadius,dmg>>2, dmg-(dmg>>1),dmg-(dmg>>2), dmg); - A_PlaySound(PIPEBOMB_EXPLODE, newSprite); - } - - if (pSprite->xrepeat) - for (bsize_t x=0; x<8; x++) - RANDOMSCRAP(pSprite, spriteNum); - - DELETE_SPRITE_AND_CONTINUE(spriteNum); - } - } - goto next_sprite; - } - else if (pSprite->picnum == TILE_MASTERSWITCH) - { - if (pSprite->yvel == 1) - { - if ((int16_t)--pSprite->hitag <= 0) - { - G_OperateSectors(sectNum,spriteNum); - - for (SPRITES_OF_SECT(sectNum, j)) - { - if (sprite[j].statnum == STAT_EFFECTOR) - { - switch (sprite[j].lotag) - { - case SE_2_EARTHQUAKE: - case SE_21_DROP_FLOOR: - case SE_31_FLOOR_RISE_FALL: - case SE_32_CEILING_RISE_FALL: - case SE_36_PROJ_SHOOTER: - actor[j].t_data[0] = 1; - break; - case SE_3_RANDOM_LIGHTS_AFTER_SHOT_OUT: - actor[j].t_data[4] = 1; - break; - } - } - else if (sprite[j].statnum == STAT_STANDABLE) - { - switch (DYNAMICTILEMAP(sprite[j].picnum)) - { - case SEENINE__STATIC: - case OOZFILTER__STATIC: - sprite[j].shade = -31; - break; - } - } - } - - DELETE_SPRITE_AND_CONTINUE(spriteNum); - } - } - goto next_sprite; - } - else - { - switchPic = pSprite->picnum; - - if (!RR && switchPic > TILE_SIDEBOLT1 && switchPic <= TILE_SIDEBOLT1 + 3) - switchPic = TILE_SIDEBOLT1; - else if (switchPic > TILE_BOLT1 && switchPic <= TILE_BOLT1 + 3) - switchPic = TILE_BOLT1; - switch (DYNAMICTILEMAP(switchPic)) - { - case VIEWSCREEN__STATIC: - case VIEWSCREEN2__STATIC: - if (RR) goto next_sprite; - - if (pSprite->xrepeat == 0) - DELETE_SPRITE_AND_CONTINUE(spriteNum); - - { - int32_t playerDist; - int const p = A_FindPlayer(pSprite, &playerDist); - const DukePlayer_t *const ps = g_player[p].ps; - - if (dist(&sprite[ps->i], pSprite) < VIEWSCREEN_ACTIVE_DISTANCE) - { -#if 0 - if (sprite[i].yvel == 1) // VIEWSCREEN_YVEL - g_curViewscreen = i; -#endif - } - else if (g_curViewscreen == spriteNum /*&& T1 == 1*/) - { - g_curViewscreen = -1; - sprite[spriteNum].yvel = 0; // VIEWSCREEN_YVEL - T1(spriteNum) = 0; - } - } - - goto next_sprite; - case TRASH__STATIC: - - if (pSprite->xvel == 0) - pSprite->xvel = 1; - if (A_SetSprite(spriteNum, CLIPMASK0)) - { - A_Fall(spriteNum); - if (krand2() & 1) - pSprite->zvel -= 256; - if ((pSprite->xvel) < 48) - pSprite->xvel += (krand2() & 3); - } - else - DELETE_SPRITE_AND_CONTINUE(spriteNum); - break; - - case SIDEBOLT1__STATIC: - // case TILE_SIDEBOLT1+1: - // case TILE_SIDEBOLT1+2: - // case TILE_SIDEBOLT1+3: - { - if (RR) goto next_sprite; - int32_t playerDist; - A_FindPlayer(pSprite, &playerDist); - if (playerDist > 20480) - goto next_sprite; - - CLEAR_THE_BOLT2: - if (pData[2]) - { - pData[2]--; - goto next_sprite; - } - if ((pSprite->xrepeat | pSprite->yrepeat) == 0) - { - pSprite->xrepeat = pData[0]; - pSprite->yrepeat = pData[1]; - } - if ((krand2() & 8) == 0) - { - pData[0] = pSprite->xrepeat; - pData[1] = pSprite->yrepeat; - pData[2] = g_globalRandom & 4; - pSprite->xrepeat = pSprite->yrepeat = 0; - goto CLEAR_THE_BOLT2; - } - pSprite->picnum++; - -#if 0 - // NOTE: Um, this 'l' was assigned to last at the beginning of this function. - // TILE_SIDEBOLT1 never gets translucent as a consequence, unlike TILE_BOLT1. - if (randomRepeat & 1) - pSprite->cstat ^= 2; -#endif - - if ((krand2() & 1) && sector[sectNum].floorpicnum == TILE_HURTRAIL) - A_PlaySound(SHORT_CIRCUIT, spriteNum); - - if (pSprite->picnum == TILE_SIDEBOLT1 + 4) - pSprite->picnum = TILE_SIDEBOLT1; - - goto next_sprite; - } - - case BOLT1__STATIC: - // case TILE_BOLT1+1: - // case TILE_BOLT1+2: - // case TILE_BOLT1+3: - { - int32_t playerDist; - A_FindPlayer(pSprite, &playerDist); - if (playerDist > 20480) - goto next_sprite; - - if (pData[3] == 0) - pData[3] = sector[sectNum].floorshade; - - CLEAR_THE_BOLT: - if (pData[2]) - { - pData[2]--; - sector[sectNum].floorshade = 20; - sector[sectNum].ceilingshade = 20; - goto next_sprite; - } - if ((pSprite->xrepeat | pSprite->yrepeat) == 0) - { - pSprite->xrepeat = pData[0]; - pSprite->yrepeat = pData[1]; - } - else if ((krand2() & 8) == 0) - { - pData[0] = pSprite->xrepeat; - pData[1] = pSprite->yrepeat; - pData[2] = g_globalRandom & 4; - pSprite->xrepeat = pSprite->yrepeat = 0; - goto CLEAR_THE_BOLT; - } - pSprite->picnum++; - - int const randomRepeat = g_globalRandom & 7; - pSprite->xrepeat = randomRepeat + 8; - - if (randomRepeat & 1) - pSprite->cstat ^= 2; - - if (pSprite->picnum == (TILE_BOLT1 + 1) - && (RR ? (krand2() & 1) != 0 : (krand2() & 7) == 0) && sector[sectNum].floorpicnum == TILE_HURTRAIL) - A_PlaySound(SHORT_CIRCUIT, spriteNum); - - if (pSprite->picnum == TILE_BOLT1 + 4) - pSprite->picnum = TILE_BOLT1; - - if (pSprite->picnum & 1) - { - sector[sectNum].floorshade = 0; - sector[sectNum].ceilingshade = 0; - } - else - { - sector[sectNum].floorshade = 20; - sector[sectNum].ceilingshade = 20; - } - goto next_sprite; - } - - case WATERDRIP__STATIC: - - if (pData[1]) - { - if (--pData[1] == 0) - pSprite->cstat &= 32767; - } - else - { - A_Fall(spriteNum); - A_SetSprite(spriteNum, CLIPMASK0); - if (pSprite->xvel > 0) - pSprite->xvel -= 2; - - if (pSprite->zvel == 0) - { - pSprite->cstat |= 32768; - - if (pSprite->pal != 2 && (RR || pSprite->hitag == 0)) - A_PlaySound(SOMETHING_DRIPPING, spriteNum); - - if (sprite[pSprite->owner].picnum != TILE_WATERDRIP) - { - DELETE_SPRITE_AND_CONTINUE(spriteNum); - } - else - { - actor[spriteNum].bpos.z = pSprite->z = pData[0]; - pData[1] = 48 + (krand2() & 31); - } - } - } - - - goto next_sprite; - - case DOORSHOCK__STATIC: - pSprite->yrepeat = (klabs(sector[sectNum].ceilingz - sector[sectNum].floorz) >> 9) + 4; - pSprite->xrepeat = 16; - pSprite->z = sector[sectNum].floorz; - goto next_sprite; - - case TOUCHPLATE__STATIC: - if (pData[1] == 1 && (int16_t)pSprite->hitag >= 0) // Move the sector floor - { - int const floorZ = sector[sectNum].floorz; - - if (pData[3] == 1) - { - if (floorZ >= pData[2]) - { - sector[sectNum].floorz = floorZ; - pData[1] = 0; - } - else - { - sector[sectNum].floorz += sector[sectNum].extra; - int const playerNum = G_CheckPlayerInSector(sectNum); - if (playerNum >= 0) - g_player[playerNum].ps->pos.z += sector[sectNum].extra; - } - } - else - { - if (floorZ <= pSprite->z) - { - sector[sectNum].floorz = pSprite->z; - pData[1] = 0; - } - else - { - int32_t p; - sector[sectNum].floorz -= sector[sectNum].extra; - p = G_CheckPlayerInSector(sectNum); - if (p >= 0) - g_player[p].ps->pos.z -= sector[sectNum].extra; - } - } - goto next_sprite; - } - - if (pData[5] == 1) - goto next_sprite; - - { - int32_t p = G_CheckPlayerInSector(sectNum); - - if (p >= 0 && (g_player[p].ps->on_ground || pSprite->ang == 512)) - { - if (pData[0] == 0 && !G_CheckActivatorMotion(pSprite->lotag)) - { - pData[0] = 1; - pData[1] = 1; - pData[3] = !pData[3]; - G_OperateMasterSwitches(pSprite->lotag); - G_OperateActivators(pSprite->lotag, p); - if ((int16_t)pSprite->hitag > 0) - { - pSprite->hitag--; - if (pSprite->hitag == 0) - pData[5] = 1; - } - } - } - else - pData[0] = 0; - } - - if (pData[1] == 1) - { - for (SPRITES_OF(STAT_STANDABLE, j)) - { - if (j != spriteNum && sprite[j].picnum == TILE_TOUCHPLATE && sprite[j].lotag == pSprite->lotag) - { - actor[j].t_data[1] = 1; - actor[j].t_data[3] = pData[3]; - } - } - } - goto next_sprite; - - case CANWITHSOMETHING2__STATIC: - case CANWITHSOMETHING3__STATIC: - case CANWITHSOMETHING4__STATIC: - if (RR) goto next_sprite; - fallthrough__; - case CANWITHSOMETHING__STATIC: - A_Fall(spriteNum); - if (A_IncurDamage(spriteNum) >= 0) - { - A_PlaySound(VENT_BUST, spriteNum); - - for (j = 9; j >= 0; j--) RANDOMSCRAP(pSprite, spriteNum); - - if (pSprite->lotag) - A_Spawn(spriteNum, pSprite->lotag); - - DELETE_SPRITE_AND_CONTINUE(spriteNum); - } - goto next_sprite; - - case FLOORFLAME__STATIC: - if (RR) goto next_sprite; - fallthrough__; - case EXPLODINGBARREL__STATIC: - case WOODENHORSE__STATIC: - case HORSEONSIDE__STATIC: - case FIREBARREL__STATIC: - case FIREVASE__STATIC: - case NUKEBARREL__STATIC: - case NUKEBARRELDENTED__STATIC: - case NUKEBARRELLEAKED__STATIC: - case TOILETWATER__STATIC: - case RUBBERCAN__STATIC: - case STEAM__STATIC: - case CEILINGSTEAM__STATIC: - case WATERBUBBLEMAKER__STATIC: - if (!G_HaveActor(sprite[spriteNum].picnum)) - goto next_sprite; - { - int32_t playerDist; - int const playerNum = A_FindPlayer(pSprite, &playerDist); - A_Execute(spriteNum, playerNum, playerDist); - } - goto next_sprite; - } - } - - next_sprite: - spriteNum = nextSprite; - } -} ACTOR_STATIC void A_DoProjectileBounce(int const spriteNum) { diff --git a/source/games/duke/src/net.cpp b/source/games/duke/src/net.cpp index d1e5041a2..66e5dc4e8 100644 --- a/source/games/duke/src/net.cpp +++ b/source/games/duke/src/net.cpp @@ -1345,8 +1345,6 @@ void Net_CorrectPrediction(void) mypos = p->pos; omypos = p->opos, myvel = p->vel; myang = p->q16ang; omyang = p->oq16ang; mycursectnum = p->cursectnum; - myhoriz = p->q16horiz; omyhoriz = p->oq16horiz; - myhorizoff = p->q16horizoff; omyhorizoff = p->oq16horizoff; myjumpingcounter = p->jumping_counter; myjumpingtoggle = p->jumping_toggle; myonground = p->on_ground; diff --git a/source/games/duke/src/player.h b/source/games/duke/src/player.h index 2984f1c74..b04c741dc 100644 --- a/source/games/duke/src/player.h +++ b/source/games/duke/src/player.h @@ -154,8 +154,8 @@ typedef struct player_struct { vec3_t npos; vec2_t bobpos, fric; - fix16_t q16horiz, q16horizoff, oq16horiz, oq16horizoff; - fix16_t q16ang, oq16ang, q16angvel; + fix16_t q16horiz, q16horizoff; + fix16_t q16ang, oq16ang; int32_t truefz, truecz, player_par; int32_t randomflamex, exitx, exity; diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 7942dd735..23c655e7c 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -859,7 +859,6 @@ void P_ResetStatus(int playerNum) pPlayer->pyoff = 0; pPlayer->opyoff = 0; pPlayer->loogcnt = 0; - pPlayer->q16angvel = 0; pPlayer->weapon_sway = 0; pPlayer->extra_extra8 = 0; pPlayer->show_empty_weapon = 0; @@ -876,8 +875,6 @@ void P_ResetStatus(int playerNum) pPlayer->footprintpal = 0; pPlayer->footprintshade = 0; pPlayer->jumping_toggle = 0; - pPlayer->oq16horiz = F16(140); - pPlayer->q16horiz = F16(140); pPlayer->q16horizoff = 0; pPlayer->bobcounter = 0; pPlayer->on_ground = 0;