- moved the 'Finalize' methods back into a single function in the parser code.

It has been like this initially but was changed when ZDoom gained an overly complicated polymorphic class descriptor object that required a lot of support code. All these complications have long been removed but these methods remained. Since they prevent a class from being moved to the script side entirely they had to be removed.

This was the last major blocker to make Weapon a purely scripted class, the only remaining native method is Serialize which is of no concern for the coming work.
This commit is contained in:
Christoph Oelckers 2018-11-25 08:16:18 +01:00
commit 00a48b09e5
12 changed files with 70 additions and 73 deletions

View file

@ -101,45 +101,6 @@ TMap<PClassActor *, int> Weapons_hton;
static int ntoh_cmp(const void *a, const void *b);
//===========================================================================
//
//
//
//===========================================================================
void AWeapon::Finalize(FStateDefinitions &statedef)
{
Super::Finalize(statedef);
FState *ready = FindState(NAME_Ready);
FState *select = FindState(NAME_Select);
FState *deselect = FindState(NAME_Deselect);
FState *fire = FindState(NAME_Fire);
auto TypeName = GetClass()->TypeName;
// Consider any weapon without any valid state abstract and don't output a warning
// This is for creating base classes for weapon groups that only set up some properties.
if (ready || select || deselect || fire)
{
if (!ready)
{
I_Error("Weapon %s doesn't define a ready state.", TypeName.GetChars());
}
if (!select)
{
I_Error("Weapon %s doesn't define a select state.", TypeName.GetChars());
}
if (!deselect)
{
I_Error("Weapon %s doesn't define a deselect state.", TypeName.GetChars());
}
if (!fire)
{
I_Error("Weapon %s doesn't define a fire state.", TypeName.GetChars());
}
}
}
//===========================================================================
//
// AWeapon :: Serialize