- floatification of G_CheckSpot and a few other things.

This commit is contained in:
Christoph Oelckers 2016-03-26 09:28:00 +01:00
commit 30b57fd7b0
7 changed files with 30 additions and 54 deletions

View file

@ -197,9 +197,9 @@ short consistancy[MAXPLAYERS][BACKUPTICS];
float normforwardmove[2] = {0x19, 0x32}; // [RH] For setting turbo from console
float normsidemove[2] = {0x18, 0x28}; // [RH] Ditto
fixed_t forwardmove[2], sidemove[2];
fixed_t angleturn[4] = {640, 1280, 320, 320}; // + slow turn
fixed_t flyspeed[2] = {1*256, 3*256};
int forwardmove[2], sidemove[2];
int angleturn[4] = {640, 1280, 320, 320}; // + slow turn
int flyspeed[2] = {1*256, 3*256};
int lookspeed[2] = {450, 512};
#define SLOWTURNTICS 6
@ -1182,8 +1182,7 @@ void G_Ticker ()
}
if (players[i].mo)
{
DWORD sum = rngsum + players[i].mo->_f_X() + players[i].mo->_f_Y() + players[i].mo->_f_Z()
+ players[i].mo->_f_angle() + players[i].mo->_f_pitch();
DWORD sum = rngsum + int((players[i].mo->X() + players[i].mo->Y() + players[i].mo->Z())*257) + players[i].mo->Angles.Yaw.BAMs() + players[i].mo->Angles.Pitch.BAMs();
sum ^= players[i].health;
consistancy[i][buf] = sum;
}
@ -1423,33 +1422,30 @@ void G_PlayerReborn (int player)
bool G_CheckSpot (int playernum, FPlayerStart *mthing)
{
fixed_t x;
fixed_t y;
fixed_t z, oldz;
DVector3 spot;
double oldz;
int i;
if (mthing->type == 0) return false;
x = mthing->_f_X();
y = mthing->_f_Y();
z = mthing->_f_Z();
spot = mthing->pos;
if (!(level.flags & LEVEL_USEPLAYERSTARTZ))
{
z = 0;
spot.Z = 0;
}
z += P_PointInSector (x, y)->floorplane.ZatPoint (x, y);
spot.Z += P_PointInSector (spot)->floorplane.ZatPoint (spot);
if (!players[playernum].mo)
{ // first spawn of level, before corpses
for (i = 0; i < playernum; i++)
if (players[i].mo && players[i].mo->_f_X() == x && players[i].mo->_f_Y() == y)
if (players[i].mo && players[i].mo->X() == spot.X && players[i].mo->Y() == spot.Y)
return false;
return true;
}
oldz = players[playernum].mo->_f_Z(); // [RH] Need to save corpse's z-height
players[playernum].mo->_f_SetZ(z); // [RH] Checks are now full 3-D
oldz = players[playernum].mo->Z(); // [RH] Need to save corpse's z-height
players[playernum].mo->SetZ(spot.Z); // [RH] Checks are now full 3-D
// killough 4/2/98: fix bug where P_CheckPosition() uses a non-solid
// corpse to detect collisions with other players in DM starts
@ -1459,9 +1455,9 @@ bool G_CheckSpot (int playernum, FPlayerStart *mthing)
// return false;
players[playernum].mo->flags |= MF_SOLID;
i = P_CheckPosition(players[playernum].mo, x, y);
i = P_CheckPosition(players[playernum].mo, spot);
players[playernum].mo->flags &= ~MF_SOLID;
players[playernum].mo->_f_SetZ(oldz); // [RH] Restore corpse's height
players[playernum].mo->SetZ(oldz); // [RH] Restore corpse's height
if (!i)
return false;