mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
- allow optional decal generator definitions.
This commit is contained in:
parent
5515cb02a6
commit
1a0faf4761
1 changed files with 11 additions and 7 deletions
|
@ -603,16 +603,17 @@ void FDecalLib::ParseGenerator (FScanner &sc)
|
||||||
{
|
{
|
||||||
const PClass *type;
|
const PClass *type;
|
||||||
FDecalBase *decal;
|
FDecalBase *decal;
|
||||||
AActor *actor;
|
bool optional = false;
|
||||||
|
|
||||||
// Get name of generator (actor)
|
// Get name of generator (actor)
|
||||||
sc.MustGetString ();
|
sc.MustGetString ();
|
||||||
|
optional = sc.Compare("optional");
|
||||||
|
|
||||||
type = PClass::FindClass (sc.String);
|
type = PClass::FindClass (sc.String);
|
||||||
if (type == NULL || type->ActorInfo == NULL)
|
if (type == NULL || type->ActorInfo == NULL)
|
||||||
{
|
{
|
||||||
sc.ScriptError ("%s is not an actor.", sc.String);
|
if (!optional) sc.ScriptError ("%s is not an actor.", sc.String);
|
||||||
}
|
}
|
||||||
actor = (AActor *)type->Defaults;
|
|
||||||
|
|
||||||
// Get name of generated decal
|
// Get name of generated decal
|
||||||
sc.MustGetString ();
|
sc.MustGetString ();
|
||||||
|
@ -628,11 +629,14 @@ void FDecalLib::ParseGenerator (FScanner &sc)
|
||||||
sc.ScriptError ("%s has not been defined.", sc.String);
|
sc.ScriptError ("%s has not been defined.", sc.String);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (type != NULL)
|
||||||
actor->DecalGenerator = decal;
|
|
||||||
if (decal != NULL)
|
|
||||||
{
|
{
|
||||||
decal->Users.Push (type);
|
AActor *actor = (AActor *)type->Defaults;
|
||||||
|
actor->DecalGenerator = decal;
|
||||||
|
if (decal != NULL)
|
||||||
|
{
|
||||||
|
decal->Users.Push(type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue