SVN r258 (trunk)

This commit is contained in:
Christoph Oelckers 2006-07-16 09:10:45 +00:00
commit ecce60e8f9
90 changed files with 326 additions and 309 deletions

View file

@ -100,19 +100,22 @@ void A_NoBlocking (AActor *actor)
{
FDropItem *di = GetDropItems(actor);
while (di != NULL)
if (di != NULL)
{
if (di->Name != NAME_None)
while (di != NULL)
{
const PClass *ti = PClass::FindClass(di->Name);
if (ti) P_DropItem (actor, ti, di->amount, di->probability);
if (di->Name != NAME_None)
{
const PClass *ti = PClass::FindClass(di->Name);
if (ti) P_DropItem (actor, ti, di->amount, di->probability);
}
di = di->Next;
}
di = di->Next;
}
}
else
{
actor->NoBlockingSet ();
else
{
actor->NoBlockingSet ();
}
}
}
@ -260,7 +263,7 @@ void A_FreezeDeathChunks (AActor *actor)
mo = Spawn<AIceChunk> (
actor->x + (((pr_freeze()-128)*actor->radius)>>7),
actor->y + (((pr_freeze()-128)*actor->radius)>>7),
actor->z + (pr_freeze()*actor->height/255));
actor->z + (pr_freeze()*actor->height/255), ALLOW_REPLACE);
mo->SetState (mo->SpawnState + (pr_freeze()%3));
if (mo)
{
@ -274,7 +277,8 @@ void A_FreezeDeathChunks (AActor *actor)
}
if (actor->player)
{ // attach the player's view to a chunk of ice
AIceChunkHead *head = Spawn<AIceChunkHead> (actor->x, actor->y, actor->z + actor->player->mo->ViewHeight);
AIceChunkHead *head = Spawn<AIceChunkHead> (actor->x, actor->y,
actor->z + actor->player->mo->ViewHeight, ALLOW_REPLACE);
head->momz = FixedDiv(head->z-actor->z, actor->height)<<2;
head->momx = pr_freeze.Random2 () << (FRACBITS-7);
head->momy = pr_freeze.Random2 () << (FRACBITS-7);

View file

@ -42,7 +42,7 @@ IMPLEMENT_ABSTRACT_ACTOR (APowerup)
bool APowerupGiver::Use (bool pickup)
{
APowerup *power = static_cast<APowerup *> (Spawn (PowerupType, 0, 0, 0));
APowerup *power = static_cast<APowerup *> (Spawn (PowerupType, 0, 0, 0, NO_REPLACE));
if (EffectTics != 0)
{
@ -966,7 +966,7 @@ void APowerSpeed::DoEffect ()
if (P_AproxDistance (Owner->momx, Owner->momy) <= 12*FRACUNIT)
return;
AActor *speedMo = Spawn<APlayerSpeedTrail> (Owner->x, Owner->y, Owner->z);
AActor *speedMo = Spawn<APlayerSpeedTrail> (Owner->x, Owner->y, Owner->z, NO_REPLACE);
if (speedMo)
{
speedMo->angle = Owner->angle;

View file

@ -124,15 +124,15 @@ void A_BridgeInit (AActor *self)
self->special1 = 0;
// Spawn triad into world
ball1 = Spawn<ABridgeBall> (cx, cy, cz);
ball1 = Spawn<ABridgeBall> (cx, cy, cz, ALLOW_REPLACE);
ball1->angle = startangle;
ball1->target = self;
ball2 = Spawn<ABridgeBall> (cx, cy, cz);
ball2 = Spawn<ABridgeBall> (cx, cy, cz, ALLOW_REPLACE);
ball2->angle = startangle + ANGLE_45/32*85;
ball2->target = self;
ball3 = Spawn<ABridgeBall> (cx, cy, cz);
ball3 = Spawn<ABridgeBall> (cx, cy, cz, ALLOW_REPLACE);
ball3->angle = startangle + (angle_t)ANGLE_45/32*170;
ball3->target = self;

View file

@ -45,7 +45,7 @@ void P_SpawnDirt (AActor *actor, fixed_t radius)
dtype = PClass::FindClass(fmt);
if (dtype)
{
mo = Spawn (dtype, x, y, z);
mo = Spawn (dtype, x, y, z, ALLOW_REPLACE);
if (mo)
{
mo->momz = pr_dirt()<<10;

View file

@ -144,16 +144,12 @@ AInventory *AAmmo::CreateCopy (AActor *other)
{
const PClass *type = GetParentAmmo();
assert (type->ActorInfo != NULL);
FActorInfo *replacesave = type->ActorInfo->Replacement;
if (!GoAway ())
{
Destroy ();
}
// If the base ammo class has a replacement defined, the replacement
// must not be used in the inventory.
type->ActorInfo->Replacement = NULL;
copy = static_cast<AInventory *>(Spawn (type, 0, 0, 0));
type->ActorInfo->Replacement = replacesave;
copy = static_cast<AInventory *>(Spawn (type, 0, 0, 0, NO_REPLACE));
copy->Amount = amount;
copy->BecomeItem ();
}
@ -318,7 +314,7 @@ void A_RestoreSpecialDoomThing (AActor *self)
{
self->SetState (self->SpawnState);
S_Sound (self, CHAN_VOICE, "misc/spawn", 1, ATTN_IDLE);
Spawn<AItemFog> (self->x, self->y, self->z);
Spawn<AItemFog> (self->x, self->y, self->z, ALLOW_REPLACE);
}
}
@ -594,7 +590,7 @@ bool AInventory::GoAway ()
{
if (ItemFlags & IF_PICKUPFLASH)
{
Spawn<APickupFlash> (x, y, z);
Spawn<APickupFlash> (x, y, z, ALLOW_REPLACE);
}
return false;
}
@ -603,7 +599,7 @@ bool AInventory::GoAway ()
{
if (ItemFlags & IF_PICKUPFLASH)
{
Spawn<APickupFlash> (x, y, z);
Spawn<APickupFlash> (x, y, z, ALLOW_REPLACE);
}
Hide ();
if (ShouldRespawn ())
@ -649,7 +645,7 @@ AInventory *AInventory::CreateCopy (AActor *other)
if (GoAway ())
{
copy = static_cast<AInventory *>(Spawn (GetClass(), 0, 0, 0));
copy = static_cast<AInventory *>(Spawn (GetClass(), 0, 0, 0, NO_REPLACE));
copy->Amount = Amount;
copy->MaxAmount = MaxAmount;
}
@ -693,7 +689,7 @@ AInventory *AInventory::CreateTossable ()
return this;
}
copy = static_cast<AInventory *>(Spawn (GetClass(), Owner->x,
Owner->y, Owner->z));
Owner->y, Owner->z, NO_REPLACE));
if (copy != NULL)
{
copy->MaxAmount = MaxAmount;
@ -1365,7 +1361,7 @@ bool ABasicArmorPickup::Use (bool pickup)
if (armor == NULL)
{
armor = Spawn<ABasicArmor> (0,0,0);
armor = Spawn<ABasicArmor> (0,0,0, NO_REPLACE);
armor->BecomeItem ();
armor->SavePercent = SavePercent;
armor->Amount = armor->MaxAmount = SaveAmount;
@ -1436,7 +1432,7 @@ bool ABasicArmorBonus::Use (bool pickup)
}
if (armor == NULL)
{
armor = Spawn<ABasicArmor> (0,0,0);
armor = Spawn<ABasicArmor> (0,0,0, NO_REPLACE);
armor->BecomeItem ();
armor->SavePercent = SavePercent;
armor->Amount = saveAmount;
@ -1518,7 +1514,7 @@ AInventory *ABasicArmor::CreateCopy (AActor *other)
{
// BasicArmor that is in use is stored in the inventory as BasicArmor.
// BasicArmor that is in reserve is not.
ABasicArmor *copy = Spawn<ABasicArmor> (0, 0, 0);
ABasicArmor *copy = Spawn<ABasicArmor> (0, 0, 0, NO_REPLACE);
copy->SavePercent = SavePercent != 0 ? SavePercent : FRACUNIT/3;
copy->Amount = Amount;
copy->MaxAmount = MaxAmount;
@ -1622,7 +1618,7 @@ AInventory *AHexenArmor::CreateCopy (AActor *other)
// Like BasicArmor, HexenArmor is used in the inventory but not the map.
// health is the slot this armor occupies.
// Amount is the quantity to give (0 = normal max).
AHexenArmor *copy = Spawn<AHexenArmor> (0, 0, 0);
AHexenArmor *copy = Spawn<AHexenArmor> (0, 0, 0, NO_REPLACE);
copy->AddArmorToSlot (other, health, Amount);
GoAwayAndDie ();
return copy;
@ -1948,7 +1944,7 @@ AInventory *ABackpack::CreateCopy (AActor *other)
AAmmo *ammo = static_cast<AAmmo *>(other->FindInventory (type));
if (ammo == NULL)
{ // The player did not have the ammo. Add it.
ammo = static_cast<AAmmo *>(Spawn (type, 0, 0, 0));
ammo = static_cast<AAmmo *>(Spawn (type, 0, 0, 0, NO_REPLACE));
ammo->Amount = bDepleted ? 0 : ammo->BackpackAmount;
ammo->MaxAmount = ammo->BackpackMaxAmount;
ammo->AttachToOwner (other);

View file

@ -147,7 +147,7 @@ void ASoundSequence::PostBeginPlay ()
}
if (master == NULL)
{
master = Spawn<ASoundSequenceSlot> (0, 0, 0);
master = Spawn<ASoundSequenceSlot> (0, 0, 0, NO_REPLACE);
master->Sequence = SN_StartSequence (master, slot, 0);
}
master->Sequence->AddChoice (args[0], SEQ_ENVIRONMENT);

View file

@ -64,7 +64,7 @@ bool AWeaponPiece::TryPickup (AActor *toucher)
}
if (!hold)
{
hold=static_cast<AWeaponHolder*>(Spawn(RUNTIME_CLASS(AWeaponHolder), 0, 0, 0));
hold=static_cast<AWeaponHolder*>(Spawn(RUNTIME_CLASS(AWeaponHolder), 0, 0, 0, NO_REPLACE));
hold->BecomeItem();
hold->AttachToOwner(toucher);
hold->PieceMask=0;
@ -105,7 +105,7 @@ bool AWeaponPiece::TryPickup (AActor *toucher)
{
if (!toucher->FindInventory (WeaponClass))
{
FullWeapon= static_cast<AWeapon*>(Spawn(WeaponClass, 0, 0, 0));
FullWeapon= static_cast<AWeapon*>(Spawn(WeaponClass, 0, 0, 0, NO_REPLACE));
// The weapon itself should not give more ammo to the player!
FullWeapon->AmmoGive1=0;

View file

@ -253,7 +253,7 @@ AAmmo *AWeapon::AddAmmo (AActor *other, const PClass *ammotype, int amount)
ammo = static_cast<AAmmo *>(other->FindInventory (ammotype));
if (ammo == NULL)
{
ammo = static_cast<AAmmo *>(Spawn (ammotype, 0, 0, 0));
ammo = static_cast<AAmmo *>(Spawn (ammotype, 0, 0, 0, NO_REPLACE));
ammo->Amount = MIN (amount, ammo->MaxAmount);
ammo->AttachToOwner (other);
}
@ -309,7 +309,7 @@ AWeapon *AWeapon::AddWeapon (const PClass *weapontype)
weap = static_cast<AWeapon *>(Owner->FindInventory (weapontype));
if (weap == NULL)
{
weap = static_cast<AWeapon *>(Spawn (weapontype, 0, 0, 0));
weap = static_cast<AWeapon *>(Spawn (weapontype, 0, 0, 0, NO_REPLACE));
weap->AttachToOwner (Owner);
}
return weap;