mirror of
https://github.com/DrBeef/Raze.git
synced 2025-03-05 00:41:15 +00:00
- SW: Remove most PLAYER::posSet()
calls.
This commit is contained in:
parent
0917434888
commit
bf0f0345b3
3 changed files with 13 additions and 8 deletions
source/games/sw/src
|
@ -964,8 +964,9 @@ void post_analyzesprites(tspriteArray& tsprites)
|
||||||
|
|
||||||
std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
|
std::pair<DVector3, DAngle> GameInterface::GetCoordinates()
|
||||||
{
|
{
|
||||||
PLAYER* pp = Player + myconnectindex;
|
auto ppActor = Player[myconnectindex].actor;
|
||||||
return std::make_pair(pp->posGet(), pp->angle.ang);
|
if (!ppActor) return std::make_pair(DVector3(DBL_MAX, 0, 0), nullAngle);
|
||||||
|
return std::make_pair(ppActor->spr.pos, ppActor->spr.angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
|
@ -56,9 +56,13 @@ BEGIN_SW_NS
|
||||||
|
|
||||||
void GameInterface::WarpToCoords(double x, double y, double z, DAngle ang)
|
void GameInterface::WarpToCoords(double x, double y, double z, DAngle ang)
|
||||||
{
|
{
|
||||||
Player->posSet(DVector3(x,y,z));
|
auto pp = &Player[myconnectindex];
|
||||||
|
auto ppActor = pp->actor;
|
||||||
|
|
||||||
Player->posprevSet(Player->posGet());
|
if (!ppActor) return;
|
||||||
|
|
||||||
|
ppActor->spr.pos = DVector3(x,y,z);
|
||||||
|
ppActor->backuppos();
|
||||||
|
|
||||||
if (ang != DAngle::fromDeg(INT_MIN))
|
if (ang != DAngle::fromDeg(INT_MIN))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1312,8 +1312,8 @@ void DoPlayerTeleportPause(PLAYER* pp)
|
||||||
void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
|
void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
|
||||||
{
|
{
|
||||||
pp->angle.ang = pp->angle.oang = ang;
|
pp->angle.ang = pp->angle.oang = ang;
|
||||||
pp->posSet(pos.plusZ(-PLAYER_HEIGHTF));
|
pp->actor->spr.pos = pos;
|
||||||
pp->posprevSet(pos.plusZ(-PLAYER_HEIGHTF));
|
pp->actor->backuppos();
|
||||||
pp->posoldXY() = pp->actor->spr.pos.XY();
|
pp->posoldXY() = pp->actor->spr.pos.XY();
|
||||||
|
|
||||||
updatesector(pp->posGet(), &pp->cursector);
|
updatesector(pp->posGet(), &pp->cursector);
|
||||||
|
@ -2030,7 +2030,7 @@ void PlayerCheckValidMove(PLAYER* pp)
|
||||||
{
|
{
|
||||||
if (!pp->insector())
|
if (!pp->insector())
|
||||||
{
|
{
|
||||||
pp->posSet(pp->posoldGet());
|
pp->actor->spr.pos = pp->posoldGet().plusZ(-pp->actor->viewzoffset);
|
||||||
pp->cursector = pp->lastcursector;
|
pp->cursector = pp->lastcursector;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5304,7 +5304,7 @@ void RemoteToPlayer(PLAYER* pp)
|
||||||
pp->setcursector(pp->remote.cursectp);
|
pp->setcursector(pp->remote.cursectp);
|
||||||
pp->lastcursector = pp->remote.lastcursectp;
|
pp->lastcursector = pp->remote.lastcursectp;
|
||||||
|
|
||||||
pp->posSet(pp->remote.pos);
|
pp->actor->spr.pos = pp->remote.pos.plusZ(-pp->actor->viewzoffset);
|
||||||
|
|
||||||
pp->vect = pp->remote.vect;
|
pp->vect = pp->remote.vect;
|
||||||
pp->ovect = pp->remote.ovect;
|
pp->ovect = pp->remote.ovect;
|
||||||
|
|
Loading…
Reference in a new issue