mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 04:51:19 +00:00
- looks like the oldz parameter in UpdateWaterLevel is not needed at all...
This commit is contained in:
parent
558e04cb99
commit
c2e7858e05
9 changed files with 24 additions and 28 deletions
|
@ -1337,11 +1337,7 @@ public:
|
|||
bool InStateSequence(FState * newstate, FState * basestate);
|
||||
int GetTics(FState * newstate);
|
||||
bool SetState (FState *newstate, bool nofunction=false);
|
||||
virtual bool UpdateWaterLevel (fixed_t oldz, bool splash=true);
|
||||
bool UpdateWaterLevel(double oldz, bool splash = true)
|
||||
{
|
||||
return UpdateWaterLevel(FLOAT2FIXED(oldz), splash);
|
||||
}
|
||||
virtual bool UpdateWaterLevel (bool splash=true);
|
||||
bool isFast();
|
||||
bool isSlow();
|
||||
void SetIdle(bool nofunction=false);
|
||||
|
|
|
@ -353,6 +353,11 @@ static bool ReadChars (char **stuff, int size);
|
|||
static char *igets (void);
|
||||
static int GetLine (void);
|
||||
|
||||
inline double DEHToDouble(int acsval)
|
||||
{
|
||||
return acsval / 65536.;
|
||||
}
|
||||
|
||||
static void PushTouchedActor(PClassActor *cls)
|
||||
{
|
||||
for(unsigned i = 0; i < TouchedActors.Size(); i++)
|
||||
|
@ -647,7 +652,7 @@ static int CreateMushroomFunc(VMFunctionBuilder &buildit, int value1, int value2
|
|||
}
|
||||
else
|
||||
{
|
||||
buildit.Emit(OP_PARAM, 0, REGT_FLOAT | REGT_KONST, buildit.GetConstantFloat(FIXED2DBL(value1)));
|
||||
buildit.Emit(OP_PARAM, 0, REGT_FLOAT | REGT_KONST, buildit.GetConstantFloat(DEHToDouble(value1)));
|
||||
}
|
||||
// hrange
|
||||
if (value2 == 0)
|
||||
|
@ -656,7 +661,7 @@ static int CreateMushroomFunc(VMFunctionBuilder &buildit, int value1, int value2
|
|||
}
|
||||
else
|
||||
{
|
||||
buildit.Emit(OP_PARAM, 0, REGT_FLOAT | REGT_KONST, buildit.GetConstantFloat(FIXED2DBL(value2)));
|
||||
buildit.Emit(OP_PARAM, 0, REGT_FLOAT | REGT_KONST, buildit.GetConstantFloat(DEHToDouble(value2)));
|
||||
}
|
||||
return 5;
|
||||
}
|
||||
|
@ -896,14 +901,14 @@ static int PatchThing (int thingy)
|
|||
}
|
||||
else if (linelen == 12 && stricmp (Line1, "Translucency") == 0)
|
||||
{
|
||||
info->Alpha = FIXED2DBL(val);
|
||||
info->Alpha = DEHToDouble(val);
|
||||
info->RenderStyle = STYLE_Translucent;
|
||||
hadTranslucency = true;
|
||||
hadStyle = true;
|
||||
}
|
||||
else if (linelen == 6 && stricmp (Line1, "Height") == 0)
|
||||
{
|
||||
info->Height = FIXED2DBL(val);
|
||||
info->Height = DEHToDouble(val);
|
||||
info->projectilepassheight = 0; // needs to be disabled
|
||||
hadHeight = true;
|
||||
}
|
||||
|
@ -919,7 +924,7 @@ static int PatchThing (int thingy)
|
|||
}
|
||||
else if (stricmp (Line1, "Width") == 0)
|
||||
{
|
||||
info->radius = FIXED2FLOAT(val);
|
||||
info->radius = DEHToDouble(val);
|
||||
}
|
||||
else if (stricmp (Line1, "Alpha") == 0)
|
||||
{
|
||||
|
|
|
@ -2369,7 +2369,7 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
|||
DAngle ang = players[player].mo->Angles.Yaw;
|
||||
DAngle pitch = players[player].mo->Angles.Pitch;
|
||||
double c = pitch.Cos();
|
||||
DVector3 vec(c * ang.Cos(), c * ang.Sin(), -pitch.Sin);
|
||||
DVector3 vec(c * ang.Cos(), c * ang.Sin(), -pitch.Sin());
|
||||
|
||||
s = ReadString (stream);
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ public:
|
|||
// [CW] Fades for when you are being damaged.
|
||||
PalEntry DamageFade;
|
||||
|
||||
bool UpdateWaterLevel (fixed_t oldz, bool splash);
|
||||
bool UpdateWaterLevel (bool splash);
|
||||
bool ResetAirSupply (bool playgasp = true);
|
||||
|
||||
int GetMaxHealth() const;
|
||||
|
|
|
@ -50,9 +50,6 @@
|
|||
#define NETD_ID BIGE_ID('N','E','T','D')
|
||||
#define WEAP_ID BIGE_ID('W','E','A','P')
|
||||
|
||||
#define ANGLE2SHORT(x) ((((x)/360) & 65535)
|
||||
#define SHORT2ANGLE(x) ((x)*360)
|
||||
|
||||
|
||||
struct zdemoheader_s {
|
||||
BYTE demovermajor;
|
||||
|
|
|
@ -93,7 +93,7 @@ void AFastProjectile::Tick ()
|
|||
}
|
||||
}
|
||||
AddZ(frac.Z);
|
||||
UpdateWaterLevel (oldz);
|
||||
UpdateWaterLevel ();
|
||||
oldz = Z();
|
||||
if (oldz <= floorz)
|
||||
{ // Hit the floor
|
||||
|
|
|
@ -6098,7 +6098,7 @@ bool P_ChangeSector(sector_t *sector, int crunch, int amt, int floorOrCeil, bool
|
|||
{
|
||||
n->visited = true; // mark thing as processed
|
||||
|
||||
n->m_thing->UpdateWaterLevel(n->m_thing->_f_Z(), false);
|
||||
n->m_thing->UpdateWaterLevel(false);
|
||||
P_CheckFakeFloorTriggers(n->m_thing, n->m_thing->_f_Z() - amt);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -472,7 +472,7 @@ void AActor::Serialize(FArchive &arc)
|
|||
}
|
||||
}
|
||||
ClearInterpolation();
|
||||
UpdateWaterLevel(_f_Z(), false);
|
||||
UpdateWaterLevel(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3462,7 +3462,7 @@ void AActor::Tick ()
|
|||
}
|
||||
}
|
||||
|
||||
fixed_t oldz = _f_Z();
|
||||
double oldz = Z();
|
||||
|
||||
// [RH] Give the pain elemental vertical friction
|
||||
// This used to be in APainElemental::Tick but in order to use
|
||||
|
@ -3736,7 +3736,7 @@ void AActor::Tick ()
|
|||
const sector_t *sec = node->m_sector;
|
||||
if (sec->floorplane.c >= STEEPSLOPE)
|
||||
{
|
||||
if (floorplane.ZatPointF (_f_PosRelative(node->m_sector)) >= Z() - MaxStepHeight)
|
||||
if (floorplane.ZatPoint(PosRelative(node->m_sector)) >= Z() - MaxStepHeight)
|
||||
{
|
||||
dopush = false;
|
||||
break;
|
||||
|
@ -3858,7 +3858,7 @@ void AActor::Tick ()
|
|||
|
||||
CheckPortalTransition(true);
|
||||
|
||||
UpdateWaterLevel (oldz);
|
||||
UpdateWaterLevel ();
|
||||
|
||||
// [RH] Don't advance if predicting a player
|
||||
if (player && (player->cheats & CF_PREDICTING))
|
||||
|
@ -4011,7 +4011,7 @@ void AActor::CheckSectorTransition(sector_t *oldsec)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
|
||||
bool AActor::UpdateWaterLevel (bool dosplash)
|
||||
{
|
||||
BYTE lastwaterlevel = waterlevel;
|
||||
double fh = -FLT_MAX;
|
||||
|
@ -4068,10 +4068,8 @@ bool AActor::UpdateWaterLevel (fixed_t oldz, bool dosplash)
|
|||
else
|
||||
{
|
||||
// Check 3D floors as well!
|
||||
for(unsigned int i=0;i<Sector->e->XFloor.ffloors.Size();i++)
|
||||
for(auto rover : Sector->e->XFloor.ffloors)
|
||||
{
|
||||
F3DFloor* rover=Sector->e->XFloor.ffloors[i];
|
||||
|
||||
if (!(rover->flags & FF_EXISTS)) continue;
|
||||
if(!(rover->flags & FF_SWIMMABLE) || rover->flags & FF_SOLID) continue;
|
||||
|
||||
|
@ -4269,7 +4267,7 @@ AActor *AActor::StaticSpawn (PClassActor *type, const DVector3 &pos, replace_t a
|
|||
{
|
||||
actor->Floorclip = 0;
|
||||
}
|
||||
actor->UpdateWaterLevel (actor->Z(), false);
|
||||
actor->UpdateWaterLevel (false);
|
||||
if (!SpawningMapThing)
|
||||
{
|
||||
actor->BeginPlay ();
|
||||
|
|
|
@ -1225,10 +1225,10 @@ int APlayerPawn::GetMaxHealth() const
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
bool APlayerPawn::UpdateWaterLevel (fixed_t oldz, bool splash)
|
||||
bool APlayerPawn::UpdateWaterLevel (bool splash)
|
||||
{
|
||||
int oldlevel = waterlevel;
|
||||
bool retval = Super::UpdateWaterLevel (oldz, splash);
|
||||
bool retval = Super::UpdateWaterLevel (splash);
|
||||
if (player != NULL)
|
||||
{
|
||||
if (oldlevel < 3 && waterlevel == 3)
|
||||
|
|
Loading…
Reference in a new issue