mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +00:00
- fixed: P_SpawnMapThing always reduced the angular precision to 45 degrees.
- removed AngleIncrements because it's not really useful. SVN r2246 (trunk)
This commit is contained in:
parent
a6a303f438
commit
0529ffa043
5 changed files with 9 additions and 28 deletions
|
@ -581,9 +581,6 @@ public:
|
|||
|
||||
virtual void Tick ();
|
||||
|
||||
// Smallest yaw interval for a mapthing to be spawned with
|
||||
virtual angle_t AngleIncrements ();
|
||||
|
||||
// Called when actor dies
|
||||
virtual void Die (AActor *source, AActor *inflictor);
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ class ASecurityCamera : public AActor
|
|||
public:
|
||||
void PostBeginPlay ();
|
||||
void Tick ();
|
||||
angle_t AngleIncrements ();
|
||||
|
||||
void Serialize (FArchive &arc);
|
||||
protected:
|
||||
|
@ -71,11 +70,6 @@ void ASecurityCamera::Serialize (FArchive &arc)
|
|||
arc << Center << Acc << Delta << Range;
|
||||
}
|
||||
|
||||
angle_t ASecurityCamera::AngleIncrements ()
|
||||
{
|
||||
return ANGLE_1;
|
||||
}
|
||||
|
||||
void ASecurityCamera::PostBeginPlay ()
|
||||
{
|
||||
Super::PostBeginPlay ();
|
||||
|
|
|
@ -43,7 +43,6 @@ class AHateTarget : public AActor
|
|||
DECLARE_CLASS (AHateTarget, AActor)
|
||||
public:
|
||||
void BeginPlay ();
|
||||
angle_t AngleIncrements (void);
|
||||
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype);
|
||||
};
|
||||
|
||||
|
@ -77,7 +76,3 @@ int AHateTarget::TakeSpecialDamage (AActor *inflictor, AActor *source, int damag
|
|||
}
|
||||
}
|
||||
|
||||
angle_t AHateTarget::AngleIncrements (void)
|
||||
{
|
||||
return ANGLE_1;
|
||||
}
|
||||
|
|
|
@ -42,17 +42,11 @@ class ASpark : public AActor
|
|||
{
|
||||
DECLARE_CLASS (ASpark, AActor)
|
||||
public:
|
||||
angle_t AngleIncrements ();
|
||||
void Activate (AActor *activator);
|
||||
};
|
||||
|
||||
IMPLEMENT_CLASS (ASpark)
|
||||
|
||||
angle_t ASpark::AngleIncrements ()
|
||||
{
|
||||
return ANGLE_1;
|
||||
}
|
||||
|
||||
void ASpark::Activate (AActor *activator)
|
||||
{
|
||||
Super::Activate (activator);
|
||||
|
|
|
@ -2614,11 +2614,6 @@ void AActor::RemoveFromHash ()
|
|||
tid = 0;
|
||||
}
|
||||
|
||||
angle_t AActor::AngleIncrements ()
|
||||
{
|
||||
return ANGLE_45;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// AActor :: GetMissileDamage
|
||||
|
@ -3700,8 +3695,6 @@ void AActor::LevelSpawned ()
|
|||
{
|
||||
if (tics > 0 && !(flags4 & MF4_SYNCHRONIZED))
|
||||
tics = 1 + (pr_spawnmapthing() % tics);
|
||||
angle_t incs = AngleIncrements ();
|
||||
angle -= angle % incs;
|
||||
flags &= ~MF_DROPPED; // [RH] clear MF_DROPPED flag
|
||||
HandleSpawnFlags ();
|
||||
}
|
||||
|
@ -3960,7 +3953,15 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer)
|
|||
{
|
||||
spawn_x = mthing->x;
|
||||
spawn_y = mthing->y;
|
||||
spawn_angle = ANG45 * (mthing->angle/45);
|
||||
// Allow full angular precision but avoid roundoff errors for multiples of 45 degrees.
|
||||
if (mthing->angle % 45 != 0)
|
||||
{
|
||||
spawn_angle = mthing->angle * (ANG45 / 45);
|
||||
}
|
||||
else
|
||||
{
|
||||
spawn_angle = ANG45 * (mthing->angle / 45);
|
||||
}
|
||||
}
|
||||
|
||||
mobj = static_cast<APlayerPawn *>
|
||||
|
|
Loading…
Reference in a new issue