- Made spawning of floor- and ceiling huggers a little more intelligent.

SVN r1348 (trunk)
This commit is contained in:
Christoph Oelckers 2009-01-03 18:09:33 +00:00
parent fdfee91b9f
commit bbdb2b10a8
8 changed files with 35 additions and 29 deletions

View file

@ -1,4 +1,5 @@
January 3, 2009 (Changes by Graf Zahl)
- Made spawning of floor- and ceiling huggers a little more intelligent.
- Fixed: 'None' was no longer recognized as a NULL class name by the
DECORATE parser.

View file

@ -132,7 +132,7 @@ IMPLEMENT_CLASS (AZCorpseLynchedNoHeart)
void AZCorpseLynchedNoHeart::PostBeginPlay ()
{
Super::PostBeginPlay ();
Spawn ("BloodPool", x, y, ONFLOORZ, ALLOW_REPLACE);
Spawn ("BloodPool", x, y, floorz, ALLOW_REPLACE);
}
//============================================================================

View file

@ -406,7 +406,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MntrFloorFire)
self->z = self->floorz;
x = self->x + (pr_fire.Random2 () << 10);
y = self->y + (pr_fire.Random2 () << 10);
mo = Spawn("MinotaurFX3", x, y, ONFLOORZ, ALLOW_REPLACE);
mo = Spawn("MinotaurFX3", x, y, self->floorz, ALLOW_REPLACE);
mo->target = self->target;
mo->momx = 1; // Force block checking
P_CheckMissileSpawn (mo);

View file

@ -105,7 +105,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpotLightning)
if (self->target == NULL)
return;
spot = Spawn("SpectralLightningSpot", self->target->x, self->target->y, ONFLOORZ, ALLOW_REPLACE);
spot = Spawn("SpectralLightningSpot", self->target->x, self->target->y, self->target->floorz, ALLOW_REPLACE);
if (spot != NULL)
{
spot->threshold = 25;

View file

@ -75,7 +75,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Beacon)
AActor *rebel;
angle_t an;
rebel = Spawn("Rebel1", self->x, self->y, ONFLOORZ, ALLOW_REPLACE);
rebel = Spawn("Rebel1", self->x, self->y, self->floorz, ALLOW_REPLACE);
if (!P_TryMove (rebel, rebel->x, rebel->y, true))
{
rebel->Destroy ();

View file

@ -904,7 +904,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1)
P_BulletSlope (self, &linetarget);
if (linetarget != NULL)
{
spot = Spawn("SpectralLightningSpot", linetarget->x, linetarget->y, ONFLOORZ, ALLOW_REPLACE);
spot = Spawn("SpectralLightningSpot", linetarget->x, linetarget->y, linetarget->floorz, ALLOW_REPLACE);
if (spot != NULL)
{
spot->tracer = linetarget;

View file

@ -4456,6 +4456,26 @@ void P_PlaySpawnSound(AActor *missile, AActor *spawner)
}
}
static AActor * SpawnMissile (const PClass *type, fixed_t x, fixed_t y, fixed_t z)
{
AActor *th = Spawn (type, x, y, z, ALLOW_REPLACE);
if (th != NULL)
{
// Force floor huggers to the floor and ceiling huggers to the ceiling
if (th->flags3 & MF3_FLOORHUGGER)
{
z = th->floorz;
}
else if (th->flags3 & MF3_CEILINGHUGGER)
{
z = th->ceilingz - th->height;
}
}
return th;
}
//---------------------------------------------------------------------------
//
// FUNC P_SpawnMissile
@ -4485,22 +4505,13 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
type->TypeName.GetChars(), source->GetClass()->TypeName.GetChars());
return NULL;
}
int defflags3 = GetDefaultByType (type)->flags3;
if (defflags3 & MF3_FLOORHUGGER)
{
z = ONFLOORZ;
}
else if (defflags3 & MF3_CEILINGHUGGER)
{
z = ONCEILINGZ;
}
else if (z != ONFLOORZ)
if (z != ONFLOORZ && z != ONCEILINGZ)
{
z -= source->floorclip;
}
AActor *th = Spawn (type, x, y, z, ALLOW_REPLACE);
AActor *th = SpawnMissile (type, x, y, z);
P_PlaySpawnSound(th, source);
th->target = source; // record missile's originator
@ -4515,7 +4526,7 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
FVector3 velocity(dest->x - source->x, dest->y - source->y, dest->z - source->z);
// Floor and ceiling huggers should never have a vertical component to their velocity
if (defflags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))
if (th->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))
{
velocity.Z = 0;
}
@ -4609,21 +4620,14 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
const PClass *type, angle_t angle, fixed_t momz, fixed_t speed, AActor *owner, bool checkspawn)
{
AActor *mo;
int defflags3 = GetDefaultByType (type)->flags3;
if (defflags3 & MF3_FLOORHUGGER)
{
z = ONFLOORZ;
}
else if (defflags3 & MF3_CEILINGHUGGER)
{
z = ONCEILINGZ;
}
if (z != ONFLOORZ)
if (z != ONFLOORZ && z != ONCEILINGZ && source != NULL)
{
z -= source->floorclip;
}
mo = Spawn (type, source->x, source->y, z, ALLOW_REPLACE);
mo = SpawnMissile (type, source->x, source->y, z);
P_PlaySpawnSound(mo, source);
mo->target = owner != NULL ? owner : source; // Originator
mo->angle = angle;

View file

@ -1,13 +1,14 @@
#ifndef __TEXTURES_H
#define __TEXTURES_H
#include "basictypes.h"
#include "doomtype.h"
class FBitmap;
struct FRemapTable;
struct FCopyInfo;
class FScanner;
struct PClass;
class FArchive;
// Texture IDs
class FTextureManager;