- almost the last owners

This commit is contained in:
Christoph Oelckers 2020-11-03 00:01:35 +01:00
parent d0db810ab0
commit c90e7d9b5f
5 changed files with 24 additions and 30 deletions

View file

@ -174,7 +174,7 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
} }
if (t->statnum == 99) continue; if (t->statnum == 99) continue;
if (s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0) if (s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && h->GetOwner())
{ {
t->x -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posx - ps[s->yvel].oposx); t->x -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posx - ps[s->yvel].oposx);
t->y -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posy - ps[s->yvel].oposy); t->y -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posy - ps[s->yvel].oposy);
@ -337,7 +337,7 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
} }
} }
if ((display_mirror == 1 || screenpeek != p || s->owner == -1) && ud.multimode > 1 && ud.showweapons && ps[p].GetActor()->s.extra > 0 && ps[p].curr_weapon > 0) if ((display_mirror == 1 || screenpeek != p || !h->GetOwner()) && ud.multimode > 1 && ud.showweapons && ps[p].GetActor()->s.extra > 0 && ps[p].curr_weapon > 0)
{ {
auto newtspr = &tsprite[spritesortcnt]; auto newtspr = &tsprite[spritesortcnt];
memcpy(newtspr, t, sizeof(spritetype)); memcpy(newtspr, t, sizeof(spritetype));
@ -368,7 +368,7 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
case DEVISTATOR_WEAPON: newtspr->picnum = DEVISTATORSPRITE; break; case DEVISTATOR_WEAPON: newtspr->picnum = DEVISTATORSPRITE; break;
} }
if (s->owner >= 0) if (h->GetOwner())
newtspr->z = ps[p].posz - (12 << 8); newtspr->z = ps[p].posz - (12 << 8);
else newtspr->z = s->z - (51 << 8); else newtspr->z = s->z - (51 << 8);
if (ps[p].curr_weapon == HANDBOMB_WEAPON) if (ps[p].curr_weapon == HANDBOMB_WEAPON)
@ -385,7 +385,7 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
spritesortcnt++; spritesortcnt++;
} }
if (s->owner == -1) if (!h->GetOwner())
{ {
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { /*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) {
k = 0; k = 0;
@ -425,7 +425,7 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
} }
if (ud.cameraactor == nullptr && ps[p].newowner == -1) if (ud.cameraactor == nullptr && ps[p].newowner == -1)
if (s->owner >= 0 && display_mirror == 0 && ps[p].over_shoulder_on == 0) if (h->GetOwner() && display_mirror == 0 && ps[p].over_shoulder_on == 0)
if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek)) if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek))
{ {
t->owner = -1; t->owner = -1;
@ -438,7 +438,7 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
if (sector[sect].floorpal) if (sector[sect].floorpal)
t->pal = sector[sect].floorpal; t->pal = sector[sect].floorpal;
if (s->owner == -1) continue; if (!h->GetOwner()) continue;
if (t->z > h->floorz && t->xrepeat < 32) if (t->z > h->floorz && t->xrepeat < 32)
t->z = h->floorz; t->z = h->floorz;
@ -565,7 +565,7 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
t->cstat |= 4; t->cstat |= 4;
} }
if (s->statnum == STAT_DUMMYPLAYER || badguy(s) || (s->picnum == APLAYER && s->owner >= 0)) if (s->statnum == STAT_DUMMYPLAYER || badguy(s) || (s->picnum == APLAYER && h->GetOwner()))
if (t->statnum != 99 && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE) if (t->statnum != 99 && s->picnum != EXPLOSION2 && s->picnum != HANGLIGHT && s->picnum != DOMELITE)
if (s->picnum != HOTMEAT) if (s->picnum != HOTMEAT)
{ {

View file

@ -159,7 +159,7 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
} }
if (t->statnum == 99) continue; if (t->statnum == 99) continue;
if (s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && s->owner >= 0) if (s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newowner == -1 && h->GetOwner())
{ {
t->x -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posx - ps[s->yvel].oposx); t->x -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posx - ps[s->yvel].oposx);
t->y -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posy - ps[s->yvel].oposy); t->y -= mulscale16(MaxSmoothRatio - smoothratio, ps[s->yvel].posy - ps[s->yvel].oposy);
@ -384,7 +384,7 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
} }
} }
if ((display_mirror == 1 || screenpeek != p || s->owner == -1) && ud.multimode > 1 && ud.showweapons && ps[p].GetActor()->s.extra > 0 && ps[p].curr_weapon > 0) if ((display_mirror == 1 || screenpeek != p || !h->GetOwner()) && ud.multimode > 1 && ud.showweapons && ps[p].GetActor()->s.extra > 0 && ps[p].curr_weapon > 0)
{ {
auto newtspr = &tsprite[spritesortcnt]; auto newtspr = &tsprite[spritesortcnt];
memcpy(newtspr, t, sizeof(spritetype)); memcpy(newtspr, t, sizeof(spritetype));
@ -414,7 +414,7 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
case TIT_WEAPON: newtspr->picnum = FREEZESPRITE; break; case TIT_WEAPON: newtspr->picnum = FREEZESPRITE; break;
} }
if (s->owner >= 0) if (h->GetOwner())
newtspr->z = ps[p].posz - (12 << 8); newtspr->z = ps[p].posz - (12 << 8);
else newtspr->z = s->z - (51 << 8); else newtspr->z = s->z - (51 << 8);
if (ps[p].curr_weapon == HANDBOMB_WEAPON) if (ps[p].curr_weapon == HANDBOMB_WEAPON)
@ -436,7 +436,7 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
spritesortcnt++; spritesortcnt++;
} }
if (s->owner == -1) if (!h->GetOwner())
{ {
/*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) { /*if (bpp > 8 && usemodels && md_tilehasmodel(s->picnum) >= 0) {
k = 0; k = 0;
@ -476,7 +476,7 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
} }
if (ud.cameraactor == nullptr && ps[p].newowner == -1) if (ud.cameraactor == nullptr && ps[p].newowner == -1)
if (s->owner >= 0 && display_mirror == 0 && ps[p].over_shoulder_on == 0) if (h->GetOwner() && display_mirror == 0 && ps[p].over_shoulder_on == 0)
if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek)) if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek))
{ {
t->owner = -1; t->owner = -1;
@ -489,7 +489,7 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
if (sector[sect].floorpal) if (sector[sect].floorpal)
t->pal = sector[sect].floorpal; t->pal = sector[sect].floorpal;
if (s->owner == -1) continue; if (!h->GetOwner()) continue;
if (t->z > h->floorz && t->xrepeat < 32) if (t->z > h->floorz && t->xrepeat < 32)
t->z = h->floorz; t->z = h->floorz;
@ -720,7 +720,7 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
if (!isRRRA() && s->picnum == SBMOVE) if (!isRRRA() && s->picnum == SBMOVE)
t->shade = -127; t->shade = -127;
if (s->statnum == 13 || badguy(s) || (s->picnum == APLAYER && s->owner >= 0)) if (s->statnum == 13 || badguy(s) || (s->picnum == APLAYER && h->GetOwner()))
if ((s->cstat & 48) == 0 && t->statnum != 99) if ((s->cstat & 48) == 0 && t->statnum != 99)
if (s->picnum != EXPLOSION2 && s->picnum != DOMELITE && s->picnum != TORNADO && s->picnum != EXPLOSION3 && (s->picnum != SBMOVE || isRRRA())) if (s->picnum != EXPLOSION2 && s->picnum != DOMELITE && s->picnum != TORNADO && s->picnum != EXPLOSION3 && (s->picnum != SBMOVE || isRRRA()))
{ {

View file

@ -145,11 +145,6 @@ inline DDukeActor* ScriptIndexToActor(int index)
return &hittype[index]; return &hittype[index];
} }
inline bool wallswitchcheck(DDukeActor* s)
{
return !!(tileinfo[s->s.picnum].flags & TFLAG_WALLSWITCH);
}
int spawn_d(int j, int pn); int spawn_d(int j, int pn);
int spawn_r(int j, int pn); int spawn_r(int j, int pn);

View file

@ -1115,7 +1115,6 @@ int spawn_d(int j, int pn)
else sp->cstat = 1+256; else sp->cstat = 1+256;
sp->extra = impact_damage<<2; sp->extra = impact_damage<<2;
act->SetOwner(act); act->SetOwner(act);
changespritestat(act, STAT_STANDABLE); changespritestat(act, STAT_STANDABLE);
break; break;
@ -1143,8 +1142,8 @@ int spawn_d(int j, int pn)
} }
sp->pal = 0; sp->pal = 0;
sp->owner = i; act->SetOwner(act);
changespritestat(i,6); changespritestat(act, STAT_STANDABLE);
sp->xvel = 8; sp->xvel = 8;
ssp(act, CLIPMASK0); ssp(act, CLIPMASK0);
break; break;
@ -1154,7 +1153,7 @@ int spawn_d(int j, int pn)
sp->lotag = 1; sp->lotag = 1;
sp->cstat |= 257; sp->cstat |= 257;
sp->clipdist = 8; sp->clipdist = 8;
sp->owner = i; act->SetOwner(act);
break; break;
case CANWITHSOMETHING: case CANWITHSOMETHING:
case CANWITHSOMETHING2: case CANWITHSOMETHING2:
@ -1175,9 +1174,9 @@ int spawn_d(int j, int pn)
sp->xrepeat = sp->yrepeat = 32; sp->xrepeat = sp->yrepeat = 32;
sp->clipdist = 72; sp->clipdist = 72;
makeitfall(act); makeitfall(act);
if(j >= 0) if(j >= 0) act->SetOwner(actj);
sp->owner = j; else act->SetOwner(act);
else sp->owner = i;
case EGG: case EGG:
if( ud.monsters_off == 1 && sp->picnum == EGG ) if( ud.monsters_off == 1 && sp->picnum == EGG )
{ {

View file

@ -1439,7 +1439,7 @@ int spawn_r(int j, int pn)
sp->lotag = 1; sp->lotag = 1;
sp->cstat |= 257; sp->cstat |= 257;
sp->clipdist = 8; sp->clipdist = 8;
sp->owner = i; act->SetOwner(act);
break; break;
case CANWITHSOMETHING: case CANWITHSOMETHING:
case RUBBERCAN: case RUBBERCAN:
@ -1457,9 +1457,9 @@ int spawn_r(int j, int pn)
sp->xrepeat = sp->yrepeat = 32; sp->xrepeat = sp->yrepeat = 32;
sp->clipdist = 72; sp->clipdist = 72;
makeitfall(act); makeitfall(act);
if(j >= 0) if(j >= 0) act->SetOwner(actj);
sp->owner = j; else act->SetOwner(act);
else sp->owner = i;
case EGG: case EGG:
if( ud.monsters_off == 1 && sp->picnum == EGG ) if( ud.monsters_off == 1 && sp->picnum == EGG )
{ {