Merge commit 'fb9231a38d' into scripting
Conflicts: src/info.cpp src/thingdef/thingdef_expression.cpp wadsrc/static/actors/constants.txt (Scripting branch update part 2)
This commit is contained in:
commit
d6e3fc0567
76 changed files with 562 additions and 312 deletions
|
|
@ -2072,13 +2072,9 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
{
|
||||
bool tg = (mo->target != NULL);
|
||||
bool blockingtg = (BlockingMobj->target != NULL);
|
||||
if (BlockingMobj->flags7 & MF7_AIMREFLECT && (tg || blockingtg))
|
||||
if ((BlockingMobj->flags7 & MF7_AIMREFLECT) && (tg | blockingtg))
|
||||
{
|
||||
AActor *origin;
|
||||
if (tg)
|
||||
origin = mo->target;
|
||||
else if (blockingtg)
|
||||
origin = BlockingMobj->target;
|
||||
AActor *origin = tg ? mo->target : BlockingMobj->target;
|
||||
|
||||
float speed = (float)(mo->Speed);
|
||||
//dest->x - source->x
|
||||
|
|
@ -2090,7 +2086,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (BlockingMobj->flags7 & MF7_MIRRORREFLECT && (tg || blockingtg))
|
||||
if ((BlockingMobj->flags7 & MF7_MIRRORREFLECT) && (tg | blockingtg))
|
||||
{
|
||||
mo->angle += ANGLE_180;
|
||||
mo->velx = -mo->velx / 2;
|
||||
|
|
@ -2413,6 +2409,16 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
|||
}
|
||||
}
|
||||
|
||||
// Hexen compatibility handling for floatbobbing. Ugh...
|
||||
// Hexen yanked all items to the floor, except those being spawned at map start in the air.
|
||||
// Those were kept at their original height.
|
||||
// Do this only if the item was actually spawned by the map above ground to avoid problems.
|
||||
if (mo->special1 > 0 && (mo->flags2 & MF2_FLOATBOB) && (ib_compatflags & BCOMPATF_FLOATBOB))
|
||||
{
|
||||
mo->z = mo->floorz + mo->special1;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// adjust height
|
||||
//
|
||||
|
|
@ -2715,8 +2721,6 @@ void P_NightmareRespawn (AActor *mobj)
|
|||
z = ONCEILINGZ;
|
||||
else if (info->flags2 & MF2_SPAWNFLOAT)
|
||||
z = FLOATRANDZ;
|
||||
else if (info->flags2 & MF2_FLOATBOB)
|
||||
z = mobj->SpawnPoint[2];
|
||||
else
|
||||
z = ONFLOORZ;
|
||||
|
||||
|
|
@ -3604,11 +3608,13 @@ void AActor::Tick ()
|
|||
velz <= 0 &&
|
||||
floorz == z)
|
||||
{
|
||||
secplane_t floorplane = floorsector->floorplane;
|
||||
secplane_t floorplane;
|
||||
|
||||
#ifdef _3DFLOORS
|
||||
// Check 3D floors as well
|
||||
floorplane = P_FindFloorPlane(floorsector, x, y, floorz);
|
||||
#else
|
||||
floorplane = floorsector->floorplane;
|
||||
#endif
|
||||
|
||||
if (floorplane.c < STEEPSLOPE &&
|
||||
|
|
@ -4587,7 +4593,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
|||
p->mo->ResetAirSupply(false);
|
||||
p->Uncrouch();
|
||||
p->MinPitch = p->MaxPitch = 0; // will be filled in by PostBeginPlay()/netcode
|
||||
p->cheats &= ~CF_FLY;
|
||||
|
||||
|
||||
p->velx = p->vely = 0; // killough 10/98: initialize bobbing to 0.
|
||||
|
||||
|
|
@ -4981,7 +4987,13 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
|||
mobj = AActor::StaticSpawn (i, x, y, z, NO_REPLACE, true);
|
||||
|
||||
if (z == ONFLOORZ)
|
||||
{
|
||||
mobj->z += mthing->z;
|
||||
if ((mobj->flags2 & MF2_FLOATBOB) && (ib_compatflags & BCOMPATF_FLOATBOB))
|
||||
{
|
||||
mobj->special1 = mthing->z;
|
||||
}
|
||||
}
|
||||
else if (z == ONCEILINGZ)
|
||||
mobj->z -= mthing->z;
|
||||
|
||||
|
|
@ -4994,7 +5006,11 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
|||
else if (mthing->gravity > 0) mobj->gravity = FixedMul(mobj->gravity, mthing->gravity);
|
||||
else mobj->flags &= ~MF_NOGRAVITY;
|
||||
|
||||
P_FindFloorCeiling(mobj, FFCF_SAMESECTOR | FFCF_ONLY3DFLOORS | FFCF_3DRESTRICT);
|
||||
// For Hexen floatbob 'compatibility' we do not really want to alter the floorz.
|
||||
if (mobj->special1 == 0 || !(mobj->flags2 & MF2_FLOATBOB) || !(ib_compatflags & BCOMPATF_FLOATBOB))
|
||||
{
|
||||
P_FindFloorCeiling(mobj, FFCF_SAMESECTOR | FFCF_ONLY3DFLOORS | FFCF_3DRESTRICT);
|
||||
}
|
||||
|
||||
if (!(mobj->flags2 & MF2_ARGSDEFINED))
|
||||
{
|
||||
|
|
@ -5743,18 +5759,31 @@ static fixed_t GetDefaultSpeed(PClassActor *type)
|
|||
|
||||
AActor *P_SpawnMissile (AActor *source, AActor *dest, PClassActor *type, AActor *owner)
|
||||
{
|
||||
if (source == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return P_SpawnMissileXYZ (source->x, source->y, source->z + 32*FRACUNIT + source->GetBobOffset(),
|
||||
source, dest, type, true, owner);
|
||||
}
|
||||
|
||||
AActor *P_SpawnMissileZ (AActor *source, fixed_t z, AActor *dest, PClassActor *type)
|
||||
{
|
||||
if (source == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return P_SpawnMissileXYZ (source->x, source->y, z, source, dest, type);
|
||||
}
|
||||
|
||||
AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
||||
AActor *source, AActor *dest, PClassActor *type, bool checkspawn, AActor *owner)
|
||||
{
|
||||
if (source == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (dest == NULL)
|
||||
{
|
||||
Printf ("P_SpawnMissilyXYZ: Tried to shoot %s from %s with no dest\n",
|
||||
|
|
@ -5824,6 +5853,10 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
|||
|
||||
AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassActor *type)
|
||||
{
|
||||
if (source == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
angle_t an;
|
||||
fixed_t dist;
|
||||
AActor *th = Spawn (type, source->x, source->y, source->z + 4*8*FRACUNIT, ALLOW_REPLACE);
|
||||
|
|
@ -5865,6 +5898,10 @@ AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassAct
|
|||
AActor *P_SpawnMissileAngle (AActor *source, PClassActor *type,
|
||||
angle_t angle, fixed_t velz)
|
||||
{
|
||||
if (source == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT + source->GetBobOffset(),
|
||||
type, angle, velz, GetDefaultSpeed (type));
|
||||
}
|
||||
|
|
@ -5878,6 +5915,10 @@ AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z,
|
|||
|
||||
AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, PClassActor *type)
|
||||
{
|
||||
if (source == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
angle_t an;
|
||||
fixed_t dist;
|
||||
fixed_t speed;
|
||||
|
|
@ -5908,6 +5949,10 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, PClassAct
|
|||
AActor *P_SpawnMissileAngleSpeed (AActor *source, PClassActor *type,
|
||||
angle_t angle, fixed_t velz, fixed_t speed)
|
||||
{
|
||||
if (source == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT + source->GetBobOffset(),
|
||||
type, angle, velz, speed);
|
||||
}
|
||||
|
|
@ -5915,9 +5960,13 @@ AActor *P_SpawnMissileAngleSpeed (AActor *source, PClassActor *type,
|
|||
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
||||
PClassActor *type, angle_t angle, fixed_t velz, fixed_t speed, AActor *owner, bool checkspawn)
|
||||
{
|
||||
if (source == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
AActor *mo;
|
||||
|
||||
if (z != ONFLOORZ && z != ONCEILINGZ && source != NULL)
|
||||
if (z != ONFLOORZ && z != ONCEILINGZ)
|
||||
{
|
||||
z -= source->floorclip;
|
||||
}
|
||||
|
|
@ -5952,6 +6001,10 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
|||
|
||||
AActor *P_SpawnPlayerMissile (AActor *source, PClassActor *type)
|
||||
{
|
||||
if (source == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return P_SpawnPlayerMissile (source, 0, 0, 0, type, source->angle);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue