mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-14 00:21:38 +00:00
- newowner and related code.
This commit is contained in:
parent
c90e7d9b5f
commit
0eb10f0313
20 changed files with 79 additions and 82 deletions
|
@ -202,7 +202,7 @@ void checkavailweapon(struct player_struct* player)
|
||||||
|
|
||||||
void clearcamera(player_struct* ps)
|
void clearcamera(player_struct* ps)
|
||||||
{
|
{
|
||||||
ps->newowner = -1;
|
ps->newOwner = nullptr;
|
||||||
ps->posx = ps->oposx;
|
ps->posx = ps->oposx;
|
||||||
ps->posy = ps->oposy;
|
ps->posy = ps->oposy;
|
||||||
ps->posz = ps->oposz;
|
ps->posz = ps->oposz;
|
||||||
|
@ -417,7 +417,7 @@ void moveplayers(void)
|
||||||
auto spri = &act->s;
|
auto spri = &act->s;
|
||||||
if (act->GetOwner())
|
if (act->GetOwner())
|
||||||
{
|
{
|
||||||
if (p->newowner >= 0) //Looking thru the camera
|
if (p->newOwner != nullptr) //Looking thru the camera
|
||||||
{
|
{
|
||||||
spri->x = p->oposx;
|
spri->x = p->oposx;
|
||||||
spri->y = p->oposy;
|
spri->y = p->oposy;
|
||||||
|
@ -482,7 +482,7 @@ void moveplayers(void)
|
||||||
p->posy = spri->y;
|
p->posy = spri->y;
|
||||||
p->posz = spri->z - (20 << 8);
|
p->posz = spri->z - (20 << 8);
|
||||||
|
|
||||||
p->newowner = -1;
|
p->newOwner = nullptr;
|
||||||
|
|
||||||
if (p->wackedbyactor != nullptr && p->wackedbyactor->s.statnum < MAXSTATUS)
|
if (p->wackedbyactor != nullptr && p->wackedbyactor->s.statnum < MAXSTATUS)
|
||||||
{
|
{
|
||||||
|
@ -4487,7 +4487,7 @@ void handle_se27(DDukeActor* actor)
|
||||||
ud.cameraactor = actor;
|
ud.cameraactor = actor;
|
||||||
t[0]++;
|
t[0]++;
|
||||||
}
|
}
|
||||||
else if (ud.recstat == 2 && ps[p].newowner == -1)
|
else if (ud.recstat == 2 && ps[p].newOwner == nullptr)
|
||||||
{
|
{
|
||||||
if (cansee(s->x, s->y, s->z, s->sectnum, ps[p].posx, ps[p].posy, ps[p].posz, ps[p].cursectnum))
|
if (cansee(s->x, s->y, s->z, s->sectnum, ps[p].posx, ps[p].posy, ps[p].posz, ps[p].cursectnum))
|
||||||
{
|
{
|
||||||
|
|
|
@ -515,7 +515,7 @@ SKIPWALLCHECK:
|
||||||
ps[p].numloogs = -1 - spri->yvel;
|
ps[p].numloogs = -1 - spri->yvel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps[p].newowner >= 0)
|
if (ps[p].newOwner != nullptr)
|
||||||
{
|
{
|
||||||
clearcamera(&ps[p]);
|
clearcamera(&ps[p]);
|
||||||
}
|
}
|
||||||
|
@ -2465,9 +2465,9 @@ static void greenslime(DDukeActor *actor)
|
||||||
if (t[2] < 348)
|
if (t[2] < 348)
|
||||||
t[2] += 128;
|
t[2] += 128;
|
||||||
|
|
||||||
if (ps[p].newowner >= 0)
|
if (ps[p].newOwner != nullptr)
|
||||||
{
|
{
|
||||||
ps[p].newowner = -1;
|
ps[p].newOwner = nullptr;
|
||||||
ps[p].posx = ps[p].oposx;
|
ps[p].posx = ps[p].oposx;
|
||||||
ps[p].posy = ps[p].oposy;
|
ps[p].posy = ps[p].oposy;
|
||||||
ps[p].posz = ps[p].oposz;
|
ps[p].posz = ps[p].oposz;
|
||||||
|
@ -3829,7 +3829,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
|
||||||
|
|
||||||
if (a & face_player)
|
if (a & face_player)
|
||||||
{
|
{
|
||||||
if (ps[playernum].newowner >= 0)
|
if (ps[playernum].newOwner != nullptr)
|
||||||
goalang = getangle(ps[playernum].oposx - spr->x, ps[playernum].oposy - spr->y);
|
goalang = getangle(ps[playernum].oposx - spr->x, ps[playernum].oposy - spr->y);
|
||||||
else goalang = getangle(ps[playernum].posx - spr->x, ps[playernum].posy - spr->y);
|
else goalang = getangle(ps[playernum].posx - spr->x, ps[playernum].posy - spr->y);
|
||||||
angdif = getincangle(spr->ang, goalang) >> 2;
|
angdif = getincangle(spr->ang, goalang) >> 2;
|
||||||
|
@ -3842,7 +3842,7 @@ void move_d(DDukeActor *actor, int playernum, int xvel)
|
||||||
|
|
||||||
if (a & face_player_slow)
|
if (a & face_player_slow)
|
||||||
{
|
{
|
||||||
if (ps[playernum].newowner >= 0)
|
if (ps[playernum].newOwner != nullptr)
|
||||||
goalang = getangle(ps[playernum].oposx - spr->x, ps[playernum].oposy - spr->y);
|
goalang = getangle(ps[playernum].oposx - spr->x, ps[playernum].oposy - spr->y);
|
||||||
else goalang = getangle(ps[playernum].posx - spr->x, ps[playernum].posy - spr->y);
|
else goalang = getangle(ps[playernum].posx - spr->x, ps[playernum].posy - spr->y);
|
||||||
angdif = ksgn(getincangle(spr->ang, goalang)) << 5;
|
angdif = ksgn(getincangle(spr->ang, goalang)) << 5;
|
||||||
|
|
|
@ -360,7 +360,7 @@ SKIPWALLCHECK:
|
||||||
if (spri2->picnum == APLAYER)
|
if (spri2->picnum == APLAYER)
|
||||||
{
|
{
|
||||||
p = act2->PlayerIndex();
|
p = act2->PlayerIndex();
|
||||||
if (ps[p].newowner >= 0)
|
if (ps[p].newOwner != nullptr)
|
||||||
{
|
{
|
||||||
clearcamera(&ps[p]);
|
clearcamera(&ps[p]);
|
||||||
}
|
}
|
||||||
|
@ -3727,7 +3727,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
|
||||||
|
|
||||||
if (a & face_player)
|
if (a & face_player)
|
||||||
{
|
{
|
||||||
if (ps[pnum].newowner >= 0)
|
if (ps[pnum].newOwner != nullptr)
|
||||||
goalang = getangle(ps[pnum].oposx - spr->x, ps[pnum].oposy - spr->y);
|
goalang = getangle(ps[pnum].oposx - spr->x, ps[pnum].oposy - spr->y);
|
||||||
else goalang = getangle(ps[pnum].posx - spr->x, ps[pnum].posy - spr->y);
|
else goalang = getangle(ps[pnum].posx - spr->x, ps[pnum].posy - spr->y);
|
||||||
angdif = getincangle(spr->ang, goalang) >> 2;
|
angdif = getincangle(spr->ang, goalang) >> 2;
|
||||||
|
@ -3740,7 +3740,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
|
||||||
|
|
||||||
if (a & face_player_slow)
|
if (a & face_player_slow)
|
||||||
{
|
{
|
||||||
if (ps[pnum].newowner >= 0)
|
if (ps[pnum].newOwner != nullptr)
|
||||||
goalang = getangle(ps[pnum].oposx - spr->x, ps[pnum].oposy - spr->y);
|
goalang = getangle(ps[pnum].oposx - spr->x, ps[pnum].oposy - spr->y);
|
||||||
else goalang = getangle(ps[pnum].posx - spr->x, ps[pnum].posy - spr->y);
|
else goalang = getangle(ps[pnum].posx - spr->x, ps[pnum].posy - spr->y);
|
||||||
angdif = ksgn(getincangle(spr->ang, goalang)) << 5;
|
angdif = ksgn(getincangle(spr->ang, goalang)) << 5;
|
||||||
|
@ -3756,7 +3756,7 @@ void move_r(DDukeActor *actor, int pnum, int xvel)
|
||||||
{
|
{
|
||||||
if (a & antifaceplayerslow)
|
if (a & antifaceplayerslow)
|
||||||
{
|
{
|
||||||
if (ps[pnum].newowner >= 0)
|
if (ps[pnum].newOwner != nullptr)
|
||||||
goalang = (getangle(ps[pnum].oposx - spr->x, ps[pnum].oposy - spr->y) + 1024) & 2047;
|
goalang = (getangle(ps[pnum].oposx - spr->x, ps[pnum].oposy - spr->y) + 1024) & 2047;
|
||||||
else goalang = (getangle(ps[pnum].posx - spr->x, ps[pnum].posy - spr->y) + 1024) & 2047;
|
else goalang = (getangle(ps[pnum].posx - spr->x, ps[pnum].posy - spr->y) + 1024) & 2047;
|
||||||
angdif = ksgn(getincangle(spr->ang, goalang)) << 5;
|
angdif = ksgn(getincangle(spr->ang, goalang)) << 5;
|
||||||
|
|
|
@ -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 && h->GetOwner())
|
if (s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newOwner == nullptr && 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);
|
||||||
|
@ -324,7 +324,7 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
|
||||||
|
|
||||||
if (t->pal == 1) t->z -= (18 << 8);
|
if (t->pal == 1) t->z -= (18 << 8);
|
||||||
|
|
||||||
if (ps[p].over_shoulder_on > 0 && ps[p].newowner < 0)
|
if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr)
|
||||||
{
|
{
|
||||||
t->cstat |= 2;
|
t->cstat |= 2;
|
||||||
if (screenpeek == myconnectindex && numplayers >= 2)
|
if (screenpeek == myconnectindex && numplayers >= 2)
|
||||||
|
@ -417,14 +417,14 @@ void animatesprites_d(int x, int y, int a, int smoothratio)
|
||||||
else s->yoffset = 0;
|
else s->yoffset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps[p].newowner > -1)
|
if (ps[p].newOwner != nullptr)
|
||||||
{
|
{
|
||||||
t4 = ScriptCode[actorinfo[APLAYER].scriptaddress + 1];
|
t4 = ScriptCode[actorinfo[APLAYER].scriptaddress + 1];
|
||||||
t3 = 0;
|
t3 = 0;
|
||||||
t1 = ScriptCode[actorinfo[APLAYER].scriptaddress + 2];
|
t1 = ScriptCode[actorinfo[APLAYER].scriptaddress + 2];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ud.cameraactor == nullptr && ps[p].newowner == -1)
|
if (ud.cameraactor == nullptr && ps[p].newOwner == nullptr)
|
||||||
if (h->GetOwner() && 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))
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 && h->GetOwner())
|
if (s->statnum != STAT_ACTOR && s->picnum == APLAYER && ps[s->yvel].newOwner == nullptr && 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);
|
||||||
|
@ -371,7 +371,7 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
|
||||||
|
|
||||||
if (t->pal == 1) t->z -= (18 << 8);
|
if (t->pal == 1) t->z -= (18 << 8);
|
||||||
|
|
||||||
if (ps[p].over_shoulder_on > 0 && ps[p].newowner < 0)
|
if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr)
|
||||||
{
|
{
|
||||||
t->cstat |= 2;
|
t->cstat |= 2;
|
||||||
if (screenpeek == myconnectindex && numplayers >= 2)
|
if (screenpeek == myconnectindex && numplayers >= 2)
|
||||||
|
@ -468,14 +468,14 @@ void animatesprites_r(int x, int y, int a, int smoothratio)
|
||||||
else s->yoffset = 0;
|
else s->yoffset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ps[p].newowner > -1)
|
if (ps[p].newOwner != nullptr)
|
||||||
{
|
{
|
||||||
t4 = ScriptCode[actorinfo[APLAYER].scriptaddress + 1];
|
t4 = ScriptCode[actorinfo[APLAYER].scriptaddress + 1];
|
||||||
t3 = 0;
|
t3 = 0;
|
||||||
t1 = ScriptCode[actorinfo[APLAYER].scriptaddress + 2];
|
t1 = ScriptCode[actorinfo[APLAYER].scriptaddress + 2];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ud.cameraactor == nullptr && ps[p].newowner == -1)
|
if (ud.cameraactor == nullptr && ps[p].newOwner == nullptr)
|
||||||
if (h->GetOwner() && 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))
|
||||||
{
|
{
|
||||||
|
|
|
@ -213,7 +213,7 @@ void OffMotorcycle(player_struct *pl);
|
||||||
void OnBoat(player_struct *pl, DDukeActor* snum);
|
void OnBoat(player_struct *pl, DDukeActor* snum);
|
||||||
void OffBoat(player_struct *pl);
|
void OffBoat(player_struct *pl);
|
||||||
|
|
||||||
void cameratext(int i);
|
void cameratext(DDukeActor* i);
|
||||||
void dobonus(int bonusonly, const CompletionFunc& completion);
|
void dobonus(int bonusonly, const CompletionFunc& completion);
|
||||||
void dobonus_d(int bonusonly, const CompletionFunc& completion);
|
void dobonus_d(int bonusonly, const CompletionFunc& completion);
|
||||||
void dobonus_r(int bonusonly, const CompletionFunc& completion);
|
void dobonus_r(int bonusonly, const CompletionFunc& completion);
|
||||||
|
|
|
@ -253,8 +253,8 @@ void drawoverlays(double smoothratio)
|
||||||
{
|
{
|
||||||
if (automapMode != am_full)
|
if (automapMode != am_full)
|
||||||
{
|
{
|
||||||
if (!isRR() && pp->newowner >= 0)
|
if (!isRR() && pp->newOwner != nullptr)
|
||||||
cameratext(pp->newowner);
|
cameratext(pp->newOwner);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fi.displayweapon(screenpeek, smoothratio);
|
fi.displayweapon(screenpeek, smoothratio);
|
||||||
|
@ -269,7 +269,7 @@ void drawoverlays(double smoothratio)
|
||||||
{
|
{
|
||||||
dointerpolations(smoothratio);
|
dointerpolations(smoothratio);
|
||||||
|
|
||||||
if (pp->newowner == -1 && playrunning())
|
if (pp->newOwner == nullptr && playrunning())
|
||||||
{
|
{
|
||||||
if (screenpeek == myconnectindex && numplayers > 1)
|
if (screenpeek == myconnectindex && numplayers > 1)
|
||||||
{
|
{
|
||||||
|
@ -299,7 +299,7 @@ void drawoverlays(double smoothratio)
|
||||||
|
|
||||||
StatusBar->UpdateStatusBar();
|
StatusBar->UpdateStatusBar();
|
||||||
|
|
||||||
if (ps[myconnectindex].newowner == -1 && ud.cameraactor == nullptr)
|
if (ps[myconnectindex].newOwner == nullptr && ud.cameraactor == nullptr)
|
||||||
{
|
{
|
||||||
DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, -getHalfLookAng(pp->angle.olook_ang.asq16(), pp->angle.look_ang.asq16(), cl_syncinput, smoothratio), pp->over_shoulder_on ? 2.5 : 0, isRR() ? 0.5 : 1);
|
DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, -getHalfLookAng(pp->angle.olook_ang.asq16(), pp->angle.look_ang.asq16(), cl_syncinput, smoothratio), pp->over_shoulder_on ? 2.5 : 0, isRR() ? 0.5 : 1);
|
||||||
}
|
}
|
||||||
|
@ -317,14 +317,14 @@ void drawoverlays(double smoothratio)
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void cameratext(int i)
|
void cameratext(DDukeActor *cam)
|
||||||
{
|
{
|
||||||
auto drawitem = [=](int tile, double x, double y, bool flipx, bool flipy)
|
auto drawitem = [=](int tile, double x, double y, bool flipx, bool flipy)
|
||||||
{
|
{
|
||||||
DrawTexture(twod, tileGetTexture(tile), x, y, DTA_ViewportX, windowxy1.x, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.x - windowxy1.x + 1, DTA_CenterOffsetRel, true,
|
DrawTexture(twod, tileGetTexture(tile), x, y, DTA_ViewportX, windowxy1.x, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.x - windowxy1.x + 1, DTA_CenterOffsetRel, true,
|
||||||
DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, DTA_FlipX, flipx, DTA_FlipY, flipy, DTA_FullscreenScale, FSMode_Fit320x200, TAG_DONE);
|
DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, DTA_FlipX, flipx, DTA_FlipY, flipy, DTA_FullscreenScale, FSMode_Fit320x200, TAG_DONE);
|
||||||
};
|
};
|
||||||
if (!hittype[i].temp_data[0])
|
if (!cam->temp_data[0])
|
||||||
{
|
{
|
||||||
drawitem(TILE_CAMCORNER, 24, 33, false, false);
|
drawitem(TILE_CAMCORNER, 24, 33, false, false);
|
||||||
drawitem(TILE_CAMCORNER + 1, 320 - 26, 33, false, false);
|
drawitem(TILE_CAMCORNER + 1, 320 - 26, 33, false, false);
|
||||||
|
|
|
@ -538,8 +538,8 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_NEWOWNER:
|
case PLAYER_NEWOWNER:
|
||||||
if (bSet) ps[iPlayer].newowner = lValue;
|
if (bSet) ps[iPlayer].newOwner = ScriptIndexToActor(lValue);
|
||||||
else SetGameVarID((int)lVar2, ps[iPlayer].newowner, sActor, sPlayer);
|
else SetGameVarID((int)lVar2, ActorToScriptIndex(ps[iPlayer].newOwner), sActor, sPlayer);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_HURT_DELAY:
|
case PLAYER_HURT_DELAY:
|
||||||
|
@ -2046,9 +2046,9 @@ int ParseState::parse(void)
|
||||||
case concmd_addphealth: // todo: move out to player.
|
case concmd_addphealth: // todo: move out to player.
|
||||||
insptr++;
|
insptr++;
|
||||||
|
|
||||||
if(!isRR() && ps[g_p].newowner >= 0)
|
if(!isRR() && ps[g_p].newOwner != nullptr)
|
||||||
{
|
{
|
||||||
ps[g_p].newowner = -1;
|
ps[g_p].newOwner = nullptr;
|
||||||
ps[g_p].posx = ps[g_p].oposx;
|
ps[g_p].posx = ps[g_p].oposx;
|
||||||
ps[g_p].posy = ps[g_p].oposy;
|
ps[g_p].posy = ps[g_p].oposy;
|
||||||
ps[g_p].posz = ps[g_p].oposz;
|
ps[g_p].posz = ps[g_p].oposz;
|
||||||
|
|
|
@ -291,7 +291,7 @@ void displayweapon_d(int snum, double smoothratio)
|
||||||
gs = p->GetActor()->s.shade;
|
gs = p->GetActor()->s.shade;
|
||||||
if(gs > 24) gs = 24;
|
if(gs > 24) gs = 24;
|
||||||
|
|
||||||
bool playerVars = p->newowner >= 0 || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->s.pal != 1 && p->GetActor()->s.extra <= 0);
|
bool playerVars = p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->s.pal != 1 && p->GetActor()->s.extra <= 0);
|
||||||
bool playerAnims = animatefist(gs,snum,look_anghalf) || animateknuckles(gs,snum,hard_landing,look_anghalf,horiz16th) ||
|
bool playerAnims = animatefist(gs,snum,look_anghalf) || animateknuckles(gs,snum,hard_landing,look_anghalf,horiz16th) ||
|
||||||
animatetip(gs,snum,hard_landing,look_anghalf,horiz16th) || animateaccess(gs,snum,hard_landing,look_anghalf,horiz16th);
|
animatetip(gs,snum,hard_landing,look_anghalf,horiz16th) || animateaccess(gs,snum,hard_landing,look_anghalf,horiz16th);
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ void displayweapon_r(int snum, double smoothratio)
|
||||||
gs = p->GetActor()->s.shade;
|
gs = p->GetActor()->s.shade;
|
||||||
if(gs > 24) gs = 24;
|
if(gs > 24) gs = 24;
|
||||||
|
|
||||||
if(p->newowner >= 0 || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->s.pal != 1 && p->GetActor()->s.extra <= 0))
|
if(p->newOwner != nullptr || ud.cameraactor != nullptr || p->over_shoulder_on > 0 || (p->GetActor()->s.pal != 1 && p->GetActor()->s.extra <= 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int opos = p->oweapon_pos * p->oweapon_pos;
|
int opos = p->oweapon_pos * p->oweapon_pos;
|
||||||
|
|
|
@ -119,7 +119,7 @@ void hud_input(int plnum)
|
||||||
if (p->GetActor()->s.extra <= 0) return;
|
if (p->GetActor()->s.extra <= 0) return;
|
||||||
|
|
||||||
// Activate an inventory item. This just forwards to the other inventory bits. If the inventory selector was taken out of the playsim this could be removed.
|
// Activate an inventory item. This just forwards to the other inventory bits. If the inventory selector was taken out of the playsim this could be removed.
|
||||||
if (PlayerInput(plnum, SB_INVUSE) && p->newowner == -1)
|
if (PlayerInput(plnum, SB_INVUSE) && p->newOwner == nullptr)
|
||||||
{
|
{
|
||||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||||
OnEvent(EVENT_INVENTORY, plnum, nullptr, -1);
|
OnEvent(EVENT_INVENTORY, plnum, nullptr, -1);
|
||||||
|
@ -270,7 +270,7 @@ void hud_input(int plnum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PlayerUseItem(plnum, ICON_HOLODUKE) && (isRR() || p->newowner == -1))
|
if (PlayerUseItem(plnum, ICON_HOLODUKE) && (isRR() || p->newOwner == nullptr))
|
||||||
{
|
{
|
||||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||||
OnEvent(EVENT_HOLODUKEON, plnum, nullptr, -1);
|
OnEvent(EVENT_HOLODUKEON, plnum, nullptr, -1);
|
||||||
|
@ -327,7 +327,7 @@ void hud_input(int plnum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRR() && PlayerUseItem(plnum, ICON_HEATS) && p->newowner == -1)
|
if (isRR() && PlayerUseItem(plnum, ICON_HEATS) && p->newOwner == nullptr)
|
||||||
{
|
{
|
||||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||||
OnEvent(EVENT_USENIGHTVISION, plnum, nullptr, -1);
|
OnEvent(EVENT_USENIGHTVISION, plnum, nullptr, -1);
|
||||||
|
@ -412,7 +412,7 @@ void hud_input(int plnum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PlayerUseItem(plnum, ICON_JETPACK) && (isRR() || p->newowner == -1))
|
if (PlayerUseItem(plnum, ICON_JETPACK) && (isRR() || p->newOwner == nullptr))
|
||||||
{
|
{
|
||||||
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
SetGameVarID(g_iReturnVarID, 0, nullptr, plnum);
|
||||||
OnEvent(EVENT_USEJETPACK, plnum, nullptr, -1);
|
OnEvent(EVENT_USEJETPACK, plnum, nullptr, -1);
|
||||||
|
@ -821,7 +821,7 @@ static void FinalizeInput(int playerNum, InputPacket& input, bool vehicle)
|
||||||
auto p = &ps[playerNum];
|
auto p = &ps[playerNum];
|
||||||
bool blocked = movementBlocked(playerNum) || p->GetActor()->s.extra <= 0 || (p->dead_flag && !ud.god);
|
bool blocked = movementBlocked(playerNum) || p->GetActor()->s.extra <= 0 || (p->dead_flag && !ud.god);
|
||||||
|
|
||||||
if (blocked && ps[playerNum].newowner < 0)
|
if (blocked && ps[playerNum].newOwner == nullptr)
|
||||||
{
|
{
|
||||||
// neutralize all movement when blocked or in automap follow mode
|
// neutralize all movement when blocked or in automap follow mode
|
||||||
loc.fvel = loc.svel = 0;
|
loc.fvel = loc.svel = 0;
|
||||||
|
@ -846,7 +846,7 @@ static void FinalizeInput(int playerNum, InputPacket& input, bool vehicle)
|
||||||
loc.svel = input.svel = 0;
|
loc.svel = input.svel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->on_crane == nullptr && p->newowner == -1)
|
if (p->on_crane == nullptr && p->newOwner == nullptr)
|
||||||
{
|
{
|
||||||
// input.avel already added to loc in processMovement()
|
// input.avel already added to loc in processMovement()
|
||||||
loc.avel = clamp(loc.avel, -MAXANGVEL, MAXANGVEL);
|
loc.avel = clamp(loc.avel, -MAXANGVEL, MAXANGVEL);
|
||||||
|
@ -860,7 +860,7 @@ static void FinalizeInput(int playerNum, InputPacket& input, bool vehicle)
|
||||||
loc.avel = input.avel = 0;
|
loc.avel = input.avel = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->newowner == -1 && !(p->sync.actions & SB_CENTERVIEW))
|
if (p->newOwner == nullptr && !(p->sync.actions & SB_CENTERVIEW))
|
||||||
{
|
{
|
||||||
// input.horz already added to loc in processMovement()
|
// input.horz already added to loc in processMovement()
|
||||||
loc.horz = clamp(loc.horz, -MAXHORIZVEL, MAXHORIZVEL);
|
loc.horz = clamp(loc.horz, -MAXHORIZVEL, MAXHORIZVEL);
|
||||||
|
|
|
@ -1032,7 +1032,7 @@ bool movementBlocked(int snum)
|
||||||
p->hard_landing ||
|
p->hard_landing ||
|
||||||
p->access_incs > 0 ||
|
p->access_incs > 0 ||
|
||||||
p->knee_incs > 0 ||
|
p->knee_incs > 0 ||
|
||||||
p->newowner >= 0 ||
|
p->newOwner != nullptr ||
|
||||||
(blockingweapon() && p->kickback_pic > 1 && p->kickback_pic < weapondelay()));
|
(blockingweapon() && p->kickback_pic > 1 && p->kickback_pic < weapondelay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2710,7 +2710,7 @@ static void processweapon(int snum, ESyncBits actions, int psect)
|
||||||
|
|
||||||
void processinput_d(int snum)
|
void processinput_d(int snum)
|
||||||
{
|
{
|
||||||
int j, i, k, doubvel, fz, cz, truefdist;
|
int j, k, doubvel, fz, cz, truefdist;
|
||||||
Collision chz, clz;
|
Collision chz, clz;
|
||||||
bool shrunk;
|
bool shrunk;
|
||||||
ESyncBits actions;
|
ESyncBits actions;
|
||||||
|
@ -2831,9 +2831,8 @@ void processinput_d(int snum)
|
||||||
if (p->transporter_hold < 0)
|
if (p->transporter_hold < 0)
|
||||||
p->transporter_hold++;
|
p->transporter_hold++;
|
||||||
|
|
||||||
if (p->newowner >= 0)
|
if (p->newOwner != nullptr)
|
||||||
{
|
{
|
||||||
i = p->newowner;
|
|
||||||
p->posxv = p->posyv = s->xvel = 0;
|
p->posxv = p->posyv = s->xvel = 0;
|
||||||
|
|
||||||
fi.doincrements(p);
|
fi.doincrements(p);
|
||||||
|
@ -2846,6 +2845,7 @@ void processinput_d(int snum)
|
||||||
doubvel = TICSPERFRAME;
|
doubvel = TICSPERFRAME;
|
||||||
|
|
||||||
checklook(snum,actions);
|
checklook(snum,actions);
|
||||||
|
int ii = 40;
|
||||||
|
|
||||||
if (p->on_crane != nullptr)
|
if (p->on_crane != nullptr)
|
||||||
goto HORIZONLY;
|
goto HORIZONLY;
|
||||||
|
@ -2859,8 +2859,6 @@ void processinput_d(int snum)
|
||||||
|
|
||||||
// Shrinking code
|
// Shrinking code
|
||||||
|
|
||||||
i = 40;
|
|
||||||
|
|
||||||
if (psectlotag == ST_2_UNDERWATER)
|
if (psectlotag == ST_2_UNDERWATER)
|
||||||
{
|
{
|
||||||
underwater(snum, actions, psect, fz, cz);
|
underwater(snum, actions, psect, fz, cz);
|
||||||
|
@ -3016,8 +3014,8 @@ void processinput_d(int snum)
|
||||||
|
|
||||||
HORIZONLY:
|
HORIZONLY:
|
||||||
|
|
||||||
if (psectlotag == 1 || p->spritebridge == 1) i = (4L << 8);
|
if (psectlotag == 1 || p->spritebridge == 1) ii = (4L << 8);
|
||||||
else i = (20L << 8);
|
else ii = (20L << 8);
|
||||||
|
|
||||||
if (sector[p->cursectnum].lotag == 2) k = 0;
|
if (sector[p->cursectnum].lotag == 2) k = 0;
|
||||||
else k = 1;
|
else k = 1;
|
||||||
|
@ -3033,7 +3031,7 @@ HORIZONLY:
|
||||||
else
|
else
|
||||||
clipmove_ex(&p->posx, &p->posy,
|
clipmove_ex(&p->posx, &p->posy,
|
||||||
&p->posz, &p->cursectnum,
|
&p->posz, &p->cursectnum,
|
||||||
p->posxv, p->posyv, 164L, (4L << 8), i, CLIPMASK0, clip);
|
p->posxv, p->posyv, 164L, (4L << 8), ii, CLIPMASK0, clip);
|
||||||
|
|
||||||
if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk)
|
if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk)
|
||||||
p->posz += 32 << 8;
|
p->posz += 32 << 8;
|
||||||
|
|
|
@ -3677,9 +3677,8 @@ void processinput_r(int snum)
|
||||||
if (p->transporter_hold < 0)
|
if (p->transporter_hold < 0)
|
||||||
p->transporter_hold++;
|
p->transporter_hold++;
|
||||||
|
|
||||||
if (p->newowner >= 0)
|
if (p->newOwner != nullptr)
|
||||||
{
|
{
|
||||||
i = p->newowner;
|
|
||||||
p->posxv = p->posyv = s->xvel = 0;
|
p->posxv = p->posyv = s->xvel = 0;
|
||||||
|
|
||||||
fi.doincrements(p);
|
fi.doincrements(p);
|
||||||
|
|
|
@ -142,7 +142,7 @@ void resetplayerstats(int snum)
|
||||||
p->angle.olook_ang = p->angle.look_ang = buildlook(512 - ((currentLevel->levelNumber & 1) << 10));
|
p->angle.olook_ang = p->angle.look_ang = buildlook(512 - ((currentLevel->levelNumber & 1) << 10));
|
||||||
p->angle.orotscrnang = p->angle.rotscrnang = buildlook(0);
|
p->angle.orotscrnang = p->angle.rotscrnang = buildlook(0);
|
||||||
|
|
||||||
p->newowner =-1;
|
p->newOwner =nullptr;
|
||||||
p->jumping_counter = 0;
|
p->jumping_counter = 0;
|
||||||
p->hard_landing = 0;
|
p->hard_landing = 0;
|
||||||
p->posxv = 0; //!!
|
p->posxv = 0; //!!
|
||||||
|
|
|
@ -258,9 +258,9 @@ void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz cho
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
static inline int16_t getcamspriteang(short const newowner, double const smoothratio)
|
static inline int16_t getcamspriteang(DDukeActor* newOwner, double const smoothratio)
|
||||||
{
|
{
|
||||||
return hittype[newowner].tempang + xs_CRoundToInt(fmulscale16(((sprite[newowner].ang - hittype[newowner].tempang + 1024) & 2047) - 1024, smoothratio));
|
return newOwner->tempang + xs_CRoundToInt(fmulscale16(((newOwner->s.ang - newOwner->tempang + 1024) & 2047) - 1024, smoothratio));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -282,9 +282,9 @@ void animatecamsprite(double smoothratio)
|
||||||
auto act = &hittype[spriteNum];
|
auto act = &hittype[spriteNum];
|
||||||
auto sp = &act->s;
|
auto sp = &act->s;
|
||||||
|
|
||||||
if (p->newowner >= 0) sp->owner = p->newowner;
|
if (p->newOwner != nullptr) act->SetOwner(p->newOwner);
|
||||||
|
|
||||||
if (sp->owner >= 0 && dist(p->GetActor(), act) < VIEWSCREEN_ACTIVE_DISTANCE)
|
if (act->GetOwner() && dist(p->GetActor(), act) < VIEWSCREEN_ACTIVE_DISTANCE)
|
||||||
{
|
{
|
||||||
auto tex = tileGetTexture(sp->picnum);
|
auto tex = tileGetTexture(sp->picnum);
|
||||||
TileFiles.MakeCanvas(TILE_VIEWSCR, tex->GetDisplayWidth(), tex->GetDisplayHeight());
|
TileFiles.MakeCanvas(TILE_VIEWSCR, tex->GetDisplayWidth(), tex->GetDisplayHeight());
|
||||||
|
@ -294,8 +294,8 @@ void animatecamsprite(double smoothratio)
|
||||||
|
|
||||||
screen->RenderTextureView(canvas, [=](IntRect& rect)
|
screen->RenderTextureView(canvas, [=](IntRect& rect)
|
||||||
{
|
{
|
||||||
auto camera = &sprite[sp->owner];
|
auto camera = &act->GetOwner()->s;
|
||||||
auto ang = getcamspriteang(sp->owner, smoothratio);
|
auto ang = getcamspriteang(act->GetOwner(), smoothratio);
|
||||||
// Note: no ROR or camera here for now - the current setup has no means to detect these things before rendering the scene itself.
|
// Note: no ROR or camera here for now - the current setup has no means to detect these things before rendering the scene itself.
|
||||||
drawrooms(camera->x, camera->y, camera->z, ang, 100 + camera->shade, camera->sectnum); // why 'shade'...?
|
drawrooms(camera->x, camera->y, camera->z, ang, 100 + camera->shade, camera->sectnum); // why 'shade'...?
|
||||||
display_mirror = 1; // should really be 'display external view'.
|
display_mirror = 1; // should really be 'display external view'.
|
||||||
|
@ -592,10 +592,10 @@ void displayrooms(int snum, double smoothratio)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->newowner >= 0)
|
if (p->newOwner != nullptr)
|
||||||
{
|
{
|
||||||
auto spr = &sprite[p->newowner];
|
auto spr = &p->newOwner->s;
|
||||||
cang = buildang(getcamspriteang(p->newowner, smoothratio));
|
cang = buildang(getcamspriteang(p->newOwner, smoothratio));
|
||||||
choriz = buildhoriz(spr->shade);
|
choriz = buildhoriz(spr->shade);
|
||||||
cposx = spr->pos.x;
|
cposx = spr->pos.x;
|
||||||
cposy = spr->pos.y;
|
cposy = spr->pos.y;
|
||||||
|
@ -633,7 +633,7 @@ void displayrooms(int snum, double smoothratio)
|
||||||
|
|
||||||
if (p->GetActor()->s.pal == 1) cposz -= (18 << 8);
|
if (p->GetActor()->s.pal == 1) cposz -= (18 << 8);
|
||||||
|
|
||||||
else if (p->spritebridge == 0 && p->newowner < 0)
|
else if (p->spritebridge == 0 && p->newOwner == nullptr)
|
||||||
{
|
{
|
||||||
if (cposz < (p->truecz + (4 << 8))) cposz = cz + (4 << 8);
|
if (cposz < (p->truecz + (4 << 8))) cposz = cz + (4 << 8);
|
||||||
else if (cposz > (p->truefz - (4 << 8))) cposz = fz - (4 << 8);
|
else if (cposz > (p->truefz - (4 << 8))) cposz = fz - (4 << 8);
|
||||||
|
|
|
@ -173,7 +173,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, player_struct& w,
|
||||||
("tipincs", w.tipincs)
|
("tipincs", w.tipincs)
|
||||||
("wantweaponfire", w.wantweaponfire)
|
("wantweaponfire", w.wantweaponfire)
|
||||||
("holoduke_amount", w.holoduke_amount)
|
("holoduke_amount", w.holoduke_amount)
|
||||||
("newowner", w.newowner)
|
("newowner", w.newOwner)
|
||||||
("hurt_delay", w.hurt_delay)
|
("hurt_delay", w.hurt_delay)
|
||||||
("hbomb_hold_delay", w.hbomb_hold_delay)
|
("hbomb_hold_delay", w.hbomb_hold_delay)
|
||||||
("jumping_counter", w.jumping_counter)
|
("jumping_counter", w.jumping_counter)
|
||||||
|
|
|
@ -1451,9 +1451,9 @@ void checkhitsprite_d(DDukeActor* targ, DDukeActor* proj)
|
||||||
if (s->statnum == 10)
|
if (s->statnum == 10)
|
||||||
{
|
{
|
||||||
p = s->yvel;
|
p = s->yvel;
|
||||||
if (ps[p].newowner >= 0)
|
if (ps[p].newOwner != nullptr)
|
||||||
{
|
{
|
||||||
ps[p].newowner = -1;
|
ps[p].newOwner = nullptr;
|
||||||
ps[p].posx = ps[p].oposx;
|
ps[p].posx = ps[p].oposx;
|
||||||
ps[p].posy = ps[p].oposy;
|
ps[p].posy = ps[p].oposy;
|
||||||
ps[p].posz = ps[p].oposz;
|
ps[p].posz = ps[p].oposz;
|
||||||
|
@ -1536,7 +1536,7 @@ void checksectors_d(int snum)
|
||||||
if (ud.cashman && PlayerInput(snum, SB_OPEN))
|
if (ud.cashman && PlayerInput(snum, SB_OPEN))
|
||||||
fi.lotsofmoney(p->GetActor(), 2);
|
fi.lotsofmoney(p->GetActor(), 2);
|
||||||
|
|
||||||
if (p->newowner >= 0)
|
if (p->newOwner != nullptr)
|
||||||
{
|
{
|
||||||
if (abs(PlayerInputSideVel(snum)) > 768 || abs(PlayerInputForwardVel(snum)) > 768)
|
if (abs(PlayerInputSideVel(snum)) > 768 || abs(PlayerInputForwardVel(snum)) > 768)
|
||||||
{
|
{
|
||||||
|
@ -1553,7 +1553,7 @@ void checksectors_d(int snum)
|
||||||
|
|
||||||
if (PlayerInput(snum, SB_ESCAPE))
|
if (PlayerInput(snum, SB_ESCAPE))
|
||||||
{
|
{
|
||||||
if (p->newowner >= 0)
|
if (p->newOwner != nullptr)
|
||||||
{
|
{
|
||||||
i = -1;
|
i = -1;
|
||||||
goto CLEARCAMERAS;
|
goto CLEARCAMERAS;
|
||||||
|
@ -1578,7 +1578,7 @@ void checksectors_d(int snum)
|
||||||
if (wall[hitscanwall].lotag)
|
if (wall[hitscanwall].lotag)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (p->newowner >= 0)
|
if (p->newOwner != nullptr)
|
||||||
neartag(p->oposx, p->oposy, p->oposz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
neartag(p->oposx, p->oposy, p->oposz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1618,7 +1618,7 @@ void checksectors_d(int snum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->newowner == -1 && neartagsprite == nullptr && neartagsector == -1 && neartagwall == -1)
|
if (p->newOwner == nullptr && neartagsprite == nullptr && neartagsector == -1 && neartagwall == -1)
|
||||||
if (isanunderoperator(sector[p->GetActor()->s.sectnum].lotag))
|
if (isanunderoperator(sector[p->GetActor()->s.sectnum].lotag))
|
||||||
neartagsector = p->GetActor()->s.sectnum;
|
neartagsector = p->GetActor()->s.sectnum;
|
||||||
|
|
||||||
|
@ -1721,7 +1721,7 @@ void checksectors_d(int snum)
|
||||||
p->cursectnum = j;
|
p->cursectnum = j;
|
||||||
|
|
||||||
// parallaxtype = 2;
|
// parallaxtype = 2;
|
||||||
p->newowner = acti->GetIndex();
|
p->newOwner = acti;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1734,7 +1734,7 @@ void checksectors_d(int snum)
|
||||||
p->posx = p->oposx;
|
p->posx = p->oposx;
|
||||||
p->posy = p->oposy;
|
p->posy = p->oposy;
|
||||||
p->posz = p->oposz;
|
p->posz = p->oposz;
|
||||||
p->newowner = -1;
|
p->newOwner = nullptr;
|
||||||
|
|
||||||
updatesector(p->posx, p->posy, &p->cursectnum);
|
updatesector(p->posx, p->posy, &p->cursectnum);
|
||||||
setpal(p);
|
setpal(p);
|
||||||
|
@ -1745,15 +1745,15 @@ void checksectors_d(int snum)
|
||||||
if (act->s.picnum == CAMERA1) act->s.yvel = 0;
|
if (act->s.picnum == CAMERA1) act->s.yvel = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (p->newowner >= 0)
|
else if (p->newOwner != nullptr)
|
||||||
p->newowner = -1;
|
p->newOwner = nullptr;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PlayerInput(snum, SB_OPEN)) return;
|
if (!PlayerInput(snum, SB_OPEN)) return;
|
||||||
else if (p->newowner >= 0) { i = -1; goto CLEARCAMERAS; }
|
else if (p->newOwner != nullptr) { i = -1; goto CLEARCAMERAS; }
|
||||||
|
|
||||||
if (neartagwall == -1 && neartagsector == -1 && neartagsprite == nullptr)
|
if (neartagwall == -1 && neartagsector == -1 && neartagsprite == nullptr)
|
||||||
if (abs(hits(p->GetActor())) < 512)
|
if (abs(hits(p->GetActor())) < 512)
|
||||||
|
@ -1772,7 +1772,7 @@ void checksectors_d(int snum)
|
||||||
fi.checkhitswitch(snum, neartagwall, nullptr);
|
fi.checkhitswitch(snum, neartagwall, nullptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (p->newowner >= 0)
|
else if (p->newOwner != nullptr)
|
||||||
{
|
{
|
||||||
i = -1;
|
i = -1;
|
||||||
goto CLEARCAMERAS;
|
goto CLEARCAMERAS;
|
||||||
|
|
|
@ -2400,9 +2400,9 @@ void checkhitsprite_r(DDukeActor* targ, DDukeActor* proj)
|
||||||
if (s->statnum == 10)
|
if (s->statnum == 10)
|
||||||
{
|
{
|
||||||
p = s->yvel;
|
p = s->yvel;
|
||||||
if (ps[p].newowner >= 0)
|
if (ps[p].newOwner != nullptr)
|
||||||
{
|
{
|
||||||
ps[p].newowner = -1;
|
ps[p].newOwner = nullptr;
|
||||||
ps[p].posx = ps[p].oposx;
|
ps[p].posx = ps[p].oposx;
|
||||||
ps[p].posy = ps[p].oposy;
|
ps[p].posy = ps[p].oposy;
|
||||||
ps[p].posz = ps[p].oposz;
|
ps[p].posz = ps[p].oposz;
|
||||||
|
@ -2556,7 +2556,7 @@ void checksectors_r(int snum)
|
||||||
neartag(p->posx, p->posy, p->posz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 3);
|
neartag(p->posx, p->posy, p->posz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->newowner >= 0)
|
if (p->newOwner != nullptr)
|
||||||
neartag(p->oposx, p->oposy, p->oposz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
neartag(p->oposx, p->oposy, p->oposz, p->GetActor()->s.sectnum, p->angle.oang.asbuild(), &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, 1280L, 1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2589,7 +2589,7 @@ void checksectors_r(int snum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p->newowner == -1 && neartagsprite == nullptr && neartagsector == -1 && neartagwall == -1)
|
if (p->newOwner == nullptr && neartagsprite == nullptr && neartagsector == -1 && neartagwall == -1)
|
||||||
if (isanunderoperator(sector[p->GetActor()->s.sectnum].lotag))
|
if (isanunderoperator(sector[p->GetActor()->s.sectnum].lotag))
|
||||||
neartagsector = p->GetActor()->s.sectnum;
|
neartagsector = p->GetActor()->s.sectnum;
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ struct player_struct
|
||||||
short ammo_amount[MAX_WEAPONS], frag, fraggedself;
|
short ammo_amount[MAX_WEAPONS], frag, fraggedself;
|
||||||
|
|
||||||
short curr_weapon, last_weapon, tipincs, wantweaponfire;
|
short curr_weapon, last_weapon, tipincs, wantweaponfire;
|
||||||
short holoduke_amount, newowner, hurt_delay, hbomb_hold_delay;
|
short holoduke_amount, hurt_delay, hbomb_hold_delay;
|
||||||
short jumping_counter, airleft, knee_incs, access_incs;
|
short jumping_counter, airleft, knee_incs, access_incs;
|
||||||
short ftq, access_wallnum;
|
short ftq, access_wallnum;
|
||||||
short got_access, weapon_ang, firstaid_amount;
|
short got_access, weapon_ang, firstaid_amount;
|
||||||
|
@ -217,7 +217,7 @@ struct player_struct
|
||||||
short cheat_phase;
|
short cheat_phase;
|
||||||
short extra_extra8, quick_kick, last_quick_kick;
|
short extra_extra8, quick_kick, last_quick_kick;
|
||||||
short heat_amount, timebeforeexit, customexitsound;
|
short heat_amount, timebeforeexit, customexitsound;
|
||||||
DDukeActor* actorsqu, *wackedbyactor, *on_crane, *holoduke_on, *somethingonplayer, *access_spritenum, *dummyplayersprite;
|
DDukeActor* actorsqu, *wackedbyactor, *on_crane, *holoduke_on, *somethingonplayer, *access_spritenum, *dummyplayersprite, *newOwner;
|
||||||
|
|
||||||
short weaprecs[256], weapreccnt;
|
short weaprecs[256], weapreccnt;
|
||||||
unsigned int interface_toggle_flag;
|
unsigned int interface_toggle_flag;
|
||||||
|
|
Loading…
Reference in a new issue