Abstract actor classes can be summoned

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.
Post Reply
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Abstract actor classes can be summoned

Post by Player701 »

ZScript allows defining abstract classes, intended to serve as parents for one or more concrete subclasses with shared logic and/or interface. As in many other programming languages, attempting to create an instance of an abstract class will cause an error:

Code: Select all

class TestClass abstract
{
    static TestClass Create()
    {
        return new('TestClass'); // Error: Cannot instantiate abstract class TestClass
    }
}
While there's no doubt that this behavior is certainly intended, there is also an inconsistency: abstract classes can still be instantiated with the "summon" console command, provided that they inherit from Actor. This should probably not be allowed.

(As a side note, I wish there were real abstract methods in ZScript...)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Abstract actor classes can be summoned

Post by Graf Zahl »

fixed
Post Reply

Return to “Closed Bugs [GZDoom]”