mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
dukeplayer stuff
This commit is contained in:
parent
312b1fd39f
commit
22b2f64016
5 changed files with 44 additions and 21 deletions
|
@ -336,6 +336,16 @@ inline void dragpoint(walltype* pointhighlight, int32_t dax, int32_t day)
|
|||
dragpoint(wallnum(pointhighlight), dax, day);
|
||||
}
|
||||
|
||||
inline int pushmove(vec3_t *const vect, sectortype**const sect, int32_t const walldist, int32_t const ceildist, int32_t const flordist,
|
||||
uint32_t const cliptype, bool clear = true)
|
||||
{
|
||||
int sectno = *sect? sector.IndexOf(*sect) : -1;
|
||||
int res = pushmove(vect, §no, walldist, ceildist, flordist, cliptype, clear);
|
||||
*sect = sectno == -1? nullptr : §or[sectno];
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
inline int findwallbetweensectors(sectortype* sect1, sectortype* sect2)
|
||||
{
|
||||
return findwallbetweensectors(sectnum(sect1), sectnum(sect2));
|
||||
|
|
|
@ -187,6 +187,14 @@ inline int clipmove_ex(vec3_t* pos, int* sect, int xv, int yv, int wal, int ceil
|
|||
return result.setFromEngine(res);
|
||||
}
|
||||
|
||||
inline int clipmove_ex(vec3_t* pos, sectortype** sect, int xv, int yv, int wal, int ceil, int flor, int ct, Collision& result)
|
||||
{
|
||||
int sectno = *sect? sectnum(*sect) : -1;
|
||||
int res = clipmove(pos, §no, xv, yv, wal, ceil, flor, ct);
|
||||
*sect = sectno == -1? nullptr : §or[sectno];
|
||||
return result.setFromEngine(res);
|
||||
}
|
||||
|
||||
inline void getzrange_ex(int x, int y, int z, int sectnum, int32_t* ceilz, Collision& ceilhit, int32_t* florz, Collision& florhit, int32_t walldist, uint32_t cliptype)
|
||||
{
|
||||
int ch, fh;
|
||||
|
@ -195,6 +203,14 @@ inline void getzrange_ex(int x, int y, int z, int sectnum, int32_t* ceilz, Colli
|
|||
florhit.setFromEngine(fh);
|
||||
}
|
||||
|
||||
inline void getzrange_ex(int x, int y, int z, sectortype* sect, int32_t* ceilz, Collision& ceilhit, int32_t* florz, Collision& florhit, int32_t walldist, uint32_t cliptype)
|
||||
{
|
||||
int ch, fh;
|
||||
getzrange(x, y, z, sectnum(sect), ceilz, &ch, florz, &fh, walldist, cliptype);
|
||||
ceilhit.setFromEngine(ch);
|
||||
florhit.setFromEngine(fh);
|
||||
}
|
||||
|
||||
inline int hitscan(int x, int y, int z, int sectnum, int32_t vx, int32_t vy, int32_t vz,
|
||||
sectortype** hitsect, walltype** hitwall, DDukeActor** hitspr, int* hitx, int* hity, int* hitz, uint32_t cliptype)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ source as it is released.
|
|||
BEGIN_DUKE_NS
|
||||
|
||||
void fireweapon_ww(int snum);
|
||||
void operateweapon_ww(int snum, ESyncBits actions, int psect);
|
||||
void operateweapon_ww(int snum, ESyncBits actions);
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
|
@ -2055,7 +2055,7 @@ int operateTripbomb(int snum)
|
|||
walltype* wal;
|
||||
|
||||
hitscan(p->pos.x, p->pos.y, p->pos.z,
|
||||
p->cursectnum, p->angle.ang.bcos(),
|
||||
p->cursector(), p->angle.ang.bcos(),
|
||||
p->angle.ang.bsin(), -p->horizon.sum().asq16() >> 11,
|
||||
&hitsectp, &wal, &hitsprt, &sx, &sy, &sz, CLIPMASK1);
|
||||
|
||||
|
@ -2215,7 +2215,7 @@ static void fireweapon(int snum)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static void operateweapon(int snum, ESyncBits actions, int psect)
|
||||
static void operateweapon(int snum, ESyncBits actions)
|
||||
{
|
||||
auto p = &ps[snum];
|
||||
auto pact = p->GetActor();
|
||||
|
@ -2673,7 +2673,7 @@ static void operateweapon(int snum, ESyncBits actions, int psect)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static void processweapon(int snum, ESyncBits actions, int psect)
|
||||
static void processweapon(int snum, ESyncBits actions)
|
||||
{
|
||||
auto p = &ps[snum];
|
||||
auto pact = p->GetActor();
|
||||
|
@ -2743,8 +2743,8 @@ static void processweapon(int snum, ESyncBits actions, int psect)
|
|||
}
|
||||
else if (p->kickback_pic)
|
||||
{
|
||||
if (!isWW2GI()) operateweapon(snum, actions, psect);
|
||||
else operateweapon_ww(snum, actions, psect);
|
||||
if (!isWW2GI()) operateweapon(snum, actions);
|
||||
else operateweapon_ww(snum, actions);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -2758,7 +2758,7 @@ void processinput_d(int snum)
|
|||
int j, k, doubvel, fz, cz, truefdist;
|
||||
Collision chz, clz;
|
||||
bool shrunk;
|
||||
int psect, psectlotag;
|
||||
int psectlotag;
|
||||
struct player_struct* p;
|
||||
spritetype* s;
|
||||
|
||||
|
@ -2775,28 +2775,27 @@ void processinput_d(int snum)
|
|||
auto sb_svel = PlayerInputSideVel(snum);
|
||||
auto sb_avel = PlayerInputAngVel(snum);
|
||||
|
||||
psect = p->cursectnum;
|
||||
if (psect == -1)
|
||||
auto psectp = p->cursector();
|
||||
if (psectp == nullptr)
|
||||
{
|
||||
if (s->extra > 0 && ud.clipping == 0)
|
||||
{
|
||||
quickkill(p);
|
||||
S_PlayActorSound(SQUISHED, pact);
|
||||
}
|
||||
psect = 0;
|
||||
psectp = §or[0];
|
||||
}
|
||||
|
||||
auto psectp = §or[psect];
|
||||
psectlotag = psectp->lotag;
|
||||
p->spritebridge = 0;
|
||||
|
||||
shrunk = (s->yrepeat < 32);
|
||||
getzrange_ex(p->pos.x, p->pos.y, p->pos.z, psect, &cz, chz, &fz, clz, 163L, CLIPMASK0);
|
||||
getzrange_ex(p->pos.x, p->pos.y, p->pos.z, psectp, &cz, chz, &fz, clz, 163, CLIPMASK0);
|
||||
|
||||
j = getflorzofslope(psect, p->pos.x, p->pos.y);
|
||||
j = getflorzofslopeptr(psectp, p->pos.x, p->pos.y);
|
||||
|
||||
p->truefz = j;
|
||||
p->truecz = getceilzofslope(psect, p->pos.x, p->pos.y);
|
||||
p->truecz = getceilzofslopeptr(psectp, p->pos.x, p->pos.y);
|
||||
|
||||
truefdist = abs(p->pos.z - j);
|
||||
if (clz.type == kHitSector && psectlotag == 1 && truefdist > gs.playerheight + (16 << 8))
|
||||
|
@ -2882,8 +2881,8 @@ void processinput_d(int snum)
|
|||
|
||||
fi.doincrements(p);
|
||||
|
||||
if (isWW2GI() && aplWeaponWorksLike[p->curr_weapon][snum] == HANDREMOTE_WEAPON) processweapon(snum, actions, psect);
|
||||
if (!isWW2GI() && p->curr_weapon == HANDREMOTE_WEAPON) processweapon(snum, actions, psect);
|
||||
if (isWW2GI() && aplWeaponWorksLike[p->curr_weapon][snum] == HANDREMOTE_WEAPON) processweapon(snum, actions);
|
||||
if (!isWW2GI() && p->curr_weapon == HANDREMOTE_WEAPON) processweapon(snum, actions);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3102,8 +3101,7 @@ HORIZONLY:
|
|||
|
||||
if (psectlotag < 3)
|
||||
{
|
||||
psect = s->sectnum;
|
||||
psectp = s->sector(); //
|
||||
psectp = s->sector();
|
||||
if (ud.clipping == 0 && psectp->lotag == 31)
|
||||
{
|
||||
auto secact = ScriptIndexToActor(psectp->hitag);
|
||||
|
@ -3209,7 +3207,7 @@ HORIZONLY:
|
|||
}
|
||||
|
||||
// HACKS
|
||||
processweapon(snum, actions, psect);
|
||||
processweapon(snum, actions);
|
||||
}
|
||||
|
||||
END_DUKE_NS
|
||||
|
|
|
@ -307,7 +307,7 @@ void fireweapon_ww(int snum)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void operateweapon_ww(int snum, ESyncBits actions, int psect)
|
||||
void operateweapon_ww(int snum, ESyncBits actions)
|
||||
{
|
||||
auto p = &ps[snum];
|
||||
auto pact = p->GetActor();
|
||||
|
|
|
@ -1533,7 +1533,6 @@ void checksectors_d(int snum)
|
|||
{
|
||||
int i = -1, oldz;
|
||||
struct player_struct* p;
|
||||
int j;
|
||||
walltype* hitscanwall;
|
||||
sectortype* ntsector = nullptr;
|
||||
walltype* ntwall = nullptr;
|
||||
|
|
Loading…
Reference in a new issue