- resorted some of thingdef.cpp's contents into more appropriate files.
- split FinishActor into several functions. While DECORATE can, ZSCRIPT cannot do all this in one go. - split the state finalization into several class-specific virtual functions.
This commit is contained in:
parent
b1a83bfd26
commit
59ed26c0b6
10 changed files with 286 additions and 220 deletions
|
|
@ -67,6 +67,38 @@ void PClassWeapon::ReplaceClassRef(PClass *oldclass, PClass *newclass)
|
|||
}
|
||||
}
|
||||
|
||||
void PClassWeapon::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);
|
||||
|
||||
// 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue