diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a07fddd4c..92663c9c2 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,16 @@ +July 16, 2006 (Changes by Graf Zahl) +- Fixed: PlayerStartItem created a duplicate of the item's class name before + converting it into an FName. +- Removed game check for Doom from P_BloodSplatter. The BloodSplatter actor + is compatible with all games now so the explicit handling is no longer needed. +- Moved replacement handling back into AActor::StaticSpawn but controlled + by a (mandatory) parameter. Also added replacement to most other + instances in the game where non-inventory items are spawned. Replacement is safe + nearly everywhere except for inventory related spawns. +- Fixed: Due to the player class inclusion A_NoBlocking never called + NoBlockingSet for monsters. +- Changed: Sounds can be specified by full path now in SNDINFO and S_SKIN. + July 15, 2006 - Fixed: Makefile.mgw was mysteriously missing some targets. After fixing that, I also removed some of GCC's warnings. diff --git a/src/actor.h b/src/actor.h index d4b60da92..9b2eb00a4 100644 --- a/src/actor.h +++ b/src/actor.h @@ -352,6 +352,13 @@ enum ERenderStyle #define HX_SHADOW (0x9800) #define HX_ALTSHADOW (0x6800) +// This could easily be a bool but then it'd be much harder to find later. ;) +enum replace_t +{ + NO_REPLACE = 0, + ALLOW_REPLACE = 1 +}; + // [RH] Like msecnode_t, but for the blockmap struct FBlockNode { @@ -421,7 +428,7 @@ public: void Serialize (FArchive &arc); - static AActor *StaticSpawn (const PClass *type, fixed_t x, fixed_t y, fixed_t z); + static AActor *StaticSpawn (const PClass *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement); inline AActor *GetDefault () const { @@ -788,20 +795,20 @@ public: } }; -inline AActor *Spawn (const PClass *type, fixed_t x, fixed_t y, fixed_t z) +inline AActor *Spawn (const PClass *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement) { - return AActor::StaticSpawn (type, x, y, z); + return AActor::StaticSpawn (type, x, y, z, allowreplacement); } -inline AActor *Spawn (const char *type, fixed_t x, fixed_t y, fixed_t z) +inline AActor *Spawn (const char *type, fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement) { - return AActor::StaticSpawn (PClass::FindClass(type), x, y, z); + return AActor::StaticSpawn (PClass::FindClass(type), x, y, z, allowreplacement); } template -inline T *Spawn (fixed_t x, fixed_t y, fixed_t z) +inline T *Spawn (fixed_t x, fixed_t y, fixed_t z, replace_t allowreplacement) { - return static_cast(AActor::StaticSpawn (RUNTIME_CLASS(T), x, y, z)); + return static_cast(AActor::StaticSpawn (RUNTIME_CLASS(T), x, y, z, allowreplacement)); } #define S_FREETARGMOBJ 1 diff --git a/src/b_func.cpp b/src/b_func.cpp index af377bf3e..a3b9a20ed 100644 --- a/src/b_func.cpp +++ b/src/b_func.cpp @@ -464,14 +464,14 @@ void DCajunMaster::SetBodyAt (fixed_t x, fixed_t y, fixed_t z, int hostnum) if (body1) body1->SetOrigin (x, y, z); else - body1 = Spawn (x, y, z); + body1 = Spawn (x, y, z, NO_REPLACE); } else if (hostnum == 2) { if (body2) body2->SetOrigin (x, y, z); else - body2 = Spawn (x, y, z); + body2 = Spawn (x, y, z, NO_REPLACE); } } @@ -499,7 +499,7 @@ END_DEFAULTS //Emulates missile travel. Returns distance travelled. fixed_t DCajunMaster::FakeFire (AActor *source, AActor *dest, ticcmd_t *cmd) { - AActor *th = Spawn (source->x, source->y, source->z + 4*8*FRACUNIT); + AActor *th = Spawn (source->x, source->y, source->z + 4*8*FRACUNIT, NO_REPLACE); th->target = source; // where it came from diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 97c813cf0..e9e249ac5 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -2595,7 +2595,7 @@ void A_SpawnDehackedPickup (AActor *actor) { if ((size_t)actor->health < DehackedPickups.Size()) { - AActor *real = Spawn (DehackedPickups[actor->health], actor->x, actor->y, actor->z); + AActor *real = Spawn (DehackedPickups[actor->health], actor->x, actor->y, actor->z, NO_REPLACE); if (real != NULL) { // Copy properties from the original item to the dehacked pickup it spawns @@ -2621,7 +2621,7 @@ bool ADehackedPickup::TryPickup (AActor *toucher) { return false; } - RealPickup = static_cast(Spawn (type, x, y, z)); + RealPickup = static_cast(Spawn (type, x, y, z, NO_REPLACE)); if (RealPickup != NULL) { if (!(flags & MF_DROPPED)) diff --git a/src/d_net.cpp b/src/d_net.cpp index 36860135d..4e1c668de 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2112,9 +2112,6 @@ void Net_DoCommand (int type, byte **stream, int player) typeinfo = PClass::FindClass (s); if (typeinfo != NULL && typeinfo->ActorInfo != NULL) { - // Handle decorate replacements. - typeinfo = typeinfo->ActorInfo->GetReplacement()->Class; - AActor *source = players[player].mo; if (source != NULL) { @@ -2128,7 +2125,7 @@ void Net_DoCommand (int type, byte **stream, int player) AActor *spawned = Spawn (typeinfo, source->x + FixedMul (def->radius * 2 + source->radius, finecosine[source->angle>>ANGLETOFINESHIFT]), source->y + FixedMul (def->radius * 2 + source->radius, finesine[source->angle>>ANGLETOFINESHIFT]), - source->z + 8 * FRACUNIT); + source->z + 8 * FRACUNIT, ALLOW_REPLACE); if (spawned != NULL && type == DEM_SUMMONFRIEND) { spawned->FriendPlayer = player + 1; diff --git a/src/g_doom/a_archvile.cpp b/src/g_doom/a_archvile.cpp index 628ab237f..3b1660594 100644 --- a/src/g_doom/a_archvile.cpp +++ b/src/g_doom/a_archvile.cpp @@ -354,7 +354,7 @@ void A_VileTarget (AActor *actor) A_FaceTarget (actor); fog = Spawn (actor->target->x, actor->target->x, - actor->target->z); + actor->target->z, ALLOW_REPLACE); actor->tracer = fog; fog->target = actor; diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index 70ab7d88d..6d89dd092 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -184,7 +184,7 @@ void A_BrainPain (AActor *self) static void BrainishExplosion (fixed_t x, fixed_t y, fixed_t z) { - AActor *boom = Spawn (x, y, z); + AActor *boom = Spawn (x, y, z, NO_REPLACE); if (boom != NULL) { boom->momz = pr_brainscream() << 9; @@ -281,7 +281,7 @@ void A_SpawnFly (AActor *self) targ = self->target; // First spawn teleport fire. - fog = Spawn (targ->x, targ->y, targ->z); + fog = Spawn (targ->x, targ->y, targ->z, ALLOW_REPLACE); S_Sound (fog, CHAN_BODY, "brain/spawn", 1, ATTN_NORM); // Randomly select monster to spawn. @@ -301,7 +301,7 @@ void A_SpawnFly (AActor *self) else if (r < 246) type = "HellKnight"; else type = "BaronOfHell"; - newmobj = Spawn (type, targ->x, targ->y, targ->z); + newmobj = Spawn (type, targ->x, targ->y, targ->z, ALLOW_REPLACE); if (newmobj != NULL) { // Make the new monster hate what the boss eye hates diff --git a/src/g_doom/a_doomartifacts.cpp b/src/g_doom/a_doomartifacts.cpp index d2586238c..687fc3daf 100644 --- a/src/g_doom/a_doomartifacts.cpp +++ b/src/g_doom/a_doomartifacts.cpp @@ -22,7 +22,7 @@ public: { player_t *player = Owner->player; - ABasicArmorPickup *armor = static_cast (Spawn ("BlueArmor", 0,0,0)); + ABasicArmorPickup *armor = static_cast (Spawn ("BlueArmor", 0,0,0, NO_REPLACE)); if (!armor->TryPickup (Owner)) { armor->Destroy (); diff --git a/src/g_doom/a_doommisc.cpp b/src/g_doom/a_doommisc.cpp index 276c09119..696a2667a 100644 --- a/src/g_doom/a_doommisc.cpp +++ b/src/g_doom/a_doommisc.cpp @@ -81,7 +81,7 @@ void A_BarrelRespawn (AActor *actor) actor->flags2 = defs->flags2; actor->SetState (actor->SpawnState); actor->renderflags &= ~RF_INVISIBLE; - Spawn (x, y, actor->z + TELEFOGHEIGHT); + Spawn (x, y, actor->z + TELEFOGHEIGHT, ALLOW_REPLACE); } else { diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index f62120c8b..db7223a3c 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -1080,7 +1080,7 @@ void A_BFGSpray (AActor *mo) continue; Spawn (spraytype, linetarget->x, linetarget->y, - linetarget->z + (linetarget->height>>2)); + linetarget->z + (linetarget->height>>2), ALLOW_REPLACE); damage = 0; for (j = 0; j < damagecnt; ++j) diff --git a/src/g_doom/a_painelemental.cpp b/src/g_doom/a_painelemental.cpp index dc0ab72bf..46548071e 100644 --- a/src/g_doom/a_painelemental.cpp +++ b/src/g_doom/a_painelemental.cpp @@ -167,7 +167,7 @@ void A_PainShootSkull (AActor *self, angle_t angle) return; } - other = Spawn (spawntype, x, y, z); + other = Spawn (spawntype, x, y, z, ALLOW_REPLACE); // Check to see if the new Lost Soul's z value is above the diff --git a/src/g_doom/a_revenant.cpp b/src/g_doom/a_revenant.cpp index fbe93b9ec..8bcef275e 100644 --- a/src/g_doom/a_revenant.cpp +++ b/src/g_doom/a_revenant.cpp @@ -207,7 +207,7 @@ void A_Tracer (AActor *self) P_SpawnPuff (RUNTIME_CLASS(ABulletPuff), self->x, self->y, self->z, 0, 3); smoke = Spawn (self->x - self->momx, - self->y - self->momy, self->z); + self->y - self->momy, self->z, ALLOW_REPLACE); smoke->momz = FRACUNIT; smoke->tics -= pr_tracer()&3; diff --git a/src/g_heretic/a_beast.cpp b/src/g_heretic/a_beast.cpp index 90c3953fb..b93dcef9e 100644 --- a/src/g_heretic/a_beast.cpp +++ b/src/g_heretic/a_beast.cpp @@ -211,6 +211,6 @@ void A_BeastPuff (AActor *actor) x = actor->x + (pr_beastpuff.Random2 () << 10); y = actor->y + (pr_beastpuff.Random2 () << 10); z = actor->z + (pr_beastpuff.Random2 () << 10); - Spawn (x, y, z); + Spawn (x, y, z, ALLOW_REPLACE); } } diff --git a/src/g_heretic/a_chicken.cpp b/src/g_heretic/a_chicken.cpp index b9e4d8047..096dde002 100644 --- a/src/g_heretic/a_chicken.cpp +++ b/src/g_heretic/a_chicken.cpp @@ -420,7 +420,7 @@ void A_Feathers (AActor *actor) } for (i = 0; i < count; i++) { - mo = Spawn (actor->x, actor->y, actor->z+20*FRACUNIT); + mo = Spawn (actor->x, actor->y, actor->z+20*FRACUNIT, NO_REPLACE); mo->target = actor; mo->momx = pr_feathers.Random2() << 8; mo->momy = pr_feathers.Random2() << 8; diff --git a/src/g_heretic/a_dsparil.cpp b/src/g_heretic/a_dsparil.cpp index aa181b751..1bbc2d5ce 100644 --- a/src/g_heretic/a_dsparil.cpp +++ b/src/g_heretic/a_dsparil.cpp @@ -511,7 +511,7 @@ void A_SorcererRise (AActor *actor) AActor *mo; actor->flags &= ~MF_SOLID; - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); mo->SetState (&ASorcerer2::States[S_SOR2_RISE]); mo->angle = actor->angle; mo->CopyFriendliness (actor, true); @@ -563,7 +563,7 @@ void P_DSparilTeleport (AActor *actor) prevZ = actor->z; if (P_TeleportMove (actor, spot->x, spot->y, spot->z, false)) { - mo = Spawn (prevX, prevY, prevZ); + mo = Spawn (prevX, prevY, prevZ, ALLOW_REPLACE); S_Sound (mo, CHAN_BODY, "misc/teleport", 1, ATTN_NORM); actor->SetState (&ASorcerer2::States[S_SOR2_TELE]); S_Sound (actor, CHAN_BODY, "misc/teleport", 1, ATTN_NORM); @@ -648,7 +648,7 @@ void A_BlueSpark (AActor *actor) for (i = 0; i < 2; i++) { - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); mo->momx = pr_bluespark.Random2() << 9; mo->momy = pr_bluespark.Random2() << 9; mo->momz = FRACUNIT + (pr_bluespark()<<8); @@ -665,7 +665,7 @@ void A_GenWizard (AActor *actor) { AActor *mo; - mo = Spawn (actor->x, actor->y, actor->z - GetDefault()->height/2); + mo = Spawn (actor->x, actor->y, actor->z - GetDefault()->height/2, ALLOW_REPLACE); if (mo != NULL) { if (!P_TestMobjLocation (mo)) @@ -682,7 +682,7 @@ void A_GenWizard (AActor *actor) actor->flags &= ~MF_MISSILE; mo->master = actor->target; // Heretic did not offset it by TELEFOGHEIGHT, so I won't either. - Spawn (actor->x, actor->y, actor->z); + Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); } } } diff --git a/src/g_heretic/a_hereticartifacts.cpp b/src/g_heretic/a_hereticartifacts.cpp index 684f4dd17..186a06714 100644 --- a/src/g_heretic/a_hereticartifacts.cpp +++ b/src/g_heretic/a_hereticartifacts.cpp @@ -118,7 +118,7 @@ bool AArtiTimeBomb::Use (bool pickup) AActor *mo = Spawn ( Owner->x + 24*finecosine[angle], Owner->y + 24*finesine[angle], - Owner->z - Owner->floorclip); + Owner->z - Owner->floorclip, ALLOW_REPLACE); mo->target = Owner; return true; } diff --git a/src/g_heretic/a_hereticimp.cpp b/src/g_heretic/a_hereticimp.cpp index 1a7510ed1..6474e2370 100644 --- a/src/g_heretic/a_hereticimp.cpp +++ b/src/g_heretic/a_hereticimp.cpp @@ -233,12 +233,12 @@ void A_ImpExplode (AActor *self) self->flags &= ~MF_NOGRAVITY; - chunk = Spawn (self->x, self->y, self->z); + chunk = Spawn (self->x, self->y, self->z, ALLOW_REPLACE); chunk->momx = pr_imp.Random2 () << 10; chunk->momy = pr_imp.Random2 () << 10; chunk->momz = 9*FRACUNIT; - chunk = Spawn (self->x, self->y, self->z); + chunk = Spawn (self->x, self->y, self->z, ALLOW_REPLACE); chunk->momx = pr_imp.Random2 () << 10; chunk->momy = pr_imp.Random2 () << 10; chunk->momz = 9*FRACUNIT; diff --git a/src/g_heretic/a_heretickeys.cpp b/src/g_heretic/a_heretickeys.cpp index c8f83bea6..361ace96c 100644 --- a/src/g_heretic/a_heretickeys.cpp +++ b/src/g_heretic/a_heretickeys.cpp @@ -103,7 +103,7 @@ void A_InitKeyGizmo (AActor *gizmo) { AActor *floater; - floater = Spawn (gizmo->x, gizmo->y, gizmo->z+60*FRACUNIT); + floater = Spawn (gizmo->x, gizmo->y, gizmo->z+60*FRACUNIT, NO_REPLACE); floater->SetState (&AKeyGizmoFloat:: States[static_cast(gizmo)->GetFloatState ()]); } diff --git a/src/g_heretic/a_hereticmisc.cpp b/src/g_heretic/a_hereticmisc.cpp index ad543de0d..4a79f693d 100644 --- a/src/g_heretic/a_hereticmisc.cpp +++ b/src/g_heretic/a_hereticmisc.cpp @@ -158,7 +158,7 @@ void A_PodPain (AActor *actor) } for (count = chance > 240 ? 2 : 1; count; count--) { - goo = Spawn (actor->x, actor->y, actor->z + 48*FRACUNIT); + goo = Spawn (actor->x, actor->y, actor->z + 48*FRACUNIT, ALLOW_REPLACE); goo->target = actor; goo->momx = pr_podpain.Random2() << 9; goo->momy = pr_podpain.Random2() << 9; @@ -207,7 +207,7 @@ void A_MakePod (AActor *actor) x = actor->x; y = actor->y; z = actor->z; - mo = Spawn (x, y, ONFLOORZ); + mo = Spawn (x, y, ONFLOORZ, ALLOW_REPLACE); if (P_CheckPosition (mo, x, y) == false) { // Didn't fit mo->Destroy (); @@ -322,7 +322,7 @@ void A_SpawnTeleGlitter (AActor *actor) fixed_t y = actor->y+((pr_teleg()&31)-16)*FRACUNIT; mo = Spawn (x, y, - actor->Sector->floorplane.ZatPoint (actor->x, actor->y)); + actor->Sector->floorplane.ZatPoint (actor->x, actor->y), ALLOW_REPLACE); mo->momz = FRACUNIT/4; } @@ -339,7 +339,7 @@ void A_SpawnTeleGlitter2 (AActor *actor) fixed_t y = actor->y+((pr_teleg2()&31)-16)*FRACUNIT; mo = Spawn (x, y, - actor->Sector->floorplane.ZatPoint (actor->x, actor->y)); + actor->Sector->floorplane.ZatPoint (actor->x, actor->y), ALLOW_REPLACE); mo->momz = FRACUNIT/4; } @@ -493,7 +493,7 @@ void A_VolcanoBlast (AActor *volcano) for (i = 0; i < count; i++) { blast = Spawn (volcano->x, volcano->y, - volcano->z + 44*FRACUNIT); + volcano->z + 44*FRACUNIT, ALLOW_REPLACE); blast->target = volcano; angle = pr_blast () << 24; blast->angle = angle; @@ -528,7 +528,7 @@ void A_VolcBallImpact (AActor *ball) P_RadiusAttack (ball, ball->target, 25, 25, MOD_FIRE, true); for (i = 0; i < 4; i++) { - tiny = Spawn (ball->x, ball->y, ball->z); + tiny = Spawn (ball->x, ball->y, ball->z, ALLOW_REPLACE); tiny->target = ball; angle = i*ANG90; tiny->angle = angle; diff --git a/src/g_heretic/a_hereticplayer.cpp b/src/g_heretic/a_hereticplayer.cpp index ada10be27..76e80b9d7 100644 --- a/src/g_heretic/a_hereticplayer.cpp +++ b/src/g_heretic/a_hereticplayer.cpp @@ -203,7 +203,7 @@ void A_SkullPop (AActor *actor) spawntype = RUNTIME_CLASS (ABloodySkull); actor->flags &= ~MF_SOLID; - mo = (APlayerPawn *)Spawn (spawntype, actor->x, actor->y, actor->z + 48*FRACUNIT); + mo = (APlayerPawn *)Spawn (spawntype, actor->x, actor->y, actor->z + 48*FRACUNIT, NO_REPLACE); //mo->target = actor; mo->momx = pr_skullpop.Random2() << 9; mo->momy = pr_skullpop.Random2() << 9; diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index be76ec7e8..64d350941 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -779,7 +779,7 @@ void A_BoltSpark (AActor *bolt) if (pr_boltspark() > 50) { - spark = Spawn (bolt->x, bolt->y, bolt->z); + spark = Spawn (bolt->x, bolt->y, bolt->z, ALLOW_REPLACE); spark->x += pr_boltspark.Random2() << 10; spark->y += pr_boltspark.Random2() << 10; } @@ -1093,7 +1093,7 @@ void A_SpawnMace (AActor *self) { // Sometimes doesn't show up if not in deathmatch return; } - mace = Spawn (self->x, self->y, self->z); + mace = Spawn (self->x, self->y, self->z, ALLOW_REPLACE); if (mace) { mace->FirstSpot = firstSpot; @@ -1150,7 +1150,7 @@ void A_FireMacePL1B (AActor *actor) } pmo = player->mo; ball = Spawn (pmo->x, pmo->y, pmo->z + 28*FRACUNIT - - pmo->floorclip); + - pmo->floorclip, ALLOW_REPLACE); ball->momz = 2*FRACUNIT+/*((player->lookdir)<<(FRACBITS-5))*/ finetangent[FINEANGLES/4-(pmo->pitch>>ANGLETOFINESHIFT)]; angle = pmo->angle; @@ -1295,7 +1295,7 @@ void A_MaceBallImpact2 (AActor *ball) ball->momz = (ball->momz * 192) >> 8; ball->SetState (ball->SpawnState); - tiny = Spawn (ball->x, ball->y, ball->z); + tiny = Spawn (ball->x, ball->y, ball->z, ALLOW_REPLACE); angle = ball->angle+ANG90; tiny->target = ball->target; tiny->angle = angle; @@ -1307,7 +1307,7 @@ void A_MaceBallImpact2 (AActor *ball) tiny->momz = ball->momz; P_CheckMissileSpawn (tiny); - tiny = Spawn (ball->x, ball->y, ball->z); + tiny = Spawn (ball->x, ball->y, ball->z, ALLOW_REPLACE); angle = ball->angle-ANG90; tiny->target = ball->target; tiny->angle = angle; @@ -2020,7 +2020,7 @@ void A_SpawnRippers (AActor *actor) for(i = 0; i < 8; i++) { - ripper = Spawn (actor->x, actor->y, actor->z); + ripper = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); angle = i*ANG45; ripper->target = actor->target; ripper->angle = angle; @@ -2084,7 +2084,7 @@ void ABlasterFX1::Tick () } if (changexy && (pr_bfx1t() < 64)) { - Spawn (x, y, MAX (z - 8 * FRACUNIT, floorz)); + Spawn (x, y, MAX (z - 8 * FRACUNIT, floorz), ALLOW_REPLACE); } } } @@ -2526,7 +2526,7 @@ void A_SkullRodStorm (AActor *actor) } x = actor->x + ((pr_storm()&127) - 64) * FRACUNIT; y = actor->y + ((pr_storm()&127) - 64) * FRACUNIT; - mo = Spawn (x, y, ONCEILINGZ); + mo = Spawn (x, y, ONCEILINGZ, ALLOW_REPLACE); mo->Translation = multiplayer ? TRANSLATION(TRANSLATION_PlayersExtra,actor->special2) : 0; mo->target = actor->target; @@ -2830,13 +2830,13 @@ void A_PhoenixPuff (AActor *actor) //[RH] Heretic never sets the target for seeking //P_SeekerMissile (actor, ANGLE_1*5, ANGLE_1*10); - puff = Spawn (actor->x, actor->y, actor->z); + puff = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); angle = actor->angle + ANG90; angle >>= ANGLETOFINESHIFT; puff->momx = FixedMul (FRACUNIT*13/10, finecosine[angle]); puff->momy = FixedMul (FRACUNIT*13/10, finesine[angle]); puff->momz = 0; - puff = Spawn (actor->x, actor->y, actor->z); + puff = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); angle = actor->angle - ANG90; angle >>= ANGLETOFINESHIFT; puff->momx = FixedMul (FRACUNIT*13/10, finecosine[angle]); @@ -2903,7 +2903,7 @@ void A_FirePhoenixPL2 (AActor *actor) z = pmo->z + 26*FRACUNIT + finetangent[FINEANGLES/4-(pmo->pitch>>ANGLETOFINESHIFT)]; z -= pmo->floorclip; slope = finetangent[FINEANGLES/4-(pmo->pitch>>ANGLETOFINESHIFT)] + (FRACUNIT/10); - mo = Spawn (x, y, z); + mo = Spawn (x, y, z, ALLOW_REPLACE); mo->target = pmo; mo->angle = angle; mo->momx = pmo->momx + FixedMul (mo->Speed, finecosine[angle>>ANGLETOFINESHIFT]); diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index 09ae13b99..b58f61b7d 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -321,7 +321,7 @@ void A_LichAttack (AActor *actor) for (i = 0; i < 5; i++) { fire = Spawn (baseFire->x, baseFire->y, - baseFire->z); + baseFire->z, ALLOW_REPLACE); if (i == 0) { S_Sound (actor, CHAN_BODY, "ironlich/attack1", 1, ATTN_NORM); @@ -394,7 +394,7 @@ void A_LichIceImpact (AActor *ice) for (i = 0; i < 8; i++) { - shard = Spawn (ice->x, ice->y, ice->z); + shard = Spawn (ice->x, ice->y, ice->z, ALLOW_REPLACE); angle = i*ANG45; shard->target = ice->target; shard->angle = angle; diff --git a/src/g_heretic/a_knight.cpp b/src/g_heretic/a_knight.cpp index bca328fdf..221c854f6 100644 --- a/src/g_heretic/a_knight.cpp +++ b/src/g_heretic/a_knight.cpp @@ -188,7 +188,7 @@ void A_DripBlood (AActor *actor) x = actor->x + (pr_dripblood.Random2 () << 11); y = actor->y + (pr_dripblood.Random2 () << 11); - mo = Spawn (x, y, actor->z); + mo = Spawn (x, y, actor->z, ALLOW_REPLACE); mo->momx = pr_dripblood.Random2 () << 10; mo->momy = pr_dripblood.Random2 () << 10; mo->flags2 |= MF2_LOGRAV; diff --git a/src/g_heretic/a_mummy.cpp b/src/g_heretic/a_mummy.cpp index f401cc969..f66854a91 100644 --- a/src/g_heretic/a_mummy.cpp +++ b/src/g_heretic/a_mummy.cpp @@ -282,7 +282,7 @@ void A_MummySoul (AActor *mummy) { AActor *mo; - mo = Spawn (mummy->x, mummy->y, mummy->z+10*FRACUNIT); + mo = Spawn (mummy->x, mummy->y, mummy->z+10*FRACUNIT, ALLOW_REPLACE); mo->momz = FRACUNIT; } diff --git a/src/g_hexen/a_bishop.cpp b/src/g_hexen/a_bishop.cpp index cc66034f9..20095a069 100644 --- a/src/g_hexen/a_bishop.cpp +++ b/src/g_hexen/a_bishop.cpp @@ -375,7 +375,7 @@ void A_BishopSpawnBlur (AActor *actor) actor->SetState (actor->MissileState); } } - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (mo) { mo->angle = actor->angle; @@ -405,7 +405,7 @@ void A_BishopPuff (AActor *actor) { AActor *mo; - mo = Spawn (actor->x, actor->y, actor->z + 40*FRACUNIT); + mo = Spawn (actor->x, actor->y, actor->z + 40*FRACUNIT, ALLOW_REPLACE); if (mo) { mo->momz = FRACUNIT/2; @@ -430,7 +430,7 @@ void A_BishopPainBlur (AActor *actor) fixed_t x = actor->x + (pr_pain.Random2()<<12); fixed_t y = actor->y + (pr_pain.Random2()<<12); fixed_t z = actor->z + (pr_pain.Random2()<<11); - mo = Spawn (x, y, z); + mo = Spawn (x, y, z, ALLOW_REPLACE); if (mo) { mo->angle = actor->angle; diff --git a/src/g_hexen/a_blastradius.cpp b/src/g_hexen/a_blastradius.cpp index 5beb2fcab..bb4f46d3b 100644 --- a/src/g_hexen/a_blastradius.cpp +++ b/src/g_hexen/a_blastradius.cpp @@ -181,7 +181,7 @@ void AArtiBlastRadius::BlastActor (AActor *victim, fixed_t strength) x = victim->x + FixedMul (victim->radius+FRACUNIT, finecosine[ang]); y = victim->y + FixedMul (victim->radius+FRACUNIT, finesine[ang]); z = victim->z - victim->floorclip + (victim->height>>1); - mo = Spawn (x, y, z); + mo = Spawn (x, y, z, ALLOW_REPLACE); if (mo) { mo->momx = victim->momx; diff --git a/src/g_hexen/a_boostarmor.cpp b/src/g_hexen/a_boostarmor.cpp index 76e0b99c3..5b64f132d 100644 --- a/src/g_hexen/a_boostarmor.cpp +++ b/src/g_hexen/a_boostarmor.cpp @@ -49,7 +49,7 @@ bool AArtiBoostArmor::Use (bool pickup) for (int i = 0; i < 4; ++i) { - armor = Spawn (0,0,0); + armor = Spawn (0,0,0, NO_REPLACE); armor->flags |= MF_DROPPED; armor->health = i; armor->Amount = 1; @@ -66,7 +66,7 @@ bool AArtiBoostArmor::Use (bool pickup) } else { - ABasicArmorBonus *armor = Spawn (0,0,0); + ABasicArmorBonus *armor = Spawn (0,0,0, NO_REPLACE); armor->flags |= MF_DROPPED; armor->SaveAmount = 50; armor->MaxSaveAmount = 300; diff --git a/src/g_hexen/a_centaur.cpp b/src/g_hexen/a_centaur.cpp index 67a72d188..5ae4d3026 100644 --- a/src/g_hexen/a_centaur.cpp +++ b/src/g_hexen/a_centaur.cpp @@ -307,7 +307,7 @@ void A_CentaurDropStuff (AActor *actor) { AActor *mo; - mo = Spawn (DropTypes[i], actor->x, actor->y, actor->z+45*FRACUNIT); + mo = Spawn (DropTypes[i], actor->x, actor->y, actor->z+45*FRACUNIT, ALLOW_REPLACE); if (mo) { angle_t angle = actor->angle + (i ? ANGLE_90 : ANGLE_270); diff --git a/src/g_hexen/a_clericflame.cpp b/src/g_hexen/a_clericflame.cpp index a22ccac28..3b6df39a6 100644 --- a/src/g_hexen/a_clericflame.cpp +++ b/src/g_hexen/a_clericflame.cpp @@ -348,7 +348,7 @@ void ACFlameMissile::Tick () { newz = floorz; } - mo = Spawn (x, y, newz); + mo = Spawn (x, y, newz, ALLOW_REPLACE); if (mo) { mo->angle = angle; @@ -434,7 +434,7 @@ void A_CFlameMissile (AActor *actor) an90 = (i*ANG45+ANG90)>>ANGLETOFINESHIFT; mo = Spawn (BlockingMobj->x+FixedMul(dist, finecosine[an]), BlockingMobj->y+FixedMul(dist, finesine[an]), - BlockingMobj->z+5*FRACUNIT); + BlockingMobj->z+5*FRACUNIT, ALLOW_REPLACE); if (mo) { mo->angle = an< (BlockingMobj->x-FixedMul(dist, finecosine[an]), BlockingMobj->y-FixedMul(dist, finesine[an]), - BlockingMobj->z+5*FRACUNIT); + BlockingMobj->z+5*FRACUNIT, ALLOW_REPLACE); if(mo) { mo->angle = ANG180+(an< (x, y, z); + Spawn (x, y, z, ALLOW_REPLACE); S_Sound (this, CHAN_WEAPON, "SpiritAttack", 1, ATTN_NORM); if (thing->flags3&MF3_ISMONSTER && pr_spiritslam() < 128) { @@ -481,7 +481,7 @@ void A_CHolyAttack2 (AActor *actor) for (j = 0; j < 4; j++) { - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (!mo) { continue; @@ -533,11 +533,11 @@ void SpawnSpiritTail (AActor *spirit) AActor *tail, *next; int i; - tail = Spawn (spirit->x, spirit->y, spirit->z); + tail = Spawn (spirit->x, spirit->y, spirit->z, ALLOW_REPLACE); tail->target = spirit; // parent for (i = 1; i < 3; i++) { - next = Spawn (spirit->x, spirit->y, spirit->z); + next = Spawn (spirit->x, spirit->y, spirit->z, ALLOW_REPLACE); tail->tracer = next; tail = next; } @@ -868,7 +868,7 @@ void A_CHolyCheckScream (AActor *actor) void A_CHolySpawnPuff (AActor *actor) { - Spawn (actor->x, actor->y, actor->z); + Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); } void AClericWeaponPiece::BeginPlay () @@ -894,7 +894,7 @@ void A_DropWraithvergePieces (AActor *actor) for (int i = 0, j = 0, fineang = 0; i < 3; ++i) { - AActor *piece = Spawn (pieces[j], actor->x, actor->y, actor->z); + AActor *piece = Spawn (pieces[j], actor->x, actor->y, actor->z, ALLOW_REPLACE); if (piece != NULL) { piece->momx = actor->momx + finecosine[fineang]; diff --git a/src/g_hexen/a_demons.cpp b/src/g_hexen/a_demons.cpp index 751943b2b..c5bbb081a 100644 --- a/src/g_hexen/a_demons.cpp +++ b/src/g_hexen/a_demons.cpp @@ -645,7 +645,7 @@ static void TossChunks (AActor *actor, const PClass *const chunks[]) for (i = 4; i >= 0; --i) { - mo = Spawn (chunks[i], actor->x, actor->y, actor->z+45*FRACUNIT); + mo = Spawn (chunks[i], actor->x, actor->y, actor->z+45*FRACUNIT, ALLOW_REPLACE); if (mo) { angle = actor->angle + (i<4 ? ANGLE_270 : ANGLE_90); diff --git a/src/g_hexen/a_dragon.cpp b/src/g_hexen/a_dragon.cpp index 8c64daa87..2d54c2143 100644 --- a/src/g_hexen/a_dragon.cpp +++ b/src/g_hexen/a_dragon.cpp @@ -430,7 +430,7 @@ void A_DragonFX2 (AActor *actor) fixed_t y = actor->y+((pr_dragonfx2()-128)<<14); fixed_t z = actor->z+((pr_dragonfx2()-128)<<12); - mo = Spawn (x, y, z); + mo = Spawn (x, y, z, ALLOW_REPLACE); if (mo) { mo->tics = delay+(pr_dragonfx2()&3)*i*2; diff --git a/src/g_hexen/a_ettin.cpp b/src/g_hexen/a_ettin.cpp index 063cc2be9..e9f987945 100644 --- a/src/g_hexen/a_ettin.cpp +++ b/src/g_hexen/a_ettin.cpp @@ -173,7 +173,7 @@ void A_DropMace (AActor *actor) AEttinMace *mo; mo = Spawn (actor->x, actor->y, - actor->z + (actor->height>>1)); + actor->z + (actor->height>>1), ALLOW_REPLACE); if (mo) { mo->momx = (pr_dropmace()-128) << 11; diff --git a/src/g_hexen/a_fighteraxe.cpp b/src/g_hexen/a_fighteraxe.cpp index ba3ecdcb8..357018595 100644 --- a/src/g_hexen/a_fighteraxe.cpp +++ b/src/g_hexen/a_fighteraxe.cpp @@ -454,7 +454,7 @@ void P_BloodSplatter2 (fixed_t x, fixed_t y, fixed_t z, AActor *originator) x += ((pr_splat()-128)<<11); y += ((pr_splat()-128)<<11); - mo = Spawn (x, y, z); + mo = Spawn (x, y, z, ALLOW_REPLACE); mo->target = originator; // colorize the blood! diff --git a/src/g_hexen/a_fighterplayer.cpp b/src/g_hexen/a_fighterplayer.cpp index f80fee1a7..48dcf076a 100644 --- a/src/g_hexen/a_fighterplayer.cpp +++ b/src/g_hexen/a_fighterplayer.cpp @@ -356,7 +356,7 @@ bool AFighterPlayer::DoHealingRadius (APlayerPawn *other) for (int i = 0; i < 4; ++i) { - AHexenArmor *armor = Spawn (0,0,0); + AHexenArmor *armor = Spawn (0,0,0, NO_REPLACE); armor->health = i; armor->Amount = 1; if (!armor->TryPickup (player->mo)) diff --git a/src/g_hexen/a_fighterquietus.cpp b/src/g_hexen/a_fighterquietus.cpp index 8ce312eaa..e47f9f3c3 100644 --- a/src/g_hexen/a_fighterquietus.cpp +++ b/src/g_hexen/a_fighterquietus.cpp @@ -347,7 +347,7 @@ void A_FSwordFlames (AActor *actor) fixed_t x = actor->x+((pr_fswordflame()-128)<<12); fixed_t y = actor->y+((pr_fswordflame()-128)<<12); fixed_t z = actor->z+((pr_fswordflame()-128)<<11); - Spawn (x, y, z); + Spawn (x, y, z, ALLOW_REPLACE); } } @@ -368,7 +368,7 @@ void A_DropQuietusPieces (AActor *actor) for (int i = 0, j = 0, fineang = 0; i < 3; ++i) { - AActor *piece = Spawn (pieces[j], actor->x, actor->y, actor->z); + AActor *piece = Spawn (pieces[j], actor->x, actor->y, actor->z, ALLOW_REPLACE); if (piece != NULL) { piece->momx = actor->momx + finecosine[fineang]; diff --git a/src/g_hexen/a_firedemon.cpp b/src/g_hexen/a_firedemon.cpp index ba5a6ffb5..dfd17d380 100644 --- a/src/g_hexen/a_firedemon.cpp +++ b/src/g_hexen/a_firedemon.cpp @@ -373,7 +373,7 @@ void A_FiredSpawnRock (AActor *actor) x = actor->x + ((pr_firedemonrock() - 128) << 12); y = actor->y + ((pr_firedemonrock() - 128) << 12); z = actor->z + ( pr_firedemonrock() << 11); - mo = Spawn (rtype, x, y, z); + mo = Spawn (rtype, x, y, z, ALLOW_REPLACE); if (mo) { mo->target = actor; @@ -519,14 +519,14 @@ void A_FiredSplotch (AActor *actor) { AActor *mo; - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (mo) { mo->momx = (pr_firedemonsplotch() - 128) << 11; mo->momy = (pr_firedemonsplotch() - 128) << 11; mo->momz = (pr_firedemonsplotch() << 10) + FRACUNIT*3; } - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (mo) { mo->momx = (pr_firedemonsplotch() - 128) << 11; diff --git a/src/g_hexen/a_flechette.cpp b/src/g_hexen/a_flechette.cpp index 74eec3cc4..c9bf1f9ed 100644 --- a/src/g_hexen/a_flechette.cpp +++ b/src/g_hexen/a_flechette.cpp @@ -186,7 +186,7 @@ bool AArtiPoisonBag1::Use (bool pickup) mo = Spawn ( Owner->x+16*finecosine[angle], Owner->y+24*finesine[angle], Owner->z- - Owner->floorclip+8*FRACUNIT); + Owner->floorclip+8*FRACUNIT, ALLOW_REPLACE); if (mo) { mo->target = Owner; @@ -216,7 +216,7 @@ bool AArtiPoisonBag2::Use (bool pickup) mo = Spawn ( Owner->x+16*finecosine[angle], Owner->y+24*finesine[angle], Owner->z- - Owner->floorclip+8*FRACUNIT); + Owner->floorclip+8*FRACUNIT, ALLOW_REPLACE); if (mo) { mo->target = Owner; @@ -243,7 +243,7 @@ bool AArtiPoisonBag3::Use (bool pickup) AActor *mo; mo = Spawn (Owner->x, Owner->y, - Owner->z-Owner->floorclip+35*FRACUNIT + (Owner->player? Owner->player->crouchoffset : 0)); + Owner->z-Owner->floorclip+35*FRACUNIT + (Owner->player? Owner->player->crouchoffset : 0), ALLOW_REPLACE); if (mo) { angle_t pitch = (angle_t)Owner->pitch >> ANGLETOFINESHIFT; @@ -339,7 +339,7 @@ AInventory *AArtiPoisonBag::CreateCopy (AActor *other) { spawntype = RUNTIME_CLASS(AArtiPoisonBag3); } - copy = static_cast(Spawn (spawntype, 0, 0, 0)); + copy = static_cast(Spawn (spawntype, 0, 0, 0, NO_REPLACE)); copy->Amount = Amount; copy->MaxAmount = MaxAmount; GoAwayAndDie (); @@ -476,7 +476,7 @@ void A_PoisonBagInit (AActor *actor) { AActor *mo; - mo = Spawn (actor->x, actor->y, actor->z+28*FRACUNIT); + mo = Spawn (actor->x, actor->y, actor->z+28*FRACUNIT, ALLOW_REPLACE); if (mo) { mo->target = actor->target; diff --git a/src/g_hexen/a_fog.cpp b/src/g_hexen/a_fog.cpp index 9c602e255..811121150 100644 --- a/src/g_hexen/a_fog.cpp +++ b/src/g_hexen/a_fog.cpp @@ -165,7 +165,7 @@ void A_FogSpawn (AActor *actor) actor->special1 = actor->args[2]; // Reset frequency count - mo = Spawn (fogs[pr_fogspawn()%3], actor->x, actor->y, actor->z); + mo = Spawn (fogs[pr_fogspawn()%3], actor->x, actor->y, actor->z, ALLOW_REPLACE); if (mo) { diff --git a/src/g_hexen/a_heresiarch.cpp b/src/g_hexen/a_heresiarch.cpp index 030ef38b8..772464c3c 100644 --- a/src/g_hexen/a_heresiarch.cpp +++ b/src/g_hexen/a_heresiarch.cpp @@ -672,15 +672,15 @@ void A_SorcSpinBalls(AActor *actor) actor->special1 = ANGLE_1; z = actor->z - actor->floorclip + actor->height; - mo = Spawn (actor->x, actor->y, z); + mo = Spawn (actor->x, actor->y, z, NO_REPLACE); if (mo) { mo->target = actor; mo->special2 = SORCFX4_RAPIDFIRE_TIME; } - mo = Spawn (actor->x, actor->y, z); + mo = Spawn (actor->x, actor->y, z, NO_REPLACE); if (mo) mo->target = actor; - mo = Spawn (actor->x, actor->y, z); + mo = Spawn (actor->x, actor->y, z, NO_REPLACE); if (mo) mo->target = actor; } @@ -968,7 +968,7 @@ void ASorcBall2::CastSorcererSpell () AActor *mo; fixed_t z = parent->z - parent->floorclip + SORC_DEFENSE_HEIGHT*FRACUNIT; - mo = Spawn (x, y, z); + mo = Spawn (x, y, z, ALLOW_REPLACE); parent->flags2 |= MF2_REFLECTIVE|MF2_INVULNERABLE; parent->args[0] = SORC_DEFENSE_TIME; if (mo) mo->target = parent; @@ -1134,7 +1134,7 @@ void A_SpawnFizzle(AActor *actor) z = actor->z - actor->floorclip + (actor->height>>1); for (ix=0; ix<5; ix++) { - mo = Spawn (x, y, z); + mo = Spawn (x, y, z, ALLOW_REPLACE); if (mo) { rangle = angle + ((pr_heresiarch()%5) << 1); @@ -1181,7 +1181,7 @@ void A_SorcFX2Split(AActor *actor) { AActor *mo; - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, NO_REPLACE); if (mo) { mo->target = actor->target; @@ -1189,7 +1189,7 @@ void A_SorcFX2Split(AActor *actor) mo->special1 = actor->angle; // Set angle mo->SetStateNF (&ASorcFX2::States[S_SORCFX2_ORBIT1]); } - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, NO_REPLACE); if (mo) { mo->target = actor->target; @@ -1249,7 +1249,7 @@ void A_SorcFX2Orbit (AActor *actor) z = parent->z - parent->floorclip + SORC_DEFENSE_HEIGHT*FRACUNIT; z += FixedMul(15*FRACUNIT,finecosine[angle]); // Spawn trailer - Spawn (x, y, z); + Spawn (x, y, z, ALLOW_REPLACE); } else // Clock wise { @@ -1260,7 +1260,7 @@ void A_SorcFX2Orbit (AActor *actor) z = parent->z - parent->floorclip + SORC_DEFENSE_HEIGHT*FRACUNIT; z += FixedMul(20*FRACUNIT,finesine[angle]); // Spawn trailer - Spawn (x, y, z); + Spawn (x, y, z, ALLOW_REPLACE); } actor->SetOrigin (x, y, z); @@ -1279,7 +1279,7 @@ void A_SorcFX2Orbit (AActor *actor) void A_SpawnBishop(AActor *actor) { AActor *mo; - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (mo) { if (!P_TestMobjLocation(mo)) @@ -1304,7 +1304,7 @@ void A_SpawnBishop(AActor *actor) void A_SorcererBishopEntry(AActor *actor) { - Spawn (actor->x, actor->y, actor->z); + Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); S_SoundID (actor, CHAN_VOICE, actor->SeeSound, 1, ATTN_NORM); } diff --git a/src/g_hexen/a_hexenspecialdecs.cpp b/src/g_hexen/a_hexenspecialdecs.cpp index e09561a43..e5f183f93 100644 --- a/src/g_hexen/a_hexenspecialdecs.cpp +++ b/src/g_hexen/a_hexenspecialdecs.cpp @@ -187,7 +187,7 @@ void A_PotteryExplode (AActor *actor) for(i = (pr_pottery()&3)+3; i; i--) { - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); mo->SetState (mo->SpawnState + (pr_pottery()%5)); if (mo) { @@ -203,7 +203,7 @@ void A_PotteryExplode (AActor *actor) || !(GetDefaultByType (SpawnableThings[actor->args[0]])->flags3 & MF3_ISMONSTER)) { // Only spawn monsters if not -nomonsters Spawn (SpawnableThings[actor->args[0]], - actor->x, actor->y, actor->z); + actor->x, actor->y, actor->z, ALLOW_REPLACE); } } } @@ -288,7 +288,7 @@ END_DEFAULTS void AZCorpseLynchedNoHeart::PostBeginPlay () { Super::PostBeginPlay (); - Spawn (x, y, ONFLOORZ); + Spawn (x, y, ONFLOORZ, ALLOW_REPLACE); } // CorpseBloodDrip ---------------------------------------------------------- @@ -331,7 +331,7 @@ void A_CorpseBloodDrip (AActor *actor) { if (pr_drip() <= 128) { - Spawn (actor->x, actor->y, actor->z + actor->height/2); + Spawn (actor->x, actor->y, actor->z + actor->height/2, ALLOW_REPLACE); } } @@ -400,7 +400,7 @@ void A_CorpseExplode (AActor *actor) for (i = (pr_foo()&3)+3; i; i--) { - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); mo->SetState (mo->SpawnState + (pr_foo()%3)); if (mo) { @@ -410,7 +410,7 @@ void A_CorpseExplode (AActor *actor) } } // Spawn a skull - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); mo->SetState (mo->SpawnState + 3); if (mo) { @@ -537,7 +537,7 @@ void A_LeafSpawn (AActor *actor) mo = Spawn (pr_leaf()&1 ? RUNTIME_CLASS(ALeaf1) : RUNTIME_CLASS(ALeaf2), actor->x + (pr_leaf.Random2()<<14), actor->y + (pr_leaf.Random2()<<14), - actor->z + (pr_leaf()<<14)); + actor->z + (pr_leaf()<<14), ALLOW_REPLACE); if (mo) { P_ThrustMobj (mo, actor->angle, (pr_leaf()<<9)+3*FRACUNIT); @@ -720,7 +720,7 @@ void A_SoAExplode (AActor *actor) { mo = Spawn (actor->x+((pr_soaexplode()-128)<<12), actor->y+((pr_soaexplode()-128)<<12), - actor->z+(pr_soaexplode()*actor->height/256)); + actor->z+(pr_soaexplode()*actor->height/256), ALLOW_REPLACE); mo->SetState (mo->SpawnState + i); if (mo) { @@ -735,7 +735,7 @@ void A_SoAExplode (AActor *actor) || !(GetDefaultByType (SpawnableThings[actor->args[0]])->flags3 & MF3_ISMONSTER)) { // Only spawn monsters if not -nomonsters Spawn (SpawnableThings[actor->args[0]], - actor->x, actor->y, actor->z); + actor->x, actor->y, actor->z, ALLOW_REPLACE); } } S_SoundID (actor, CHAN_BODY, actor->DeathSound, 1, ATTN_NORM); diff --git a/src/g_hexen/a_iceguy.cpp b/src/g_hexen/a_iceguy.cpp index a669a7fa8..07c00e820 100644 --- a/src/g_hexen/a_iceguy.cpp +++ b/src/g_hexen/a_iceguy.cpp @@ -289,7 +289,7 @@ void A_IceGuyLook (AActor *actor) Spawn (WispTypes[pr_iceguylook()&1], actor->x+FixedMul(dist, finecosine[an]), actor->y+FixedMul(dist, finesine[an]), - actor->z+60*FRACUNIT); + actor->z+60*FRACUNIT, ALLOW_REPLACE); } } @@ -314,7 +314,7 @@ void A_IceGuyChase (AActor *actor) mo = Spawn (WispTypes[pr_iceguychase()&1], actor->x+FixedMul(dist, finecosine[an]), actor->y+FixedMul(dist, finesine[an]), - actor->z+60*FRACUNIT); + actor->z+60*FRACUNIT, ALLOW_REPLACE); if (mo) { mo->momx = actor->momx; @@ -361,7 +361,7 @@ void A_IceGuyAttack (AActor *actor) void A_IceGuyMissilePuff (AActor *actor) { AActor *mo; - mo = Spawn (actor->x, actor->y, actor->z+2*FRACUNIT); + mo = Spawn (actor->x, actor->y, actor->z+2*FRACUNIT, ALLOW_REPLACE); } //============================================================================ diff --git a/src/g_hexen/a_korax.cpp b/src/g_hexen/a_korax.cpp index f6b7855cc..ea3ec734a 100644 --- a/src/g_hexen/a_korax.cpp +++ b/src/g_hexen/a_korax.cpp @@ -434,7 +434,7 @@ void A_KoraxCommand (AActor *actor) x = actor->x + KORAX_COMMAND_OFFSET * finecosine[ang]; y = actor->y + KORAX_COMMAND_OFFSET * finesine[ang]; z = actor->z + KORAX_COMMAND_HEIGHT*FRACUNIT; - Spawn (x, y, z); + Spawn (x, y, z, ALLOW_REPLACE); if (actor->health <= (actor->GetDefault()->health >> 1)) { @@ -656,7 +656,7 @@ void A_KBoltRaise (AActor *actor) if ((z + KORAX_BOLT_HEIGHT) < actor->ceilingz) { - mo = Spawn (actor->x, actor->y, z); + mo = Spawn (actor->x, actor->y, z, ALLOW_REPLACE); if (mo) { mo->special1 = KORAX_BOLT_LIFETIME; @@ -682,7 +682,7 @@ AActor *P_SpawnKoraxMissile (fixed_t x, fixed_t y, fixed_t z, int dist; z -= source->floorclip; - th = Spawn (type, x, y, z); + th = Spawn (type, x, y, z, ALLOW_REPLACE); if (th->SeeSound) { S_SoundID (th, CHAN_BODY, th->SeeSound, 1, ATTN_NORM); diff --git a/src/g_hexen/a_magelightning.cpp b/src/g_hexen/a_magelightning.cpp index 3c288f7eb..6afe8a4f0 100644 --- a/src/g_hexen/a_magelightning.cpp +++ b/src/g_hexen/a_magelightning.cpp @@ -451,7 +451,7 @@ void A_LightningZap (AActor *actor) } mo = Spawn (actor->x+((pr_zap()-128)*actor->radius/256), actor->y+((pr_zap()-128)*actor->radius/256), - actor->z+deltaZ); + actor->z+deltaZ, ALLOW_REPLACE); if (mo) { mo->lastenemy = actor; @@ -554,7 +554,7 @@ void A_LastZap (AActor *actor) { AActor *mo; - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (mo) { mo->SetState (&ALightningZap::States[S_LIGHTNING_ZAP_X1]); diff --git a/src/g_hexen/a_magestaff.cpp b/src/g_hexen/a_magestaff.cpp index 7c72adf4f..b93eb7b28 100644 --- a/src/g_hexen/a_magestaff.cpp +++ b/src/g_hexen/a_magestaff.cpp @@ -488,7 +488,7 @@ void A_DropBloodscourgePieces (AActor *actor) for (int i = 0, j = 0, fineang = 0; i < 3; ++i) { - AActor *piece = Spawn (pieces[j], actor->x, actor->y, actor->z); + AActor *piece = Spawn (pieces[j], actor->x, actor->y, actor->z, ALLOW_REPLACE); if (piece != NULL) { piece->momx = actor->momx + finecosine[fineang]; diff --git a/src/g_hexen/a_magewand.cpp b/src/g_hexen/a_magewand.cpp index 0f3b1236e..2933caa2a 100644 --- a/src/g_hexen/a_magewand.cpp +++ b/src/g_hexen/a_magewand.cpp @@ -171,7 +171,7 @@ void AMageWandMissile::Tick () { hitz = floorz; } - Spawn (x, y, hitz); + Spawn (x, y, hitz, ALLOW_REPLACE); } } } diff --git a/src/g_hexen/a_serpent.cpp b/src/g_hexen/a_serpent.cpp index 842100957..893c765a2 100644 --- a/src/g_hexen/a_serpent.cpp +++ b/src/g_hexen/a_serpent.cpp @@ -607,7 +607,7 @@ void A_SerpentMissileAttack (AActor *actor) void A_SerpentHeadPop (AActor *actor) { - Spawn (actor->x, actor->y, actor->z+45*FRACUNIT); + Spawn (actor->x, actor->y, actor->z+45*FRACUNIT, ALLOW_REPLACE); } //============================================================================ @@ -631,7 +631,7 @@ void A_SerpentSpawnGibs (AActor *actor) mo = Spawn (GibTypes[i], actor->x+((pr_serpentgibs()-128)<<12), actor->y+((pr_serpentgibs()-128)<<12), - actor->floorz+FRACUNIT); + actor->floorz+FRACUNIT, ALLOW_REPLACE); if (mo) { mo->momx = (pr_serpentgibs()-128)<<6; diff --git a/src/g_hexen/a_spike.cpp b/src/g_hexen/a_spike.cpp index e98b191ca..007f891c9 100644 --- a/src/g_hexen/a_spike.cpp +++ b/src/g_hexen/a_spike.cpp @@ -185,27 +185,27 @@ END_DEFAULTS void AThrustFloor::Activate (AActor *activator) { - if (args[0] == 0) - { - S_Sound (this, CHAN_BODY, "ThrustSpikeLower", 1, ATTN_NORM); - renderflags &= ~RF_INVISIBLE; - if (args[1]) - SetState (&States[S_BTHRUSTRAISE]); - else - SetState (&States[S_THRUSTRAISE]); - } + if (args[0] == 0) + { + S_Sound (this, CHAN_BODY, "ThrustSpikeLower", 1, ATTN_NORM); + renderflags &= ~RF_INVISIBLE; + if (args[1]) + SetState (&States[S_BTHRUSTRAISE]); + else + SetState (&States[S_THRUSTRAISE]); + } } void AThrustFloor::Deactivate (AActor *activator) { - if (args[0] == 1) - { - S_Sound (this, CHAN_BODY, "ThrustSpikeRaise", 1, ATTN_NORM); - if (args[1]) - SetState (&States[S_BTHRUSTLOWER]); - else - SetState (&States[S_THRUSTLOWER]); - } + if (args[0] == 1) + { + S_Sound (this, CHAN_BODY, "ThrustSpikeRaise", 1, ATTN_NORM); + if (args[1]) + SetState (&States[S_BTHRUSTLOWER]); + else + SetState (&States[S_THRUSTLOWER]); + } } // Spike up ----------------------------------------------------------------- @@ -264,7 +264,7 @@ void A_ThrustInitDn (AActor *actor) actor->flags2 = MF2_NOTELEPORT|MF2_FLOORCLIP; actor->renderflags = RF_INVISIBLE; static_cast(actor)->DirtClump = - Spawn (actor->x, actor->y, actor->z); + Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); } diff --git a/src/g_hexen/a_summon.cpp b/src/g_hexen/a_summon.cpp index 9bfe97832..e579e5733 100644 --- a/src/g_hexen/a_summon.cpp +++ b/src/g_hexen/a_summon.cpp @@ -129,13 +129,13 @@ void A_Summon (AActor *actor) { AMinotaurFriend *mo; - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (mo) { if (P_TestMobjLocation(mo) == false || !actor->tracer) { // Didn't fit - change back to artifact mo->Destroy (); - AActor *arti = Spawn (actor->x, actor->y, actor->z); + AActor *arti = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (arti) arti->flags |= MF_DROPPED; return; } @@ -148,7 +148,7 @@ void A_Summon (AActor *actor) else { mo->tracer = actor->tracer; // Pointer to master - AInventory *power = Spawn (0, 0, 0); + AInventory *power = Spawn (0, 0, 0, NO_REPLACE); power->TryPickup (actor->tracer); if (actor->tracer->player != NULL) { @@ -157,7 +157,7 @@ void A_Summon (AActor *actor) } // Make smoke puff - Spawn (actor->x, actor->y, actor->z); + Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); S_SoundID (actor, CHAN_VOICE, mo->ActiveSound, 1, ATTN_NORM); } } diff --git a/src/g_hexen/a_teleportother.cpp b/src/g_hexen/a_teleportother.cpp index 17ec05c14..0814a7a44 100644 --- a/src/g_hexen/a_teleportother.cpp +++ b/src/g_hexen/a_teleportother.cpp @@ -164,7 +164,7 @@ static void TeloSpawn (AActor *source, const PClass *type) { AActor *fx; - fx = Spawn (type, source->x, source->y, source->z); + fx = Spawn (type, source->x, source->y, source->z, ALLOW_REPLACE); if (fx) { fx->special1 = TELEPORT_LIFE; // Lifetime countdown diff --git a/src/g_hexen/a_weaponpieces.cpp b/src/g_hexen/a_weaponpieces.cpp index b751afd8e..8e6cf4465 100644 --- a/src/g_hexen/a_weaponpieces.cpp +++ b/src/g_hexen/a_weaponpieces.cpp @@ -138,7 +138,7 @@ bool AFourthWeaponPiece::TryPickup (AActor *toucher) if (gaveWeapon) { - TempFourthWeapon = static_cast(Spawn (FourthWeaponClass, x, y, z)); + TempFourthWeapon = static_cast(Spawn (FourthWeaponClass, x, y, z, NO_REPLACE)); if (TempFourthWeapon != NULL) { gaveWeapon = TempFourthWeapon->TryPickup (toucher); diff --git a/src/g_hexen/a_wraith.cpp b/src/g_hexen/a_wraith.cpp index 122b8a3fc..90801ea54 100644 --- a/src/g_hexen/a_wraith.cpp +++ b/src/g_hexen/a_wraith.cpp @@ -416,7 +416,7 @@ void A_WraithFX2 (AActor *actor) for (i = 2; i; --i) { - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if(mo) { if (pr_wraithfx2 ()<128) @@ -453,7 +453,7 @@ void A_WraithFX3 (AActor *actor) while (numdropped-- > 0) { - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (mo) { mo->x += (pr_wraithfx3()-128)<<11; @@ -501,7 +501,7 @@ void A_WraithFX4 (AActor *actor) if (spawn4) { - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (mo) { mo->x += (pr_wraithfx4()-128)<<12; @@ -512,7 +512,7 @@ void A_WraithFX4 (AActor *actor) } if (spawn5) { - mo = Spawn (actor->x, actor->y, actor->z); + mo = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (mo) { mo->x += (pr_wraithfx4()-128)<<11; diff --git a/src/g_raven/a_artiegg.cpp b/src/g_raven/a_artiegg.cpp index 4237422f3..bc960c133 100644 --- a/src/g_raven/a_artiegg.cpp +++ b/src/g_raven/a_artiegg.cpp @@ -54,7 +54,7 @@ bool P_MorphPlayer (player_t *p, const PClass *spawntype) return false; } - morphed = static_cast(Spawn (spawntype, actor->x, actor->y, actor->z)); + morphed = static_cast(Spawn (spawntype, actor->x, actor->y, actor->z, NO_REPLACE)); DObject::PointerSubstitution (actor, morphed); morphed->angle = actor->angle; morphed->target = actor->target; @@ -69,7 +69,7 @@ bool P_MorphPlayer (player_t *p, const PClass *spawntype) morphed->flags |= actor->flags & (MF_SHADOW|MF_NOGRAVITY); morphed->flags2 |= actor->flags2 & MF2_FLY; morphed->flags3 |= actor->flags3 & MF3_GHOST; - Spawn (actor->x, actor->y, actor->z + TELEFOGHEIGHT); + Spawn (actor->x, actor->y, actor->z + TELEFOGHEIGHT, ALLOW_REPLACE); actor->player = NULL; actor->flags &= ~(MF_SOLID|MF_SHOOTABLE); actor->flags |= MF_UNMORPHED; @@ -163,7 +163,7 @@ bool P_UndoPlayerMorph (player_t *player, bool force) } angle = mo->angle >> ANGLETOFINESHIFT; Spawn (pmo->x + 20*finecosine[angle], - pmo->y + 20*finesine[angle], pmo->z + TELEFOGHEIGHT); + pmo->y + 20*finesine[angle], pmo->z + TELEFOGHEIGHT, ALLOW_REPLACE); beastweap = player->ReadyWeapon; if (player->PremorphWeapon != NULL) { @@ -205,7 +205,7 @@ bool P_MorphMonster (AActor *actor, const PClass *spawntype) return false; } - morphed = Spawn (spawntype, actor->x, actor->y, actor->z); + morphed = Spawn (spawntype, actor->x, actor->y, actor->z, NO_REPLACE); DObject::PointerSubstitution (actor, morphed); morphed->tid = actor->tid; morphed->angle = actor->angle; @@ -230,7 +230,7 @@ bool P_MorphMonster (AActor *actor, const PClass *spawntype) actor->flags &= ~(MF_SOLID|MF_SHOOTABLE); actor->flags |= MF_UNMORPHED; actor->renderflags |= RF_INVISIBLE; - Spawn (actor->x, actor->y, actor->z + TELEFOGHEIGHT); + Spawn (actor->x, actor->y, actor->z + TELEFOGHEIGHT, ALLOW_REPLACE); return true; } @@ -285,7 +285,7 @@ bool P_UpdateMorphedMonster (AActor *beast, int tics) beast->tracer = NULL; DObject::PointerSubstitution (beast, actor); beast->Destroy (); - Spawn (beast->x, beast->y, beast->z + TELEFOGHEIGHT); + Spawn (beast->x, beast->y, beast->z + TELEFOGHEIGHT, ALLOW_REPLACE); return true; } diff --git a/src/g_raven/a_minotaur.cpp b/src/g_raven/a_minotaur.cpp index 6c1f1c6fc..405de4548 100644 --- a/src/g_raven/a_minotaur.cpp +++ b/src/g_raven/a_minotaur.cpp @@ -598,7 +598,7 @@ void A_MinotaurCharge (AActor *actor) { type = PClass::FindClass ("PunchPuff"); } - puff = Spawn (type, actor->x, actor->y, actor->z); + puff = Spawn (type, actor->x, actor->y, actor->z, ALLOW_REPLACE); puff->momz = 2*FRACUNIT; actor->special1--; } @@ -714,7 +714,7 @@ void A_MntrFloorFire (AActor *actor) actor->z = actor->floorz; x = actor->x + (pr_fire.Random2 () << 10); y = actor->y + (pr_fire.Random2 () << 10); - mo = Spawn (x, y, ONFLOORZ); + mo = Spawn (x, y, ONFLOORZ, ALLOW_REPLACE); mo->target = actor->target; mo->momx = 1; // Force block checking P_CheckMissileSpawn (mo); @@ -967,5 +967,5 @@ void A_SmokePuffEntry(mobj_t *actor) void A_SmokePuffExit (AActor *actor) { - Spawn (actor->x, actor->y, actor->z); + Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); } diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index ee4230e71..77e7ed292 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -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 ( 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 (actor->x, actor->y, actor->z + actor->player->mo->ViewHeight); + AIceChunkHead *head = Spawn (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); diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index d4dc856fe..1f84c63af 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -42,7 +42,7 @@ IMPLEMENT_ABSTRACT_ACTOR (APowerup) bool APowerupGiver::Use (bool pickup) { - APowerup *power = static_cast (Spawn (PowerupType, 0, 0, 0)); + APowerup *power = static_cast (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 (Owner->x, Owner->y, Owner->z); + AActor *speedMo = Spawn (Owner->x, Owner->y, Owner->z, NO_REPLACE); if (speedMo) { speedMo->angle = Owner->angle; diff --git a/src/g_shared/a_bridge.cpp b/src/g_shared/a_bridge.cpp index 94d313939..694b55887 100644 --- a/src/g_shared/a_bridge.cpp +++ b/src/g_shared/a_bridge.cpp @@ -124,15 +124,15 @@ void A_BridgeInit (AActor *self) self->special1 = 0; // Spawn triad into world - ball1 = Spawn (cx, cy, cz); + ball1 = Spawn (cx, cy, cz, ALLOW_REPLACE); ball1->angle = startangle; ball1->target = self; - ball2 = Spawn (cx, cy, cz); + ball2 = Spawn (cx, cy, cz, ALLOW_REPLACE); ball2->angle = startangle + ANGLE_45/32*85; ball2->target = self; - ball3 = Spawn (cx, cy, cz); + ball3 = Spawn (cx, cy, cz, ALLOW_REPLACE); ball3->angle = startangle + (angle_t)ANGLE_45/32*170; ball3->target = self; diff --git a/src/g_shared/a_debris.cpp b/src/g_shared/a_debris.cpp index 3d4b7f433..a04fe2731 100644 --- a/src/g_shared/a_debris.cpp +++ b/src/g_shared/a_debris.cpp @@ -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; diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 013ffea08..a4893a565 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -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(Spawn (type, 0, 0, 0)); - type->ActorInfo->Replacement = replacesave; + + copy = static_cast(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 (self->x, self->y, self->z); + Spawn (self->x, self->y, self->z, ALLOW_REPLACE); } } @@ -594,7 +590,7 @@ bool AInventory::GoAway () { if (ItemFlags & IF_PICKUPFLASH) { - Spawn (x, y, z); + Spawn (x, y, z, ALLOW_REPLACE); } return false; } @@ -603,7 +599,7 @@ bool AInventory::GoAway () { if (ItemFlags & IF_PICKUPFLASH) { - Spawn (x, y, z); + Spawn (x, y, z, ALLOW_REPLACE); } Hide (); if (ShouldRespawn ()) @@ -649,7 +645,7 @@ AInventory *AInventory::CreateCopy (AActor *other) if (GoAway ()) { - copy = static_cast(Spawn (GetClass(), 0, 0, 0)); + copy = static_cast(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(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 (0,0,0); + armor = Spawn (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 (0,0,0); + armor = Spawn (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 (0, 0, 0); + ABasicArmor *copy = Spawn (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 (0, 0, 0); + AHexenArmor *copy = Spawn (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(other->FindInventory (type)); if (ammo == NULL) { // The player did not have the ammo. Add it. - ammo = static_cast(Spawn (type, 0, 0, 0)); + ammo = static_cast(Spawn (type, 0, 0, 0, NO_REPLACE)); ammo->Amount = bDepleted ? 0 : ammo->BackpackAmount; ammo->MaxAmount = ammo->BackpackMaxAmount; ammo->AttachToOwner (other); diff --git a/src/g_shared/a_soundsequence.cpp b/src/g_shared/a_soundsequence.cpp index ac11da254..913165288 100644 --- a/src/g_shared/a_soundsequence.cpp +++ b/src/g_shared/a_soundsequence.cpp @@ -147,7 +147,7 @@ void ASoundSequence::PostBeginPlay () } if (master == NULL) { - master = Spawn (0, 0, 0); + master = Spawn (0, 0, 0, NO_REPLACE); master->Sequence = SN_StartSequence (master, slot, 0); } master->Sequence->AddChoice (args[0], SEQ_ENVIRONMENT); diff --git a/src/g_shared/a_weaponpiece.cpp b/src/g_shared/a_weaponpiece.cpp index 2ade057ed..2e987c33e 100644 --- a/src/g_shared/a_weaponpiece.cpp +++ b/src/g_shared/a_weaponpiece.cpp @@ -64,7 +64,7 @@ bool AWeaponPiece::TryPickup (AActor *toucher) } if (!hold) { - hold=static_cast(Spawn(RUNTIME_CLASS(AWeaponHolder), 0, 0, 0)); + hold=static_cast(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(Spawn(WeaponClass, 0, 0, 0)); + FullWeapon= static_cast(Spawn(WeaponClass, 0, 0, 0, NO_REPLACE)); // The weapon itself should not give more ammo to the player! FullWeapon->AmmoGive1=0; diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index 4b8147ba1..195e98590 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -253,7 +253,7 @@ AAmmo *AWeapon::AddAmmo (AActor *other, const PClass *ammotype, int amount) ammo = static_cast(other->FindInventory (ammotype)); if (ammo == NULL) { - ammo = static_cast(Spawn (ammotype, 0, 0, 0)); + ammo = static_cast(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(Owner->FindInventory (weapontype)); if (weap == NULL) { - weap = static_cast(Spawn (weapontype, 0, 0, 0)); + weap = static_cast(Spawn (weapontype, 0, 0, 0, NO_REPLACE)); weap->AttachToOwner (Owner); } return weap; diff --git a/src/g_strife/a_alienspectres.cpp b/src/g_strife/a_alienspectres.cpp index c319282f5..5d03112cf 100644 --- a/src/g_strife/a_alienspectres.cpp +++ b/src/g_strife/a_alienspectres.cpp @@ -343,7 +343,7 @@ END_DEFAULTS static void GenericSpectreSpawn (AActor *actor, const PClass *type) { - AActor *spectre = Spawn (type, actor->x, actor->y, actor->z); + AActor *spectre = Spawn (type, actor->x, actor->y, actor->z, ALLOW_REPLACE); if (spectre != NULL) { spectre->momz = pr_spectrespawn() << 9; @@ -377,7 +377,7 @@ void A_SpawnSpectre5 (AActor *actor) void A_212e4 (AActor *self) { - AActor *foo = Spawn (self->x, self->y, self->z + 10*FRACUNIT); + AActor *foo = Spawn (self->x, self->y, self->z + 10*FRACUNIT, ALLOW_REPLACE); if (foo != NULL) { @@ -395,7 +395,7 @@ void A_212e4 (AActor *self) void A_2134c (AActor *self) { - AActor *foo = Spawn (self->x, self->y, self->z + 10*FRACUNIT); + AActor *foo = Spawn (self->x, self->y, self->z + 10*FRACUNIT, ALLOW_REPLACE); if (foo != NULL) { @@ -464,7 +464,7 @@ void A_20334 (AActor *self) if (self->target == NULL) return; - AActor *foo = Spawn (self->x, self->y, self->z + 32*FRACUNIT); + AActor *foo = Spawn (self->x, self->y, self->z + 32*FRACUNIT, ALLOW_REPLACE); foo->momz = -12*FRACUNIT; foo->target = self; diff --git a/src/g_strife/a_coin.cpp b/src/g_strife/a_coin.cpp index 3d58f624c..ce808250e 100644 --- a/src/g_strife/a_coin.cpp +++ b/src/g_strife/a_coin.cpp @@ -69,7 +69,7 @@ AInventory *ACoin::CreateCopy (AActor *other) { return Super::CreateCopy (other); } - AInventory *copy = Spawn (0,0,0); + AInventory *copy = Spawn (0,0,0, NO_REPLACE); copy->Amount = Amount; copy->BecomeItem (); GoAwayAndDie (); @@ -185,22 +185,22 @@ AInventory *ACoin::CreateTossable () if (Amount >= 50) { Amount -= 50; - tossed = Spawn (Owner->x, Owner->y, Owner->z); + tossed = Spawn (Owner->x, Owner->y, Owner->z, NO_REPLACE); } else if (Amount >= 25) { Amount -= 25; - tossed = Spawn (Owner->x, Owner->y, Owner->z); + tossed = Spawn (Owner->x, Owner->y, Owner->z, NO_REPLACE); } else if (Amount >= 10) { Amount -= 10; - tossed = Spawn (Owner->x, Owner->y, Owner->z); + tossed = Spawn (Owner->x, Owner->y, Owner->z, NO_REPLACE); } else if (Amount > 1) { Amount -= 1; - tossed = Spawn (Owner->x, Owner->y, Owner->z); + tossed = Spawn (Owner->x, Owner->y, Owner->z, NO_REPLACE); } else { diff --git a/src/g_strife/a_entityboss.cpp b/src/g_strife/a_entityboss.cpp index b1fd91eca..bb0457535 100644 --- a/src/g_strife/a_entityboss.cpp +++ b/src/g_strife/a_entityboss.cpp @@ -295,7 +295,7 @@ void A_200e0 (AActor *self) case 0: if (self->target != NULL) { - bar = Spawn (self->x, self->y, ONFLOORZ); + bar = Spawn (self->x, self->y, ONFLOORZ, ALLOW_REPLACE); bar->threshold = 25; bar->target = self; bar->tracer = self->target; @@ -347,7 +347,7 @@ void A_200e0 (AActor *self) void A_SpawnEntity (AActor *self) { - AActor *entity = Spawn (self->x, self->y, self->z + 70*FRACUNIT); + AActor *entity = Spawn (self->x, self->y, self->z + 70*FRACUNIT, ALLOW_REPLACE); if (entity != NULL) { entity->angle = self->angle; @@ -365,7 +365,7 @@ void A_20c74 (AActor *selfa) an = self->angle >> ANGLETOFINESHIFT; second = Spawn (self->SpawnX + FixedMul (secondRadius, finecosine[an]), - self->SpawnY + FixedMul (secondRadius, finesine[an]), self->SpawnZ); + self->SpawnY + FixedMul (secondRadius, finesine[an]), self->SpawnZ, ALLOW_REPLACE); second->target = self->target; A_FaceTarget (second); an = second->angle >> ANGLETOFINESHIFT; @@ -374,7 +374,7 @@ void A_20c74 (AActor *selfa) an = (self->angle + ANGLE_90) >> ANGLETOFINESHIFT; second = Spawn (self->SpawnX + FixedMul (secondRadius, finecosine[an]), - self->SpawnY + FixedMul (secondRadius, finesine[an]), self->SpawnZ); + self->SpawnY + FixedMul (secondRadius, finesine[an]), self->SpawnZ, ALLOW_REPLACE); second->target = self->target; second->momx = FixedMul (secondRadius, finecosine[an]) << 2; second->momy = FixedMul (secondRadius, finesine[an]) << 2; @@ -382,7 +382,7 @@ void A_20c74 (AActor *selfa) an = (self->angle - ANGLE_90) >> ANGLETOFINESHIFT; second = Spawn (self->SpawnX + FixedMul (secondRadius, finecosine[an]), - self->SpawnY + FixedMul (secondRadius, finesine[an]), self->SpawnZ); + self->SpawnY + FixedMul (secondRadius, finesine[an]), self->SpawnZ, ALLOW_REPLACE); second->target = self->target; second->momx = FixedMul (secondRadius, finecosine[an]) << 2; second->momy = FixedMul (secondRadius, finesine[an]) << 2; diff --git a/src/g_strife/a_inquisitor.cpp b/src/g_strife/a_inquisitor.cpp index 2581e0d90..4d440dfe7 100644 --- a/src/g_strife/a_inquisitor.cpp +++ b/src/g_strife/a_inquisitor.cpp @@ -287,7 +287,7 @@ void A_InquisitorCheckLand (AActor *self) void A_TossArm (AActor *self) { - AActor *foo = Spawn (self->x, self->y, self->z + 24*FRACUNIT); + AActor *foo = Spawn (self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE); foo->angle = self->angle - ANGLE_90 + (pr_inq.Random2() << 22); foo->momx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]) >> 3; foo->momy = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]) >> 3; diff --git a/src/g_strife/a_loremaster.cpp b/src/g_strife/a_loremaster.cpp index 40458bc63..28de62a6e 100644 --- a/src/g_strife/a_loremaster.cpp +++ b/src/g_strife/a_loremaster.cpp @@ -205,7 +205,7 @@ void A_20598 (AActor *self) void A_205b0 (AActor *self) { S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM); - Spawn (self->x, self->y, self->z); - Spawn (self->x - (self->momx >> 1), self->y - (self->momy >> 1), self->z - (self->momz >> 1)); - Spawn (self->x - self->momx, self->y - self->momy, self->z - self->momz); + Spawn (self->x, self->y, self->z, ALLOW_REPLACE); + Spawn (self->x - (self->momx >> 1), self->y - (self->momy >> 1), self->z - (self->momz >> 1), ALLOW_REPLACE); + Spawn (self->x - self->momx, self->y - self->momy, self->z - self->momz, ALLOW_REPLACE); } diff --git a/src/g_strife/a_programmer.cpp b/src/g_strife/a_programmer.cpp index b316da9fa..9a4a2f1cf 100644 --- a/src/g_strife/a_programmer.cpp +++ b/src/g_strife/a_programmer.cpp @@ -247,7 +247,7 @@ void A_SpotLightning (AActor *self) if (self->target == NULL) return; - spot = Spawn (self->target->x, self->target->y, ONFLOORZ); + spot = Spawn (self->target->x, self->target->y, ONFLOORZ, ALLOW_REPLACE); if (spot != NULL) { spot->threshold = 25; @@ -265,7 +265,7 @@ void A_SpotLightning (AActor *self) void A_SpawnProgrammerBase (AActor *self) { - AActor *foo = Spawn (self->x, self->y, self->z + 24*FRACUNIT); + AActor *foo = Spawn (self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE); if (foo != NULL) { foo->angle = self->angle + ANGLE_180 + (pr_prog.Random2() << 22); diff --git a/src/g_strife/a_rebels.cpp b/src/g_strife/a_rebels.cpp index 58e312e50..52ecfa239 100644 --- a/src/g_strife/a_rebels.cpp +++ b/src/g_strife/a_rebels.cpp @@ -279,7 +279,7 @@ void A_Beacon (AActor *self) ARebel *rebel; angle_t an; - rebel = Spawn (self->x, self->y, ONFLOORZ); + rebel = Spawn (self->x, self->y, ONFLOORZ, ALLOW_REPLACE); if (!P_TryMove (rebel, rebel->x, rebel->y, true)) { rebel->Destroy (); @@ -313,7 +313,7 @@ void A_Beacon (AActor *self) rebel->SetState (rebel->SeeState); rebel->angle = self->angle; an = self->angle >> ANGLETOFINESHIFT; - Spawn (rebel->x + 20*finecosine[an], rebel->y + 20*finesine[an], rebel->z + TELEFOGHEIGHT); + Spawn (rebel->x + 20*finecosine[an], rebel->y + 20*finesine[an], rebel->z + TELEFOGHEIGHT, ALLOW_REPLACE); if (--self->health < 0) { self->Destroy (); diff --git a/src/g_strife/a_sentinel.cpp b/src/g_strife/a_sentinel.cpp index 4678713ee..e43c16218 100644 --- a/src/g_strife/a_sentinel.cpp +++ b/src/g_strife/a_sentinel.cpp @@ -163,7 +163,7 @@ void A_SentinelAttack (AActor *self) trail = Spawn ( self->x + FixedMul (missile->radius * i, finecosine[missile->angle >> ANGLETOFINESHIFT]), self->y + FixedMul (missile->radius * i, finesine[missile->angle >> ANGLETOFINESHIFT]), - missile->z + (missile->momz / 4 * i)); + missile->z + (missile->momz / 4 * i), ALLOW_REPLACE); if (trail != NULL) { trail->target = self; diff --git a/src/g_strife/a_spectral.cpp b/src/g_strife/a_spectral.cpp index cc08ab843..aa63b2fef 100644 --- a/src/g_strife/a_spectral.cpp +++ b/src/g_strife/a_spectral.cpp @@ -149,7 +149,7 @@ END_DEFAULTS void A_2046c (AActor *self) { - AActor *foo = Spawn (self->x - self->momx, self->y - self->momy, self->z); + AActor *foo = Spawn (self->x - self->momx, self->y - self->momy, self->z, ALLOW_REPLACE); foo->angle = self->angle; foo->health = self->health; @@ -290,13 +290,13 @@ void A_201fc (AActor *self) y = self->y + pr_zap5.Random2(3) * FRACUNIT * 50; flash = Spawn (self->threshold > 25 ? RUNTIME_CLASS(ASpectralLightningV2) : - RUNTIME_CLASS(ASpectralLightningV1), x, y, ONCEILINGZ); + RUNTIME_CLASS(ASpectralLightningV1), x, y, ONCEILINGZ, ALLOW_REPLACE); flash->target = self->target; flash->momz = -18*FRACUNIT; flash->health = self->health; - flash = Spawn (self->x, self->y, ONCEILINGZ); + flash = Spawn (self->x, self->y, ONCEILINGZ, ALLOW_REPLACE); flash->target = self->target; flash->momz = -18*FRACUNIT; diff --git a/src/g_strife/a_strifeitems.cpp b/src/g_strife/a_strifeitems.cpp index b5c096f3e..0e50cfeeb 100644 --- a/src/g_strife/a_strifeitems.cpp +++ b/src/g_strife/a_strifeitems.cpp @@ -155,7 +155,7 @@ bool AHealthTraining::TryPickup (AActor *toucher) if (Super::TryPickup (toucher)) { toucher->GiveInventoryType (RUNTIME_CLASS(AGunTraining)); - AInventory *coin = Spawn (0,0,0); + AInventory *coin = Spawn (0,0,0, NO_REPLACE); if (coin != NULL) { coin->Amount = toucher->player->accuracy*5 + 300; diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index 0a3ecb4f7..92d731b89 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -768,7 +768,7 @@ END_DEFAULTS void A_TossGib (AActor *self) { const PClass *gibtype = (self->flags & MF_NOBLOOD) ? RUNTIME_CLASS(AJunk) : RUNTIME_CLASS(AMeat); - AActor *gib = Spawn (gibtype, self->x, self->y, self->z + 24*FRACUNIT); + AActor *gib = Spawn (gibtype, self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE); angle_t an; int speed; @@ -965,7 +965,7 @@ void A_ItBurnsItBurns (AActor *self) void A_DropFire (AActor *self) { - AActor *drop = Spawn (self->x, self->y, self->z + 24*FRACUNIT); + AActor *drop = Spawn (self->x, self->y, self->z + 24*FRACUNIT, ALLOW_REPLACE); drop->momz = -FRACUNIT; P_RadiusAttack (self, self, 64, 64, MOD_FIRE, false); } diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index 3e1614fc2..cfb38585f 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -746,7 +746,7 @@ END_DEFAULTS AInventory *AAssaultGunStanding::CreateCopy (AActor *other) { - AAssaultGun *copy = Spawn (0,0,0); + AAssaultGun *copy = Spawn (0,0,0, NO_REPLACE); copy->AmmoGive1 = AmmoGive1; copy->AmmoGive2 = AmmoGive2; GoAwayAndDie (); @@ -933,7 +933,7 @@ void A_RocketInFlight (AActor *self) 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, true); - trail = Spawn (self->x - self->momx, self->y - self->momy, self->z); + trail = Spawn (self->x - self->momx, self->y - self->momy, self->z, ALLOW_REPLACE); if (trail != NULL) { trail->momz = FRACUNIT; @@ -1396,7 +1396,7 @@ void A_MaulerTorpedoWave (AActor *self) AActor *P_SpawnSubMissile (AActor *source, PClass *type, AActor *target) { - AActor *other = Spawn (type, source->x, source->y, source->z); + AActor *other = Spawn (type, source->x, source->y, source->z, ALLOW_REPLACE); if (other == NULL) { @@ -1576,7 +1576,7 @@ int APhosphorousFire::DoSpecialDamage (AActor *target, int damage) void A_SpawnBurn (AActor *self) { - Spawn (self->x, self->y, self->z); + Spawn (self->x, self->y, self->z, ALLOW_REPLACE); } void A_BurnArea (AActor *self) @@ -1627,7 +1627,7 @@ void A_Burnination (AActor *self) AActor *drop = Spawn ( x, y, - self->z + 4*FRACUNIT); + self->z + 4*FRACUNIT, ALLOW_REPLACE); if (drop != NULL) { drop->momx = self->momx + ((pr_phburn.Random2 (7)) << FRACBITS); @@ -2047,7 +2047,7 @@ bool ASigil::HandlePickup (AInventory *item) AInventory *ASigil::CreateCopy (AActor *other) { - ASigil *copy = Spawn (0,0,0); + ASigil *copy = Spawn (0,0,0, NO_REPLACE); copy->Amount = Amount; copy->MaxAmount = MaxAmount; copy->NumPieces = NumPieces; @@ -2199,7 +2199,7 @@ void A_FireSigil1 (AActor *actor) P_BulletSlope (actor); if (linetarget != NULL) { - spot = Spawn (linetarget->x, linetarget->y, ONFLOORZ); + spot = Spawn (linetarget->x, linetarget->y, ONFLOORZ, ALLOW_REPLACE); if (spot != NULL) { spot->tracer = linetarget; @@ -2207,7 +2207,7 @@ void A_FireSigil1 (AActor *actor) } else { - spot = Spawn (actor->x, actor->y, actor->z); + spot = Spawn (actor->x, actor->y, actor->z, ALLOW_REPLACE); if (spot != NULL) { spot->momx += 28 * finecosine[actor->angle >> ANGLETOFINESHIFT]; @@ -2380,7 +2380,7 @@ int ASigil::GiveSigilPiece (AActor *receiver) sigil = receiver->FindInventory (); if (sigil == NULL) { - sigil = Spawn (0,0,0); + sigil = Spawn (0,0,0, NO_REPLACE); if (!sigil->TryPickup (receiver)) { sigil->Destroy (); diff --git a/src/g_strife/a_thingstoblowup.cpp b/src/g_strife/a_thingstoblowup.cpp index b2212162f..ee53d16da 100644 --- a/src/g_strife/a_thingstoblowup.cpp +++ b/src/g_strife/a_thingstoblowup.cpp @@ -60,7 +60,7 @@ void A_Bang4Cloud (AActor *self) spawnx = self->x + (pr_bang4cloud.Random2() & 3) * 10240; spawny = self->y + (pr_bang4cloud.Random2() & 3) * 10240; - Spawn (spawnx, spawny, self->z); + Spawn (spawnx, spawny, self->z, ALLOW_REPLACE); } // Piston ------------------------------------------------------------------- @@ -74,7 +74,7 @@ void A_GiveQuestItem (AActor *self) { if (playeringame[i]) { - AInventory *item = static_cast(Spawn (QuestItemClasses[questitem-1], 0,0,0)); + AInventory *item = static_cast(Spawn (QuestItemClasses[questitem-1], 0,0,0, NO_REPLACE)); if (!item->TryPickup (players[i].mo)) { item->Destroy (); @@ -272,7 +272,7 @@ void A_LightGoesOut (AActor *self) for (int i = 0; i < 8; ++i) { - foo = Spawn("Rubble1", self->x, self->y, self->z); + foo = Spawn("Rubble1", self->x, self->y, self->z, ALLOW_REPLACE); if (foo != NULL) { int t = pr_lightout() & 15; diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 9258b1e39..ce542d7d2 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -418,7 +418,7 @@ void GiveSpawner (player_t *player, const PClass *type, int amount) } AInventory *item = static_cast - (Spawn (type, player->mo->x, player->mo->y, player->mo->z)); + (Spawn (type, player->mo->x, player->mo->y, player->mo->z, NO_REPLACE)); if (item != NULL) { if (amount > 0) @@ -533,7 +533,7 @@ void cht_Give (player_t *player, char *name, int amount) AInventory *ammo = player->mo->FindInventory (type); if (ammo == NULL) { - ammo = static_cast(Spawn (type, 0, 0, 0)); + ammo = static_cast(Spawn (type, 0, 0, 0, NO_REPLACE)); ammo->AttachToOwner (player->mo); ammo->Amount = ammo->MaxAmount; } @@ -552,7 +552,7 @@ void cht_Give (player_t *player, char *name, int amount) { if (gameinfo.gametype != GAME_Hexen) { - ABasicArmorPickup *armor = Spawn (0,0,0); + ABasicArmorPickup *armor = Spawn (0,0,0, NO_REPLACE); armor->SaveAmount = 100*deh.BlueAC; armor->SavePercent = gameinfo.gametype != GAME_Heretic ? FRACUNIT/2 : FRACUNIT*3/4; if (!armor->TryPickup (player->mo)) @@ -564,7 +564,7 @@ void cht_Give (player_t *player, char *name, int amount) { for (i = 0; i < 4; ++i) { - AHexenArmor *armor = Spawn (0,0,0); + AHexenArmor *armor = Spawn (0,0,0, NO_REPLACE); armor->health = i; armor->Amount = 0; if (!armor->TryPickup (player->mo)) @@ -587,7 +587,7 @@ void cht_Give (player_t *player, char *name, int amount) AKey *key = (AKey *)GetDefaultByType (PClass::m_Types[i]); if (key->KeyNumber != 0) { - key = static_cast(Spawn (PClass::m_Types[i], 0,0,0)); + key = static_cast(Spawn (PClass::m_Types[i], 0,0,0, NO_REPLACE)); if (!key->TryPickup (player->mo)) { key->Destroy (); diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 1d6e38919..785fec187 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -175,7 +175,7 @@ static void DoGiveInv (AActor *actor, const PClass *info, int amount) ? actor->player->PendingWeapon : NULL; bool hadweap = actor->player != NULL ? actor->player->ReadyWeapon != NULL : true; - AInventory *item = static_cast(Spawn (info, 0,0,0)); + AInventory *item = static_cast(Spawn (info, 0,0,0, NO_REPLACE)); // This shouldn't count for the item statistics! if (item->flags & MF_COUNTITEM) @@ -1840,9 +1840,7 @@ int DLevelScript::DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, i if (info != NULL) { - // Handle decorate replacements. - info = info->ActorInfo->GetReplacement()->Class; - actor = Spawn (info, x, y, z); + actor = Spawn (info, x, y, z, ALLOW_REPLACE); if (actor != NULL) { if (P_TestMobjLocation (actor)) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index c61e53d2a..3d2837612 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -903,7 +903,7 @@ static void PickConversationReply () if (takestuff) { - AInventory *item = static_cast (Spawn (reply->GiveType, 0, 0, 0)); + AInventory *item = static_cast (Spawn (reply->GiveType, 0, 0, 0, NO_REPLACE)); // Items given here should not count as items! if (item->flags & MF_COUNTITEM) { diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 8f0041115..3d050a6a5 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2210,10 +2210,7 @@ AInventory *P_DropItem (AActor *source, const PClass *type, int special, int cha spawnz += source->height / 2; } } - // Handle decorate replacements. - type = type->ActorInfo->GetReplacement()->Class; - - mo = Spawn (type, source->x, source->y, spawnz); + mo = Spawn (type, source->x, source->y, spawnz, ALLOW_REPLACE); mo->flags |= MF_DROPPED; mo->flags &= ~MF_NOGRAVITY; // [RH] Make sure it is affected by gravity if (mo->IsKindOf (RUNTIME_CLASS(AInventory))) diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 5137a0e69..834b255d8 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -2591,7 +2591,7 @@ FUNC(LS_GlassBreak) for (int i = 0; i < 7; ++i) { - glass = Spawn (x, y, ONFLOORZ); + glass = Spawn (x, y, ONFLOORZ, ALLOW_REPLACE); glass->z += 24 * FRACUNIT; glass->SetState (&AGlassJunk::States[3 + pr_glass() % 3]); diff --git a/src/p_map.cpp b/src/p_map.cpp index 498bd82f1..e142232d1 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -3053,7 +3053,7 @@ void P_RailAttack (AActor *source, int damage, int offset, int color1, int color } if (trace.CrossedWater) { - AActor *puff = Spawn (0, 0, 0); + AActor *puff = Spawn (0, 0, 0, ALLOW_REPLACE); if (puff != NULL) { SpawnDeepSplash (source, trace, puff, vx, vy, vz); @@ -3858,7 +3858,7 @@ void P_DoCrunch (AActor *thing) } if (!(thing->flags & MF_NOBLOOD)) { - AActor *gib = Spawn (thing->x, thing->y, thing->z); + AActor *gib = Spawn (thing->x, thing->y, thing->z, ALLOW_REPLACE); gib->RenderStyle = thing->RenderStyle; gib->alpha = thing->alpha; gib->height = 0; @@ -3921,7 +3921,7 @@ void P_DoCrunch (AActor *thing) AActor *mo; mo = Spawn (thing->x, thing->y, - thing->z + thing->height/2); + thing->z + thing->height/2, ALLOW_REPLACE); mo->momx = pr_crunch.Random2 () << 12; mo->momy = pr_crunch.Random2 () << 12; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 69711d157..891b495f9 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -813,7 +813,7 @@ AInventory *AActor::GiveInventoryType (const PClass *type) { AInventory *item; - item = static_cast(Spawn (type, 0,0,0)); + item = static_cast(Spawn (type, 0,0,0, NO_REPLACE)); if (!item->TryPickup (this)) { item->Destroy (); @@ -832,7 +832,7 @@ AInventory *AActor::GiveInventoryType (const PClass *type) bool AActor::GiveAmmo (const PClass *type, int amount) { - AInventory *item = static_cast(Spawn (type, 0, 0, 0)); + AInventory *item = static_cast(Spawn (type, 0, 0, 0, NO_REPLACE)); item->Amount = amount; item->flags |= MF_DROPPED; if (!item->TryPickup (this)) @@ -2147,7 +2147,7 @@ void P_NightmareRespawn (AActor *mobj) // spawn it x = mobj->SpawnPoint[0] << FRACBITS; y = mobj->SpawnPoint[1] << FRACBITS; - mo = Spawn (RUNTIME_TYPE(mobj), x, y, z); + mo = Spawn (RUNTIME_TYPE(mobj), x, y, z, NO_REPLACE); if (z == ONFLOORZ) mo->z += mo->SpawnPoint[2] << FRACBITS; @@ -2179,14 +2179,14 @@ void P_NightmareRespawn (AActor *mobj) mo->Translation = mobj->Translation; // spawn a teleport fog at old spot because of removal of the body? - mo = Spawn ("TeleportFog", mobj->x, mobj->y, mobj->z); + mo = Spawn ("TeleportFog", mobj->x, mobj->y, mobj->z, ALLOW_REPLACE); if (mo != NULL) { mo->z += TELEFOGHEIGHT; } // spawn a teleport fog at the new spot - mo = Spawn ("TeleportFog", x, y, z); + mo = Spawn ("TeleportFog", x, y, z, ALLOW_REPLACE); if (mo != NULL) { mo->z += TELEFOGHEIGHT; @@ -3014,7 +3014,7 @@ END_DEFAULTS // //========================================================================== -AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t iz) +AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t iz, replace_t allowreplacement) { if (type == NULL) { @@ -3026,6 +3026,10 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t I_Error ("%s is not an actor\n", type->TypeName.GetChars()); } + if (allowreplacement) + type = type->ActorInfo->GetReplacement()->Class; + + AActor *actor; actor = static_cast(const_cast(type)->CreateNew ()); @@ -3359,7 +3363,7 @@ void P_SpawnPlayer (mapthing2_t *mthing, bool startenterscripts) } mobj = static_cast - (Spawn (p->cls, mthing->x << FRACBITS, mthing->y << FRACBITS, ONFLOORZ)); + (Spawn (p->cls, mthing->x << FRACBITS, mthing->y << FRACBITS, ONFLOORZ, NO_REPLACE)); mobj->FriendPlayer = playernum + 1; // [RH] players are their own friends oldactor = p->mo; @@ -3457,7 +3461,7 @@ void P_SpawnPlayer (mapthing2_t *mthing, bool startenterscripts) if (multiplayer) { unsigned an = ( ANG45 * (mthing->angle/45) ) >> ANGLETOFINESHIFT; - Spawn ("TeleportFog", mobj->x+20*finecosine[an], mobj->y+20*finesine[an], mobj->z + TELEFOGHEIGHT); + Spawn ("TeleportFog", mobj->x+20*finecosine[an], mobj->y+20*finesine[an], mobj->z + TELEFOGHEIGHT, ALLOW_REPLACE); } // "Fix" for one of the starts on exec.wad MAP01: If you start inside the ceiling, @@ -3710,7 +3714,8 @@ void P_SpawnMapThing (mapthing2_t *mthing, int position) // it to the unknown thing. else { - // Handle decorate replacements. + // Handle decorate replacements explicitly here + // to check for missing frames in the replacement object. i = i->ActorInfo->GetReplacement()->Class; const AActor *defaults = GetDefaultByType (i); @@ -3785,7 +3790,7 @@ void P_SpawnMapThing (mapthing2_t *mthing, int position) z = ONFLOORZ; SpawningMapThing = true; - mobj = Spawn (i, x, y, z); + mobj = Spawn (i, x, y, z, NO_REPLACE); SpawningMapThing = false; if (z == ONFLOORZ) @@ -3833,7 +3838,7 @@ AActor *P_SpawnPuff (const PClass *pufftype, fixed_t x, fixed_t y, fixed_t z, an z += pr_spawnpuff.Random2 () << 10; - puff = Spawn (pufftype, x, y, z); + puff = Spawn (pufftype, x, y, z, ALLOW_REPLACE); // 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 @@ -3905,7 +3910,7 @@ void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AAc if (cl_bloodtype <= 1) { z += pr_spawnblood.Random2 () << 10; - th = Spawn (x, y, z); + th = Spawn (x, y, z, ALLOW_REPLACE); th->momz = FRACUNIT*2; th->angle = dir; if (gameinfo.gametype == GAME_Doom) @@ -3967,14 +3972,7 @@ void P_BloodSplatter (fixed_t x, fixed_t y, fixed_t z, AActor *originator) { AActor *mo; - if (gameinfo.gametype == GAME_Doom) - { - mo = Spawn (x, y, z); - } - else - { - mo = Spawn (x, y, z); - } + mo = Spawn (x, y, z, ALLOW_REPLACE); mo->target = originator; mo->momx = pr_splatter.Random2 () << 10; mo->momy = pr_splatter.Random2 () << 10; @@ -4006,7 +4004,7 @@ void P_RipperBlood (AActor *mo, AActor *bleeder) if (cl_bloodtype <= 1) { AActor *th; - th = Spawn (x, y, z); + th = Spawn (x, y, z, ALLOW_REPLACE); if (gameinfo.gametype == GAME_Heretic) th->flags |= MF_NOGRAVITY; th->momx = mo->momx >> 1; @@ -4093,14 +4091,14 @@ bool P_HitWater (AActor *thing, sector_t *sec) if (smallsplash && splash->SmallSplash) { - mo = Spawn (splash->SmallSplash, thing->x, thing->y, z); + mo = Spawn (splash->SmallSplash, thing->x, thing->y, z, ALLOW_REPLACE); if (mo) mo->floorclip += splash->SmallSplashClip; } else { if (splash->SplashChunk) { - mo = Spawn (splash->SplashChunk, thing->x, thing->y, z); + mo = Spawn (splash->SplashChunk, thing->x, thing->y, z, ALLOW_REPLACE); mo->target = thing; if (splash->ChunkXVelShift != 255) { @@ -4114,7 +4112,7 @@ bool P_HitWater (AActor *thing, sector_t *sec) } if (splash->SplashBase) { - mo = Spawn (splash->SplashBase, thing->x, thing->y, z); + mo = Spawn (splash->SplashBase, thing->x, thing->y, z, ALLOW_REPLACE); } if (thing->player && !splash->NoAlert) { @@ -4264,7 +4262,7 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z, z -= source->floorclip; } - AActor *th = Spawn (type, x, y, z); + AActor *th = Spawn (type, x, y, z, ALLOW_REPLACE); if (th->SeeSound) S_SoundID (th, CHAN_VOICE, th->SeeSound, 1, ATTN_NORM); @@ -4392,7 +4390,7 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, { z -= source->floorclip; } - mo = Spawn (type, source->x, source->y, z); + mo = Spawn (type, source->x, source->y, z, ALLOW_REPLACE); if (mo->SeeSound) { S_SoundID (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_NORM); @@ -4467,7 +4465,7 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, { z += 4*8*FRACUNIT - source->floorclip + (source->player? source->player->crouchoffset : 0); } - MissileActor = Spawn (type, x, y, z); + MissileActor = Spawn (type, x, y, z, ALLOW_REPLACE); if (MissileActor->SeeSound) { diff --git a/src/p_teleport.cpp b/src/p_teleport.cpp index 814501b94..b83a9b0aa 100644 --- a/src/p_teleport.cpp +++ b/src/p_teleport.cpp @@ -227,14 +227,14 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, if (sourceFog) { fixed_t fogDelta = thing->flags & MF_MISSILE ? 0 : TELEFOGHEIGHT; - Spawn (oldx, oldy, oldz + fogDelta); + Spawn (oldx, oldy, oldz + fogDelta, ALLOW_REPLACE); } if (useFog) { fixed_t fogDelta = thing->flags & MF_MISSILE ? 0 : TELEFOGHEIGHT; an = angle >> ANGLETOFINESHIFT; Spawn (x + 20*finecosine[an], - y + 20*finesine[an], thing->z + fogDelta); + y + 20*finesine[an], thing->z + fogDelta, ALLOW_REPLACE); if (thing->player) { // [RH] Zoom player's field of vision diff --git a/src/p_things.cpp b/src/p_things.cpp index 37d518c59..927e80b4a 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -64,7 +64,6 @@ bool P_Thing_Spawn (int tid, int type, angle_t angle, bool fog, int newtid) if ( (kind = SpawnableThings[type]) == NULL) return false; - // Handle decorate replacements. kind = kind->ActorInfo->GetReplacement()->Class; @@ -73,7 +72,7 @@ bool P_Thing_Spawn (int tid, int type, angle_t angle, bool fog, int newtid) while ( (spot = iterator.Next ()) ) { - mobj = Spawn (kind, spot->x, spot->y, spot->z); + mobj = Spawn (kind, spot->x, spot->y, spot->z, ALLOW_REPLACE); if (mobj != NULL) { @@ -85,7 +84,7 @@ bool P_Thing_Spawn (int tid, int type, angle_t angle, bool fog, int newtid) mobj->angle = (angle != ANGLE_MAX ? angle : spot->angle); if (fog) { - Spawn (spot->x, spot->y, spot->z + TELEFOGHEIGHT); + Spawn (spot->x, spot->y, spot->z + TELEFOGHEIGHT, ALLOW_REPLACE); } if (mobj->flags & MF_SPECIAL) mobj->flags |= MF_DROPPED; // Don't respawn @@ -131,8 +130,8 @@ bool P_MoveThing(AActor * source, fixed_t x, fixed_t y, fixed_t z, bool fog) { if (fog) { - Spawn (x, y, z + TELEFOGHEIGHT); - Spawn (oldx, oldy, oldz + TELEFOGHEIGHT); + Spawn (x, y, z + TELEFOGHEIGHT, ALLOW_REPLACE); + Spawn (oldx, oldy, oldz + TELEFOGHEIGHT, ALLOW_REPLACE); } return true; } @@ -213,7 +212,7 @@ bool P_Thing_Projectile (int tid, int type, const char * type_name, angle_t angl { z -= spot->floorclip; } - mobj = Spawn (kind, spot->x, spot->y, z); + mobj = Spawn (kind, spot->x, spot->y, z, ALLOW_REPLACE); if (mobj) { diff --git a/src/p_user.cpp b/src/p_user.cpp index 0125ed7d4..8b3a870a8 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -666,7 +666,7 @@ void APlayerPawn::GiveDeathmatchInventory() AKey *key = (AKey *)GetDefaultByType (PClass::m_Types[i]); if (key->KeyNumber != 0) { - key = static_cast(Spawn (PClass::m_Types[i], 0,0,0)); + key = static_cast(Spawn (PClass::m_Types[i], 0,0,0, NO_REPLACE)); if (!key->TryPickup (this)) { key->Destroy (); @@ -876,7 +876,7 @@ void APlayerPawn::GiveDefaultInventory () } else { - AInventory *item = static_cast(Spawn (ti, 0,0,0)); + AInventory *item = static_cast(Spawn (ti, 0,0,0, NO_REPLACE)); item->Amount = di->amount; if (item->IsKindOf (RUNTIME_CLASS (AWeapon))) { diff --git a/src/r_things.cpp b/src/r_things.cpp index 23410a3cc..6f380905e 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -566,7 +566,8 @@ void R_InitSkins (void) int lump = Wads.CheckNumForName (sc_String, skins[i].namespc); if (lump == -1) { - lump = Wads.CheckNumForName (sc_String, ns_sounds); + lump = Wads.CheckNumForFullName (sc_String); + if (lump == -1) lump = Wads.CheckNumForName (sc_String, ns_sounds); } if (lump != -1) { @@ -599,7 +600,8 @@ void R_InitSkins (void) sndlumps[j] = Wads.CheckNumForName (sc_String, skins[i].namespc); if (sndlumps[j] == -1) { // Replacement not found, try finding it in the global namespace - sndlumps[j] = Wads.CheckNumForName (sc_String, ns_sounds); + sndlumps[j] = Wads.CheckNumForFullName (sc_String); + if (sndlumps[j] == -1) sndlumps[j] = Wads.CheckNumForName (sc_String, ns_sounds); } } } diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index cb2455a39..92caad76e 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -439,8 +439,9 @@ int S_FindSoundTentative (const char *name) int S_AddSound (const char *logicalname, const char *lumpname) { - return S_AddSound (logicalname, - lumpname ? Wads.CheckNumForName (lumpname, ns_sounds) : -1); + int lump = Wads.CheckNumForFullName (lumpname); + if (lump == -1) lump = Wads.CheckNumForName (lumpname, ns_sounds); + return S_AddSound (logicalname, lump); } static int S_AddSound (const char *logicalname, int lumpnum) @@ -493,8 +494,15 @@ static int S_AddSound (const char *logicalname, int lumpnum) int S_AddPlayerSound (const char *pclass, int gender, int refid, const char *lumpname) { - return S_AddPlayerSound (pclass, gender, refid, - lumpname ? Wads.CheckNumForName (lumpname, ns_sounds) : -1); + int lump; + + if (lumpname) + { + lump = Wads.CheckNumForFullName (lumpname); + if (lump == -1) lump = Wads.CheckNumForName (lumpname, ns_sounds); + } + + return S_AddPlayerSound (pclass, gender, refid, lump); } int S_AddPlayerSound (const char *pclass, int gender, int refid, int lumpnum, bool fromskin) diff --git a/src/thingdef.cpp b/src/thingdef.cpp index 9ee018ce9..1e68f0278 100644 --- a/src/thingdef.cpp +++ b/src/thingdef.cpp @@ -3641,7 +3641,7 @@ static void PlayerStartItem (APlayerPawn *defaults, Baggage &bag) FDropItem * di=new FDropItem; SC_MustGetString(); - di->Name=strdup(sc_String); + di->Name = sc_String; di->probability=255; di->amount=0; if (SC_CheckNumber()) diff --git a/src/thingdef_codeptr.cpp b/src/thingdef_codeptr.cpp index 35d198e8c..dc7998fd3 100644 --- a/src/thingdef_codeptr.cpp +++ b/src/thingdef_codeptr.cpp @@ -1025,7 +1025,7 @@ static void DoGiveInventory(AActor * self, AActor * receiver) const PClass * mi=PClass::FindClass(item); if (mi) { - AInventory *item = static_cast(Spawn (mi, 0, 0, 0)); + AInventory *item = static_cast(Spawn (mi, 0, 0, 0, NO_REPLACE)); if (item->IsKindOf(RUNTIME_CLASS(AHealth))) { item->Amount *= amount; @@ -1143,13 +1143,10 @@ void A_SpawnItem(AActor * self) if (useammo && !weapon->DepleteAmmo(weapon->bAltFire)) return; } - // Handle decorate replacements. - missile = missile->ActorInfo->GetReplacement()->Class; - AActor * mo = Spawn( missile, self->x + FixedMul(distance, finecosine[self->angle>>ANGLETOFINESHIFT]), self->y + FixedMul(distance, finesine[self->angle>>ANGLETOFINESHIFT]), - self->z - self->floorclip + zheight); + self->z - self->floorclip + zheight, ALLOW_REPLACE); if (mo) { @@ -1236,7 +1233,8 @@ void A_ThrowGrenade(AActor * self) AActor * bo; bo = Spawn(missile, self->x, self->y, - self->z - self->floorclip + zheight + 35*FRACUNIT + (self->player? self->player->crouchoffset : 0)); + self->z - self->floorclip + zheight + 35*FRACUNIT + (self->player? self->player->crouchoffset : 0), + ALLOW_REPLACE); if (bo) { int pitch = self->pitch; @@ -1407,7 +1405,7 @@ void A_SpawnDebris(AActor * self) { mo = Spawn(debris, self->x+((pr_spawndebris()-128)<<12), self->y+((pr_spawndebris()-128)<<12), - self->z+(pr_spawndebris()*self->height/256)); + self->z+(pr_spawndebris()*self->height/256), ALLOW_REPLACE); if (mo && i < mo->GetClass()->ActorInfo->NumOwnedStates) { mo->SetState (mo->GetClass()->ActorInfo->OwnedStates + i); @@ -1636,7 +1634,7 @@ void A_Burst (AActor *actor) mo = Spawn(chunk, actor->x + (((pr_burst()-128)*actor->radius)>>7), actor->y + (((pr_burst()-128)*actor->radius)>>7), - actor->z + (pr_burst()*actor->height/255)); + actor->z + (pr_burst()*actor->height/255), ALLOW_REPLACE); if (mo) { diff --git a/src/thingdef_exp.cpp b/src/thingdef_exp.cpp index 33d381fcd..54deb3fa0 100644 --- a/src/thingdef_exp.cpp +++ b/src/thingdef_exp.cpp @@ -785,7 +785,7 @@ static ExpData *ParseExpressionA () { if (!stricmp (sc_String, ExpVars[i].name)) { - varid = i; + varid = (int)i; break; } }