- fixed checks in Powerup.Type property to properly deal with the differences between DECORATE and ZScript.

- properly initialize Baggage everywhere it gets used.
- fixed a few items with incorrect Powerup.Type settings that got flagged by the above changes.
This commit is contained in:
Christoph Oelckers 2016-11-07 11:53:49 +01:00
commit 5e8c819a33
7 changed files with 21 additions and 11 deletions

View file

@ -2422,11 +2422,18 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, type, S, PowerupGiver)
// Yuck! What was I thinking when I decided to prepend "Power" to the name?
// Now it's too late to change it...
PClassActor *cls = PClass::FindActor(str);
if (cls == NULL || (!cls->IsDescendantOf(RUNTIME_CLASS(APowerup)) && !bag.fromZScript))
if (cls == nullptr || !cls->IsDescendantOf(RUNTIME_CLASS(APowerup)))
{
FString st;
st.Format("%s%s", strnicmp(str, "power", 5)? "Power" : "", str);
cls = FindClassTentativePowerup(st);
if (bag.fromDecorate)
{
FString st;
st.Format("%s%s", strnicmp(str, "power", 5) ? "Power" : "", str);
cls = FindClassTentativePowerup(st);
}
else
{
I_Error("Unknown powerup type %s", str);
}
}
defaults->PowerupType = cls;