diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 5836aaa2e..c54985e67 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,14 @@ +March 1, 2008 (Changes by Graf Zahl) +- Fixed: When starting a level while the music has been paused S_Start has + to stop the old music so the new one always starts at the beginning. +- Fixed:: AActor::master was not serialized. +- Fixed: Sound targets pointing to dead players should be cleared before + respawning the player. +- Fixed: When the DONTMOVE flag is set A_Chase must not call P_NewChaseDir. +- Changed PowerupGiver initialization so that the actual powerup class is looked + up during postprocessing. +- Gave Strife's instant death sector type its own damage type. + February 29, 2008 - Fixed: R_SetupAddClampCol() checked add4cols' memory instead of adclamp4cols' memory when deciding if it should skip modification. diff --git a/src/namedef.h b/src/namedef.h index 77ce6bafe..8cc2cc735 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -185,6 +185,7 @@ xx(BFGSplash) xx(DrainLife) // A weapon like the Sigil that drains your life away. xx(Massacre) // For death by a cheater! //(Melee) already defined above, so don't define it again +xx(InstantDeath) // Strife "instant death" // Special death name for getting killed excessively. Could be used as // a damage type if you wanted to force an extreme death. diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index bad0bcae8..214c4463c 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -1895,7 +1895,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi if (actor->flags & MF_JUSTATTACKED) { actor->flags &= ~MF_JUSTATTACKED; - if (!actor->isFast()) + if (!actor->isFast() && !dontmove) { P_NewChaseDir (actor); } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index a8a31ca6a..41a9b5a51 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -320,6 +320,9 @@ void AActor::Serialize (FArchive &arc) << gravity << FastChaseStrafeCount; + if (SaveVersion >=778) + arc << master; + if (arc.IsStoring ()) { int convnum = 0; @@ -3645,6 +3648,23 @@ void P_SpawnPlayer (mapthing2_t *mthing, bool tempplayer) else if (state == PST_REBORN) { assert (oldactor != NULL); + + // before relocating all pointers to the player all sound targets + // pointing to the old actor have to be NULLed. Otherwise all + // monsters who last targeted this player will wake up immediately + // after the player has respawned. + AActor *th; + TThinkerIterator it; + while ((th = it.Next())) + { + if (th->LastHeard == oldactor) th->LastHeard = NULL; + } + for(int i = 0; i < numsectors; i++) + { + if (sectors[i].SoundTarget == oldactor) sectors[i].SoundTarget = NULL; + } + + DObject::PointerSubstitution (oldactor, p->mo); // PointerSubstitution() will also affect the bodyque, so undo that now. for (int ii=0; ii < BODYQUESIZE; ++ii) diff --git a/src/p_spec.cpp b/src/p_spec.cpp index f1aba3c71..f8699a9e6 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -412,7 +412,7 @@ void P_PlayerInSpecialSector (player_t *player) case Damage_InstantDeath: // Strife's instant death sector - P_DamageMobj (player->mo, NULL, NULL, 999, NAME_None); + P_DamageMobj (player->mo, NULL, NULL, 999, NAME_InstantDeath); break; case dDamage_Hellslime: diff --git a/src/s_sound.cpp b/src/s_sound.cpp index c41556ca5..2bafc3fe8 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -443,9 +443,15 @@ void S_Start () LastLocalSndSeq = LocalSndSeq; } + SoundPaused = false; + + // stop the old music if it has been paused. + // This ensures that the new music is started from the beginning + // if it's the same as the last one and it has been paused. + if (MusicPaused) S_StopMusic(true); + // start new music for the level MusicPaused = false; - SoundPaused = false; // [RH] This is a lot simpler now. if (!savegamerestore) diff --git a/src/thingdef/thingdef.cpp b/src/thingdef/thingdef.cpp index 8246b1cd5..71f8ebde5 100644 --- a/src/thingdef/thingdef.cpp +++ b/src/thingdef/thingdef.cpp @@ -539,6 +539,41 @@ void FinishThingdef() } } + if (ti->IsDescendantOf(RUNTIME_CLASS(APowerupGiver)) && ti != RUNTIME_CLASS(APowerupGiver)) + { + FString typestr; + APowerupGiver * defaults=(APowerupGiver *)ti->Defaults; + fuglyname v; + + v = defaults->PowerupType; + if (v != NAME_None && v.IsValidName()) + { + typestr.Format ("Power%s", v.GetChars()); + const PClass * powertype=PClass::FindClass(typestr); + if (!powertype) powertype=PClass::FindClass(v.GetChars()); + + if (!powertype) + { + Printf("Unknown powerup type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars()); + errorcount++; + } + else if (!powertype->IsDescendantOf(RUNTIME_CLASS(APowerup))) + { + Printf("Invalid powerup type '%s' in '%s'\n", v.GetChars(), ti->TypeName.GetChars()); + errorcount++; + } + else + { + defaults->PowerupType=powertype; + } + } + else if (v == NAME_None) + { + Printf("No powerup type specified in '%s'\n", ti->TypeName.GetChars()); + errorcount++; + } + } + // the typeinfo properties of weapons have to be fixed here after all actors have been declared if (ti->IsDescendantOf(RUNTIME_CLASS(AWeapon))) { diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 874ed1dda..8c0be8576 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -2136,23 +2136,8 @@ static void PowerupMode (FScanner &sc, APowerupGiver *defaults, Baggage &bag) //========================================================================== static void PowerupType (FScanner &sc, APowerupGiver *defaults, Baggage &bag) { - FString typestr; - sc.MustGetString(); - typestr.Format ("Power%s", sc.String); - const PClass * powertype=PClass::FindClass(typestr); - if (!powertype) - { - sc.ScriptError("Unknown powerup type '%s' in '%s'\n", sc.String, bag.Info->Class->TypeName.GetChars()); - } - else if (!powertype->IsDescendantOf(RUNTIME_CLASS(APowerup))) - { - sc.ScriptError("Invalid powerup type '%s' in '%s'\n", sc.String, bag.Info->Class->TypeName.GetChars()); - } - else - { - defaults->PowerupType=powertype; - } + defaults->PowerupType = fuglyname(sc.String); } //==========================================================================