- hittype in spawn code.

This commit is contained in:
Christoph Oelckers 2020-11-02 20:54:27 +01:00
parent e427668373
commit c54f17a6d5
2 changed files with 27 additions and 27 deletions

View file

@ -50,8 +50,8 @@ int spawn_d(int j, int pn)
i &= 0xffffff; i &= 0xffffff;
auto act = &hittype[i]; auto act = &hittype[i];
auto sp = &act->s; auto sp = &act->s;
auto actj = j == -1 ? nullptr : &hittype[j]; auto actj = j < 0 ? nullptr : &hittype[j];
auto spj = j == -1 ? nullptr : &actj->s; auto spj = j < 0 ? nullptr : &actj->s;
auto t = act->temp_data; auto t = act->temp_data;
int sect = sp->sectnum; int sect = sp->sectnum;
@ -63,7 +63,7 @@ int spawn_d(int j, int pn)
case BOSS2STAYPUT: case BOSS2STAYPUT:
case BOSS3STAYPUT: case BOSS3STAYPUT:
case BOSS5STAYPUT: case BOSS5STAYPUT:
hittype[i].actorstayput = sp->sectnum; act->actorstayput = sp->sectnum;
case FIREFLY: case FIREFLY:
case BOSS5: case BOSS5:
if (sp->picnum != FIREFLY) if (sp->picnum != FIREFLY)
@ -107,8 +107,8 @@ int spawn_d(int j, int pn)
ps[connecthead].max_actors_killed++; ps[connecthead].max_actors_killed++;
if (j >= 0) { if (j >= 0) {
hittype[i].timetosleep = 0; act->timetosleep = 0;
check_fta_sounds_d(&hittype[i]); check_fta_sounds_d(act);
changespritestat(i, 1); changespritestat(i, 1);
} else } else
changespritestat(i, 2); changespritestat(i, 2);
@ -251,7 +251,7 @@ int spawn_d(int j, int pn)
sp->yrepeat = 0; sp->yrepeat = 0;
} }
if(j >= 0) sp->ang = hittype[j].temp_data[5]+512; if(j >= 0) sp->ang = actj->temp_data[5]+512;
changespritestat(i, STAT_MISC); changespritestat(i, STAT_MISC);
break; break;
@ -323,7 +323,7 @@ int spawn_d(int j, int pn)
sp->z -= (16<<8); sp->z -= (16<<8);
if(j >= 0 && spj->pal == 6) if(j >= 0 && spj->pal == 6)
sp->pal = 6; sp->pal = 6;
insertspriteq(&hittype[i]); insertspriteq(act);
changespritestat(i, STAT_MISC); changespritestat(i, STAT_MISC);
break; break;
@ -343,9 +343,9 @@ int spawn_d(int j, int pn)
sp->xvel = 16; sp->xvel = 16;
ssp(i,CLIPMASK0); ssp(i,CLIPMASK0);
hittype[i].temp_data[0] = 17; act->temp_data[0] = 17;
hittype[i].temp_data[2] = 0; act->temp_data[2] = 0;
hittype[i].temp_data[5] = sp->ang; act->temp_data[5] = sp->ang;
case SPACEMARINE: case SPACEMARINE:
if(sp->picnum == SPACEMARINE) if(sp->picnum == SPACEMARINE)
@ -524,7 +524,7 @@ int spawn_d(int j, int pn)
if(sp->picnum == RESPAWNMARKERRED) if(sp->picnum == RESPAWNMARKERRED)
{ {
sp->xrepeat = sp->yrepeat = 24; sp->xrepeat = sp->yrepeat = 24;
if(j >= 0) sp->z = hittype[j].floorz; // -(1<<4); if(j >= 0) sp->z = actj->floorz; // -(1<<4);
} }
else else
{ {
@ -545,13 +545,13 @@ int spawn_d(int j, int pn)
case BULLETHOLE: case BULLETHOLE:
sp->xrepeat = sp->yrepeat = 3; sp->xrepeat = sp->yrepeat = 3;
sp->cstat = 16+(krand()&12); sp->cstat = 16+(krand()&12);
insertspriteq(&hittype[i]); insertspriteq(act);
case MONEY: case MONEY:
case MAIL: case MAIL:
case PAPER: case PAPER:
if( sp->picnum == MONEY || sp->picnum == MAIL || sp->picnum == PAPER ) if( sp->picnum == MONEY || sp->picnum == MAIL || sp->picnum == PAPER )
{ {
hittype[i].temp_data[0] = krand()&2047; act->temp_data[0] = krand()&2047;
sp->cstat = krand()&12; sp->cstat = krand()&12;
sp->xrepeat = sp->yrepeat = 8; sp->xrepeat = sp->yrepeat = 8;
sp->ang = krand()&2047; sp->ang = krand()&2047;
@ -772,7 +772,7 @@ int spawn_d(int j, int pn)
case PIGCOPDIVE: case PIGCOPDIVE:
case COMMANDERSTAYPUT: case COMMANDERSTAYPUT:
case BOSS4STAYPUT: case BOSS4STAYPUT:
hittype[i].actorstayput = sp->sectnum; act->actorstayput = sp->sectnum;
case BOSS1: case BOSS1:
case BOSS2: case BOSS2:
case BOSS3: case BOSS3:
@ -880,8 +880,8 @@ int spawn_d(int j, int pn)
if(j >= 0) if(j >= 0)
{ {
hittype[i].timetosleep = 0; act->timetosleep = 0;
check_fta_sounds_d(&hittype[i]); check_fta_sounds_d(act);
changespritestat(i,1); changespritestat(i,1);
} }
else changespritestat(i,2); else changespritestat(i,2);
@ -919,14 +919,14 @@ int spawn_d(int j, int pn)
{ {
if( spj->picnum == NUKEBARREL ) if( spj->picnum == NUKEBARREL )
sp->pal = 8; sp->pal = 8;
insertspriteq(&hittype[i]); insertspriteq(act);
} }
changespritestat(i,1); changespritestat(i,1);
getglobalz(i); getglobalz(i);
j = (hittype[i].floorz-hittype[i].ceilingz)>>9; j = (act->floorz-act->ceilingz)>>9;
sp->yrepeat = j; sp->yrepeat = j;
sp->xrepeat = 25-(j>>1); sp->xrepeat = 25-(j>>1);

View file

@ -364,7 +364,7 @@ int spawn_r(int j, int pn)
sp->z -= (16<<8); sp->z -= (16<<8);
if(j >= 0 && spj->pal == 6) if(j >= 0 && spj->pal == 6)
sp->pal = 6; sp->pal = 6;
insertspriteq(&hittype[i]); insertspriteq(act);
changespritestat(i, STAT_MISC); changespritestat(i, STAT_MISC);
break; break;
@ -558,7 +558,7 @@ int spawn_r(int j, int pn)
if(sp->picnum == RESPAWNMARKERRED) if(sp->picnum == RESPAWNMARKERRED)
{ {
sp->xrepeat = sp->yrepeat = 8; sp->xrepeat = sp->yrepeat = 8;
if(j >= 0) sp->z = hittype[j].floorz; if(j >= 0) sp->z = actj->floorz;
} }
else else
{ {
@ -578,11 +578,11 @@ int spawn_r(int j, int pn)
case BULLETHOLE: case BULLETHOLE:
sp->xrepeat = sp->yrepeat = 3; sp->xrepeat = sp->yrepeat = 3;
sp->cstat = 16+(krand()&12); sp->cstat = 16+(krand()&12);
insertspriteq(&hittype[i]); insertspriteq(act);
case MONEY: case MONEY:
if(sp->picnum == MONEY) if(sp->picnum == MONEY)
{ {
hittype[i].temp_data[0] = krand()&2047; act->temp_data[0] = krand()&2047;
sp->cstat = krand()&12; sp->cstat = krand()&12;
sp->xrepeat = sp->yrepeat = 8; sp->xrepeat = sp->yrepeat = 8;
sp->ang = krand()&2047; sp->ang = krand()&2047;
@ -785,7 +785,7 @@ int spawn_r(int j, int pn)
case MINIONSTAYPUT: case MINIONSTAYPUT:
case COOTSTAYPUT: case COOTSTAYPUT:
rrra_stayput: rrra_stayput:
hittype[i].actorstayput = sp->sectnum; act->actorstayput = sp->sectnum;
case BOULDER: case BOULDER:
case BOULDER1: case BOULDER1:
case RAT: case RAT:
@ -1044,14 +1044,14 @@ int spawn_r(int j, int pn)
sp->cstat |= 257; sp->cstat |= 257;
if(sp->picnum != 5501) if(sp->picnum != 5501)
if (actorfella(&hittype[i])) if (actorfella(act))
ps[myconnectindex].max_actors_killed++; ps[myconnectindex].max_actors_killed++;
} }
if(j >= 0) if(j >= 0)
{ {
hittype[i].timetosleep = 0; act->timetosleep = 0;
check_fta_sounds_r(&hittype[i]); check_fta_sounds_r(act);
changespritestat(i,1); changespritestat(i,1);
sp->shade = spj->shade; sp->shade = spj->shade;
} }
@ -1092,7 +1092,7 @@ int spawn_r(int j, int pn)
getglobalz(i); getglobalz(i);
j = (hittype[i].floorz-hittype[i].ceilingz)>>9; j = (act->floorz-act->ceilingz)>>9;
sp->yrepeat = j; sp->yrepeat = j;
sp->xrepeat = 25-(j>>1); sp->xrepeat = 25-(j>>1);