- 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:
Christoph Oelckers 2010-03-26 16:57:00 +00:00
parent a6a303f438
commit 0529ffa043
5 changed files with 9 additions and 28 deletions

View file

@ -581,9 +581,6 @@ public:
virtual void Tick (); virtual void Tick ();
// Smallest yaw interval for a mapthing to be spawned with
virtual angle_t AngleIncrements ();
// Called when actor dies // Called when actor dies
virtual void Die (AActor *source, AActor *inflictor); virtual void Die (AActor *source, AActor *inflictor);

View file

@ -53,7 +53,6 @@ class ASecurityCamera : public AActor
public: public:
void PostBeginPlay (); void PostBeginPlay ();
void Tick (); void Tick ();
angle_t AngleIncrements ();
void Serialize (FArchive &arc); void Serialize (FArchive &arc);
protected: protected:
@ -71,11 +70,6 @@ void ASecurityCamera::Serialize (FArchive &arc)
arc << Center << Acc << Delta << Range; arc << Center << Acc << Delta << Range;
} }
angle_t ASecurityCamera::AngleIncrements ()
{
return ANGLE_1;
}
void ASecurityCamera::PostBeginPlay () void ASecurityCamera::PostBeginPlay ()
{ {
Super::PostBeginPlay (); Super::PostBeginPlay ();

View file

@ -43,7 +43,6 @@ class AHateTarget : public AActor
DECLARE_CLASS (AHateTarget, AActor) DECLARE_CLASS (AHateTarget, AActor)
public: public:
void BeginPlay (); void BeginPlay ();
angle_t AngleIncrements (void);
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype); 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;
}

View file

@ -42,17 +42,11 @@ class ASpark : public AActor
{ {
DECLARE_CLASS (ASpark, AActor) DECLARE_CLASS (ASpark, AActor)
public: public:
angle_t AngleIncrements ();
void Activate (AActor *activator); void Activate (AActor *activator);
}; };
IMPLEMENT_CLASS (ASpark) IMPLEMENT_CLASS (ASpark)
angle_t ASpark::AngleIncrements ()
{
return ANGLE_1;
}
void ASpark::Activate (AActor *activator) void ASpark::Activate (AActor *activator)
{ {
Super::Activate (activator); Super::Activate (activator);

View file

@ -2614,11 +2614,6 @@ void AActor::RemoveFromHash ()
tid = 0; tid = 0;
} }
angle_t AActor::AngleIncrements ()
{
return ANGLE_45;
}
//========================================================================== //==========================================================================
// //
// AActor :: GetMissileDamage // AActor :: GetMissileDamage
@ -3700,8 +3695,6 @@ void AActor::LevelSpawned ()
{ {
if (tics > 0 && !(flags4 & MF4_SYNCHRONIZED)) if (tics > 0 && !(flags4 & MF4_SYNCHRONIZED))
tics = 1 + (pr_spawnmapthing() % tics); tics = 1 + (pr_spawnmapthing() % tics);
angle_t incs = AngleIncrements ();
angle -= angle % incs;
flags &= ~MF_DROPPED; // [RH] clear MF_DROPPED flag flags &= ~MF_DROPPED; // [RH] clear MF_DROPPED flag
HandleSpawnFlags (); HandleSpawnFlags ();
} }
@ -3960,7 +3953,15 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer)
{ {
spawn_x = mthing->x; spawn_x = mthing->x;
spawn_y = mthing->y; 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 *> mobj = static_cast<APlayerPawn *>