diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index e0be27801a..d6b4b321c9 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -2172,7 +2172,8 @@ static void PowerupColor (FScanner &sc, APowerupGiver *defaults, Baggage &bag) } else { - sc.ScriptError("\"%s\" requires an actor of type \"Powerup\"\n", sc.String); + sc.ScriptError("\"%s\" requires an actor of type \"Powerup\"\n", sc.String); + return; } if (sc.CheckNumber()) @@ -2231,6 +2232,8 @@ static void PowerupDuration (FScanner &sc, APowerupGiver *defaults, Baggage &bag { int *pEffectTics; + sc.MustGetNumber(); + if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(APowerup))) { pEffectTics = &((APowerup*)defaults)->EffectTics; @@ -2241,11 +2244,10 @@ static void PowerupDuration (FScanner &sc, APowerupGiver *defaults, Baggage &bag } else { - sc.ScriptError("\"%s\" requires an actor of type \"Powerup\"\n", sc.String); + sc.ScriptError("\"%s\" requires an actor of type \"Powerup\"\n", sc.String); + return; } - - sc.MustGetNumber(); - *pEffectTics = sc.Number>=0? sc.Number : -sc.Number*TICRATE; + *pEffectTics = (sc.Number >= 0) ? sc.Number : -sc.Number * TICRATE; } //========================================================================== diff --git a/src/thingdef/thingdef_states.cpp b/src/thingdef/thingdef_states.cpp index 43f57a1fa6..28c92172c9 100644 --- a/src/thingdef/thingdef_states.cpp +++ b/src/thingdef/thingdef_states.cpp @@ -492,7 +492,7 @@ int ParseStates(FScanner &sc, FActorInfo * actor, AActor * defaults, Baggage &ba FState * laststate = NULL; intptr_t lastlabel = -1; int minrequiredstate = -1; - int spriteindex; + int spriteindex = 0; char lastsprite[5]=""; sc.MustGetStringName ("{");