[Duplicate] Cheating will give abstract classes

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Cheating will give abstract classes

Postby SanyaWaffles » Mon Mar 14, 2022 6:32 pm

So if you have a weapon or key that is abstract for whatever reason defined, give all will spit out an error message.

it seems, at least for weapons, the fix is simple - add a isAbstract() check like so:

Code: Select allExpand view
      if (giveall || name ~== "weapons")
      {
         let savedpending = player.PendingWeapon;
         for (i = 0; i < AllActorClasses.Size(); ++i)
         {
            let type = (class<Weapon>)(AllActorClasses[i]);
            if (type != null && type != "Weapon" && !type.isAbstract())
            {
               // Don't give replaced weapons unless the replacement was done by Dehacked.
               let rep = GetReplacement(type);
               if (rep == type || rep is "DehackedPickup")
               {
                  // Give the weapon only if it is set in a weapon slot.
                  if (player.weapons.LocateWeapon(type))
                  {
                     readonly<Weapon> def = GetDefaultByType (type);
                     if (giveall == ALL_YESYES || !def.bCheatNotWeapon)
                     {
                        GiveInventory(type, 1, true);
                     }
                  }
               }
            }
         }
         player.PendingWeapon = savedpending;

         if (!giveall)
            return;
      }
User avatar
SanyaWaffles
Certified Heretic and Grill Champion
 
Joined: 25 Apr 2013
Location: Disappointment Island
Discord: SanyaWaffles#0950
Twitch ID: sanyawaffles
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Cheating will give abstract classes

Postby phantombeta » Mon Mar 14, 2022 7:14 pm

Essentially a duplicate of this bug report, as far as I know.
User avatar
phantombeta
Tired of being treated like trash by control freaks
 
Joined: 02 May 2013

Re: Cheating will give abstract classes

Postby SanyaWaffles » Mon Mar 14, 2022 7:19 pm

oh, didn't know it was reported all ready. My mistake.
User avatar
SanyaWaffles
Certified Heretic and Grill Champion
 
Joined: 25 Apr 2013
Location: Disappointment Island
Discord: SanyaWaffles#0950
Twitch ID: sanyawaffles
Operating System: Windows 11
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests