[Fixed] TAG 667 not activated thru MAPINFO with same replacements

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

TAG 667 not activated thru MAPINFO with same replacements

Postby drfrag » Thu Jul 09, 2020 5:13 am

There's a problem in MAP07 when you replace both monster types with barons, then only tag 666 is activated. It happens with MAPINFO and a custom skill but not with DECORATE.
Code: Select allExpand view
skill doggie
{

   ReplaceActor = "Arachnotron", "BaronOfHell"
   ReplaceActor = "Fatso", "BaronOfHell"
   SpawnFilter = Hard
   Name = "Doggie"
}

SetReplacement is called from ParseActorHeader and ZCCDoomCompiler::InitDefaults when substitutions are performed via DECORATE or ZScript i believe.
Proposed fix:
Code: Select allExpand view
diff --git a/src/playsim/p_enemy.cpp b/src/playsim/p_enemy.cpp
index cc54174d1..fd71e8321 100644
--- a/src/playsim/p_enemy.cpp
+++ b/src/playsim/p_enemy.cpp
@@ -3153,13 +3153,17 @@ void A_BossDeath(AActor *self)
    }
    if (Level->flags & LEVEL_MAP07SPECIAL)
    {
+      PClassActor *fatso = PClass::FindActor(NAME_Fatso);
+      PClassActor *arachnotron = PClass::FindActor(NAME_Arachnotron);
+      bool samereplacement = fatso->GetReplacement(Level) == arachnotron->GetReplacement(Level);
       if (type == NAME_Fatso)
       {
          Level->EV_DoFloor (DFloor::floorLowerToLowest, NULL, 666, 1., 0, -1, 0, false);
-         return;
+         if (!samereplacement)
+            return;
       }
-     
-      if (type == NAME_Arachnotron)
+
+      if (type == NAME_Arachnotron || samereplacement)
       {
          Level->EV_DoFloor (DFloor::floorRaiseByTexture, NULL, 667, 1., 0, -1, 0, false);
          return;
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: TAG 667 not activated thru MAPINFO with same replacement

Postby Graf Zahl » Sat Oct 17, 2020 7:02 am

Proposed fix is not in a usable format.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: TAG 667 not activated thru MAPINFO with same replacement

Postby Graf Zahl » Sat Oct 24, 2020 4:58 am

I had to fix the fix anyway because it did not cover all cases of this, so now it's fixed.
Next time please do a PR instead of a diff.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: TAG 667 not activated thru MAPINFO with same replacement

Postby drfrag » Sat Oct 24, 2020 1:07 pm

I didn't made a PR becouse i don't know how to fix it. When i tested it again actually killing the monsters manually it didn't work, it's tricky.
May be that code snippet didn't even make much sense after all and this should be fixed somewhere else.
Now i've merged your version and it doesn't work even with kill monsters. The workaround is to use auxiliary actors.
Edit: there are alive bosses outside so the specials won't be triggered anyway.
Last edited by drfrag on Sat Oct 24, 2020 1:23 pm, edited 1 time in total.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666

Re: TAG 667 not activated thru MAPINFO with same replacement

Postby Graf Zahl » Sat Oct 24, 2020 1:18 pm

Yeah, there was still a little problem with the returns.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: TAG 667 not activated thru MAPINFO with same replacement

Postby drfrag » Sat Oct 24, 2020 1:23 pm

I've edited my previous post, it can't be fixed there.
User avatar
drfrag
Os voy a romper a pedazos!
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain
Discord: drfrag#3555
Github ID: drfrag666


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest