- Fixed: When a weapon is destroyed, its sister weapon must also be destroyed.

- Added a check for PUFFGETSOWNER to A_BFGSpray.
- Moved the PUFFGETSOWNER check into P_SpawnPuff and removed the limitation
  to players only.
- Fixed: P_SpawnMapThing still checked FMapThing::flags for the class bits 
  instead of FMapThing::ClassFilter.
- Fixed: A_CustomMissile must not let P_SpawnMissile call P_CheckMissileSpawn.
  It must do this itself after setting the proper owner.
- Fixed: CCMD(give) increased the total item count.
- Fixed: A_Stop didn't set the player specific variables to 0.


SVN r1066 (trunk)
This commit is contained in:
Christoph Oelckers 2008-07-05 10:17:10 +00:00
parent 860b9254ef
commit d2f1515aa6
13 changed files with 76 additions and 26 deletions

View file

@ -1,3 +1,15 @@
July 5, 2008 (Changes by Graf Zahl)
- Fixed: When a weapon is destroyed, its sister weapon must also be destroyed.
- Added a check for PUFFGETSOWNER to A_BFGSpray.
- Moved the PUFFGETSOWNER check into P_SpawnPuff and removed the limitation
to players only.
- Fixed: P_SpawnMapThing still checked FMapThing::flags for the class bits
instead of FMapThing::ClassFilter.
- Fixed: A_CustomMissile must not let P_SpawnMissile call P_CheckMissileSpawn.
It must do this itself after setting the proper owner.
- Fixed: CCMD(give) increased the total item count.
- Fixed: A_Stop didn't set the player specific variables to 0.
July 4, 2008
- Fixed: Screenwipes now pause sounds, since there can be sounds playing
during it.

View file

@ -529,9 +529,13 @@ void A_BFGSpray (AActor *mo)
if (!linetarget)
continue;
Spawn (spraytype, linetarget->x, linetarget->y,
AActor *spray = Spawn (spraytype, linetarget->x, linetarget->y,
linetarget->z + (linetarget->height>>2), ALLOW_REPLACE);
if (spray && (spray->flags5 & MF5_PUFFGETSOWNER))
spray->target = mo->target;
damage = 0;
for (j = 0; j < damagecnt; ++j)
damage += (pr_bfgspray() & 7) + 1;

View file

@ -57,7 +57,7 @@ void A_Tracer (AActor *self)
return;
// spawn a puff of smoke behind the rocket
P_SpawnPuff (PClass::FindClass(NAME_BulletPuff), self->x, self->y, self->z, 0, 3);
P_SpawnPuff (self, PClass::FindClass(NAME_BulletPuff), self->x, self->y, self->z, 0, 3);
smoke = Spawn ("RevenantTracerSmoke", self->x - self->momx,
self->y - self->momy, self->z, ALLOW_REPLACE);

View file

@ -1116,6 +1116,8 @@ void APowerWeaponLevel2::InitEffect ()
if (!(sister->WeaponFlags & WIF_POWERED_UP))
return;
assert (sister->SisterWeapon == weapon);
Owner->player->ReadyWeapon = sister;
if (weapon->GetReadyState() != sister->GetReadyState())

View file

@ -107,6 +107,23 @@ bool AWeapon::Use (bool pickup)
return false;
}
//===========================================================================
//
// AWeapon :: Destroy
//
//===========================================================================
FState *AWeapon::Destroy()
{
if (SisterWeapon != NULL)
{
// avoid recursion
SisterWeapon->SisterWeapon = NULL;
SisterWeapon->Destroy();
}
Super::Destroy();
}
//===========================================================================
//
// AWeapon :: HandlePickup
@ -197,6 +214,7 @@ AInventory *AWeapon::CreateTossable ()
// If this weapon has a sister, remove it from the inventory too.
if (SisterWeapon != NULL)
{
SisterWeapon->SisterWeapon = NULL;
SisterWeapon->Destroy ();
}
// To avoid exploits, the tossed weapon must not have any ammo.

View file

@ -934,7 +934,7 @@ void A_RocketInFlight (AActor *self)
AActor *trail;
S_Sound (self, CHAN_VOICE, "misc/missileinflight", 1, ATTN_NORM);
P_SpawnPuff (RUNTIME_CLASS(AMiniMissilePuff), self->x, self->y, self->z, self->angle - ANGLE_180, 2, PF_HITTHING);
P_SpawnPuff (self, RUNTIME_CLASS(AMiniMissilePuff), self->x, self->y, self->z, self->angle - ANGLE_180, 2, PF_HITTHING);
trail = Spawn<ARocketTrail> (self->x - self->momx, self->y - self->momy, self->z, ALLOW_REPLACE);
if (trail != NULL)
{

View file

@ -487,6 +487,11 @@ void GiveSpawner (player_t *player, const PClass *type, int amount)
item->Amount = MIN (amount, item->MaxAmount);
}
}
if(item->flags & MF_COUNTITEM) // Given items shouldn't count against the map's total,
{ // since they aren't added to the player's total.
level.total_items--;
item->flags &= ~MF_COUNTITEM;
}
if (!item->TryPickup (player->mo))
{
item->Destroy ();

View file

@ -100,7 +100,7 @@ enum EPuffFlags
PF_TEMPORARY = 4
};
AActor *P_SpawnPuff (const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, angle_t dir, int updown, int flags = 0);
AActor *P_SpawnPuff (AActor *source, const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, angle_t dir, int updown, int flags = 0);
void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AActor *originator);
void P_BloodSplatter (fixed_t x, fixed_t y, fixed_t z, AActor *originator);
void P_BloodSplatter2 (fixed_t x, fixed_t y, fixed_t z, AActor *originator);
@ -110,11 +110,11 @@ void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target);
AActor *P_SpawnMissile (AActor* source, AActor* dest, const PClass *type);
AActor *P_SpawnMissileZ (AActor* source, fixed_t z, AActor* dest, const PClass *type);
AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, AActor *source, AActor *dest, const PClass *type);
AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, AActor *source, AActor *dest, const PClass *type, bool checkspawn = true);
AActor *P_SpawnMissileAngle (AActor *source, const PClass *type, angle_t angle, fixed_t momz);
AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type, angle_t angle, fixed_t momz, fixed_t speed);
AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z, const PClass *type, angle_t angle, fixed_t momz);
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, const PClass *type, angle_t angle, fixed_t momz, fixed_t speed, AActor *owner=NULL);
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, const PClass *type, angle_t angle, fixed_t momz, fixed_t speed, AActor *owner=NULL, bool checkspawn = true);
AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PClass *type);
AActor *P_SpawnPlayerMissile (AActor* source, const PClass *type);

View file

@ -2642,7 +2642,7 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
}
if (puffDefaults->flags3 & MF3_ALWAYSPUFF)
{ // Spawn the puff anyway
puff = P_SpawnPuff (pufftype, trace.X, trace.Y, trace.Z, angle - ANG180, 2, flags);
puff = P_SpawnPuff (t1, pufftype, trace.X, trace.Y, trace.Z, angle - ANG180, 2, flags);
}
else
{
@ -2659,7 +2659,7 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
if (trace.HitType != TRACE_HitWall || trace.Line->special != Line_Horizon)
{
fixed_t closer = trace.Distance - 4*FRACUNIT;
puff = P_SpawnPuff (pufftype, t1->x + FixedMul (vx, closer),
puff = P_SpawnPuff (t1, pufftype, t1->x + FixedMul (vx, closer),
t1->y + FixedMul (vy, closer),
shootz + FixedMul (vz, closer), angle - ANG90, 0, flags);
}
@ -2714,7 +2714,7 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
(trace.Actor->flags & MF_NOBLOOD) ||
(trace.Actor->flags2 & (MF2_INVULNERABLE|MF2_DORMANT)))
{
puff = P_SpawnPuff (pufftype, hitx, hity, hitz, angle - ANG180, 2, flags|PF_HITTHING);
puff = P_SpawnPuff (t1, pufftype, hitx, hity, hitz, angle - ANG180, 2, flags|PF_HITTHING);
}
if (!(GetDefaultByType(pufftype)->flags3&MF3_BLOODLESSIMPACT))
{
@ -2761,7 +2761,7 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
{
// Since the puff is the damage inflictor we need it here
// regardless of whether it is displayed or not.
puff = P_SpawnPuff (pufftype, hitx, hity, hitz, angle - ANG180, 2, flags|PF_HITTHING|PF_TEMPORARY);
puff = P_SpawnPuff (t1, pufftype, hitx, hity, hitz, angle - ANG180, 2, flags|PF_HITTHING|PF_TEMPORARY);
killPuff = true;
}
P_DamageMobj (trace.Actor, puff ? puff : t1, t1, damage, damageType, flags);
@ -2772,7 +2772,7 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
if (puff == NULL)
{ // Spawn puff just to get a mass for the splash
puff = P_SpawnPuff (pufftype, hitx, hity, hitz, angle - ANG180, 2, flags|PF_HITTHING|PF_TEMPORARY);
puff = P_SpawnPuff (t1, pufftype, hitx, hity, hitz, angle - ANG180, 2, flags|PF_HITTHING|PF_TEMPORARY);
killPuff = true;
}
SpawnDeepSplash (t1, trace, puff, vx, vy, vz, shootz);
@ -2783,9 +2783,6 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
puff->Destroy();
puff = NULL;
}
// [BB] If the puff came from a player, set the target of the puff to this player.
if ( puff && (puff->flags5 & MF5_PUFFGETSOWNER) && t1 && t1->player )
puff->target = t1;
return puff;
}
@ -3066,7 +3063,7 @@ void P_RailAttack (AActor *source, int damage, int offset, int color1, int color
if ((RailHits[i].HitActor->flags & MF_NOBLOOD) ||
(RailHits[i].HitActor->flags2 & (MF2_DORMANT|MF2_INVULNERABLE)))
{
if (puffclass != NULL) P_SpawnPuff (puffclass, x, y, z, source->angle - ANG180, 1, PF_HITTHING);
if (puffclass != NULL) P_SpawnPuff (source, puffclass, x, y, z, source->angle - ANG180, 1, PF_HITTHING);
}
else
{

View file

@ -3847,7 +3847,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
mask = -1;
}
}
if (mask != -1 && (mthing->flags & mask) == 0)
if (mask != -1 && (mthing->ClassFilter & mask) == 0)
{
return NULL;
}
@ -4040,13 +4040,14 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
// P_SpawnPuff
//
AActor *P_SpawnPuff (const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, angle_t dir, int updown, int flags)
AActor *P_SpawnPuff (AActor *source, const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, angle_t dir, int updown, int flags)
{
AActor *puff;
z += pr_spawnpuff.Random2 () << 10;
puff = Spawn (pufftype, x, y, z, ALLOW_REPLACE);
if (puff == NULL) return NULL;
// If a puff has a crash state and an actor was not hit,
// it will enter the crash state. This is used by the StrifeSpark
@ -4081,6 +4082,10 @@ AActor *P_SpawnPuff (const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, an
}
}
// [BB] If the puff came from a player, set the target of the puff to this player.
if ( puff && (puff->flags5 & MF5_PUFFGETSOWNER))
puff->target = source;
return puff;
}
@ -4517,7 +4522,7 @@ AActor *P_SpawnMissileZ (AActor *source, fixed_t z, AActor *dest, const PClass *
}
AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
AActor *source, AActor *dest, const PClass *type)
AActor *source, AActor *dest, const PClass *type, bool checkspawn)
{
if (dest == NULL)
{
@ -4583,7 +4588,7 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
th->angle = R_PointToAngle2 (0, 0, th->momx, th->momy);
return P_CheckMissileSpawn (th) ? th : NULL;
return (!checkspawn || P_CheckMissileSpawn (th)) ? th : NULL;
}
//---------------------------------------------------------------------------
@ -4646,7 +4651,7 @@ AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type,
}
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
const PClass *type, angle_t angle, fixed_t momz, fixed_t speed, AActor *owner)
const PClass *type, angle_t angle, fixed_t momz, fixed_t speed, AActor *owner, bool checkspawn)
{
AActor *mo;
int defflags3 = GetDefaultByType (type)->flags3;
@ -4671,7 +4676,7 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
mo->momx = FixedMul (speed, finecosine[angle]);
mo->momy = FixedMul (speed, finesine[angle]);
mo->momz = momz;
return P_CheckMissileSpawn(mo) ? mo : NULL;
return (!checkspawn || P_CheckMissileSpawn(mo)) ? mo : NULL;
}
/*

View file

@ -56,7 +56,7 @@
// MACROS ------------------------------------------------------------------
// The maximum number of functions that can be registered with atterm.
#define MAX_TERMS 32
#define MAX_TERMS 64
// TYPES -------------------------------------------------------------------

View file

@ -739,20 +739,20 @@ void A_CustomMissile(AActor * self)
self->x+=x;
self->y+=y;
self->z+=z;
missile = P_SpawnMissile(self, self->target, ti);
missile = P_SpawnMissileXYZ(self->x, self->y, self->z + 32*FRACUNIT, self, self->target, ti, false);
self->x-=x;
self->y-=y;
self->z-=z;
break;
case 1:
missile = P_SpawnMissileXYZ(self->x+x, self->y+y, self->z+SpawnHeight, self, self->target, ti);
missile = P_SpawnMissileXYZ(self->x+x, self->y+y, self->z+SpawnHeight, self, self->target, ti, false);
break;
case 2:
self->x+=x;
self->y+=y;
missile = P_SpawnMissileAngleZ(self, self->z+SpawnHeight, ti, self->angle, 0);
missile = P_SpawnMissileAngleZSpeed(self, self->z+SpawnHeight, ti, self->angle, 0, GetDefaultByType(ti)->Speed, self, false);
self->x-=x;
self->y-=y;
@ -811,6 +811,7 @@ void A_CustomMissile(AActor * self)
{
missile->health=-2;
}
P_CheckMissileSpawn(missile);
}
}
}
@ -2034,6 +2035,12 @@ void A_CheckFloor (AActor *self)
void A_Stop (AActor *self)
{
self->momx = self->momy = self->momz = 0;
if (self->player && self->player->mo == self && !(self->player->cheats & CF_PREDICTING))
{
self->player->mo->PlayIdle ();
self->player->momx = self->player->momy = 0;
}
}
//===========================================================================

View file

@ -92,7 +92,7 @@
#define WINDOW_TITLE GAMESIG " " DOTVERSIONSTR X64 " (" __DATE__ ")"
// The maximum number of functions that can be registered with atterm.
#define MAX_TERMS 32
#define MAX_TERMS 64
// TYPES -------------------------------------------------------------------