mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 13:10:39 +00:00
- sector references in remote, some cursectnum replacements.
This commit is contained in:
parent
104e80e34a
commit
33d2d80c42
6 changed files with 16 additions and 17 deletions
|
@ -722,7 +722,8 @@ typedef void (*PLAYER_ACTION_FUNCp)(PLAYERp);
|
|||
|
||||
typedef struct
|
||||
{
|
||||
int cursectnum,lastcursectnum,pang;
|
||||
sectortype* cursectp, * lastcursectp;
|
||||
int pang;
|
||||
int xvect,yvect,oxvect,oyvect,slide_xvect,slide_yvect;
|
||||
int posx,posy,posz;
|
||||
SECTOR_OBJECTp sop_control;
|
||||
|
|
|
@ -159,7 +159,7 @@ short MultiClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist)
|
|||
return true;
|
||||
}
|
||||
|
||||
int testquadinsect(int *point_num, vec2_t const * q, short sectnum)
|
||||
int testquadinsect(int *point_num, vec2_t const * q, sectortype* sect)
|
||||
{
|
||||
int i,next_i;
|
||||
|
||||
|
@ -167,7 +167,7 @@ int testquadinsect(int *point_num, vec2_t const * q, short sectnum)
|
|||
|
||||
for (i=0; i < 4; i++)
|
||||
{
|
||||
if (!inside(q[i].x, q[i].y, sectnum))
|
||||
if (!inside(q[i].x, q[i].y, sect))
|
||||
{
|
||||
*point_num = i;
|
||||
|
||||
|
@ -178,8 +178,8 @@ int testquadinsect(int *point_num, vec2_t const * q, short sectnum)
|
|||
for (i=0; i<4; i++)
|
||||
{
|
||||
next_i = (i+1) & 3;
|
||||
if (!cansee(q[i].x, q[i].y,0x3fffffff, sectnum,
|
||||
q[next_i].x, q[next_i].y,0x3fffffff, sectnum))
|
||||
if (!cansee(q[i].x, q[i].y,0x3fffffff, sect,
|
||||
q[next_i].x, q[next_i].y,0x3fffffff, sect))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
|
|||
}
|
||||
|
||||
//Given the 4 points: x[4], y[4]
|
||||
if (testquadinsect(&point_num, xy, pp->cursectnum))
|
||||
if (testquadinsect(&point_num, xy, pp->cursector()))
|
||||
{
|
||||
pp->posx += (pp->xvect>>14);
|
||||
pp->posy += (pp->yvect>>14);
|
||||
|
@ -220,7 +220,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
|
|||
xy[i].x = qx[i] - (pp->yvect>>15);
|
||||
xy[i].y = qy[i] + (pp->xvect>>15);
|
||||
}
|
||||
if (testquadinsect(&point_num, xy, pp->cursectnum))
|
||||
if (testquadinsect(&point_num, xy, pp->cursector()))
|
||||
{
|
||||
pp->posx -= (pp->yvect>>15);
|
||||
pp->posy += (pp->xvect>>15);
|
||||
|
@ -236,7 +236,7 @@ int RectClipMove(PLAYERp pp, int *qx, int *qy)
|
|||
xy[i].x = qx[i] + (pp->yvect>>15);
|
||||
xy[i].y = qy[i] - (pp->xvect>>15);
|
||||
}
|
||||
if (testquadinsect(&point_num, xy, pp->cursectnum))
|
||||
if (testquadinsect(&point_num, xy, pp->cursector()))
|
||||
{
|
||||
pp->posx += (pp->yvect>>15);
|
||||
pp->posy -= (pp->xvect>>15);
|
||||
|
@ -287,7 +287,7 @@ short RectClipTurn(PLAYERp pp, short new_ang, int *qx, int *qy, int *ox, int *oy
|
|||
}
|
||||
|
||||
//Given the 4 points: x[4], y[4]
|
||||
if (testquadinsect(&point_num, xy, pp->cursectnum))
|
||||
if (testquadinsect(&point_num, xy, pp->cursector()))
|
||||
{
|
||||
// move to new pos
|
||||
for (i = 0; i < 4; i++)
|
||||
|
|
|
@ -29,7 +29,6 @@ BEGIN_SW_NS
|
|||
|
||||
int MultiClipMove(PLAYERp pp, int z, int floor_dist);
|
||||
short MultiClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist);
|
||||
int testquadinsect(int *point_num, vec2_t const * q, short sectnum);
|
||||
int RectClipMove(PLAYERp pp, int *qx, int *qy);
|
||||
int testpointinquad(int x, int y, int *qx, int *qy);
|
||||
//short RectClipTurn(PLAYERp pp, short new_ang, int z, int floor_dist, int *qx, int *qy);
|
||||
|
|
|
@ -5137,8 +5137,8 @@ void DoPlayerBeginRemoteOperate(PLAYERp pp, SECTOR_OBJECTp sop)
|
|||
|
||||
void PlayerToRemote(PLAYERp pp)
|
||||
{
|
||||
pp->remote.cursectnum = pp->cursectnum;
|
||||
pp->remote.lastcursectnum = pp->lastcursectnum;
|
||||
pp->remote.cursectp = pp->cursector();
|
||||
pp->remote.lastcursectp = pp->lastcursector();
|
||||
|
||||
pp->remote.posx = pp->posx;
|
||||
pp->remote.posy = pp->posy;
|
||||
|
@ -5154,8 +5154,8 @@ void PlayerToRemote(PLAYERp pp)
|
|||
|
||||
void RemoteToPlayer(PLAYERp pp)
|
||||
{
|
||||
pp->cursectnum = pp->remote.cursectnum;
|
||||
pp->lastcursectnum = pp->remote.lastcursectnum;
|
||||
pp->setcursector(pp->remote.cursectp);
|
||||
pp->lastcursectnum = sectnum(pp->remote.lastcursectp);
|
||||
|
||||
pp->posx = pp->remote.posx;
|
||||
pp->posy = pp->remote.posy;
|
||||
|
|
|
@ -389,8 +389,8 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, REMOTE_CONTROL& w,
|
|||
|
||||
if (arc.BeginObject(keyname))
|
||||
{
|
||||
arc("cursectnum", w.cursectnum)
|
||||
("lastcursectnum", w.lastcursectnum)
|
||||
arc("cursectnum", w.cursectp)
|
||||
("lastcursectnum", w.lastcursectp)
|
||||
("pang", w.pang)
|
||||
("xvect", w.xvect)
|
||||
("yvect", w.yvect)
|
||||
|
|
|
@ -42,7 +42,6 @@ void PlayerOperateEnv(PLAYERp pp);
|
|||
int TeleportToSector(PLAYERp pp, int newsector);
|
||||
int OperateSector(sectortype* sect,short player_is_operating);
|
||||
int OperateSprite(DSWActor*, short player_is_operating);
|
||||
int OperateWall(short wallnum, short player_is_operating);
|
||||
void OperateTripTrigger(PLAYERp pp);
|
||||
|
||||
enum SO_SCALE_TYPE
|
||||
|
|
Loading…
Reference in a new issue