Fixed: The fix for GCC warnings in PowerupDuration would have caused incorrect error messages in case of incorrect use.

SVN r1158 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-11 23:16:37 +00:00
parent f40d52c22a
commit 9e4b2fb3ec

View file

@ -2232,7 +2232,6 @@ static void PowerupDuration (FScanner &sc, APowerupGiver *defaults, Baggage &bag
{
int *pEffectTics;
sc.MustGetNumber();
if (bag.Info->Class->IsDescendantOf(RUNTIME_CLASS(APowerup)))
{
@ -2247,6 +2246,8 @@ static void PowerupDuration (FScanner &sc, APowerupGiver *defaults, Baggage &bag
sc.ScriptError("\"%s\" requires an actor of type \"Powerup\"\n", sc.String);
return;
}
sc.MustGetNumber();
*pEffectTics = (sc.Number >= 0) ? sc.Number : -sc.Number * TICRATE;
}