- Fixed: Drawing the amount of an inventory item in the player's inventory did

not work
- Added: PowerupTime to drawnumber and drawbar.  You must specify a
  powerupgiver.  Although drawnumber goes in seconds the powerup has left
  drawbar will use ticks for extra accuracy.
- I have increased cross-port compatibility with Skulltag.  If an unknown
  game mode is provided for sbarinfo's gamemode command it will ignore it and
  continue.


SVN r1015 (trunk)
This commit is contained in:
Christoph Oelckers 2008-06-03 07:21:11 +00:00
commit 165875c7df
5 changed files with 532 additions and 475 deletions

View file

@ -557,10 +557,20 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
sc.ScriptError("Global variable number out of range: %d", sc.Number);
cmd.value = sc.Number;
}
else if(sc.Compare("poweruptime"))
{
cmd.flags |= DRAWNUMBER_POWERUPTIME;
sc.MustGetToken(TK_Identifier);
cmd.setString(sc, sc.String, 0);
const PClass* item = PClass::FindClass(sc.String);
if(item == NULL || !PClass::FindClass("PowerupGiver")->IsAncestorOf(item))
{
sc.ScriptError("'%s' is not a type of PowerupGiver.", sc.String);
}
}
else
{
cmd.flags = DRAWNUMBER_INVENTORY;
sc.MustGetToken(TK_Identifier);
cmd.setString(sc, sc.String, 0);
const PClass* item = PClass::FindClass(sc.String);
if(item == NULL || !PClass::FindClass("Inventory")->IsAncestorOf(item)) //must be a kind of ammo
@ -834,6 +844,17 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
cmd.flags = DRAWNUMBER_ITEMS;
else if(sc.Compare("secrets"))
cmd.flags = DRAWNUMBER_SECRETS;
else if(sc.Compare("poweruptime"))
{
cmd.flags |= DRAWNUMBER_POWERUPTIME;
sc.MustGetToken(TK_Identifier);
cmd.setString(sc, sc.String, 0);
const PClass* item = PClass::FindClass(sc.String);
if(item == NULL || !PClass::FindClass("PowerupGiver")->IsAncestorOf(item))
{
sc.ScriptError("'%s' is not a type of PowerupGiver.", sc.String);
}
}
else
{
cmd.flags = DRAWNUMBER_INVENTORY;
@ -978,8 +999,8 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
cmd.flags |= GAMETYPE_DEATHMATCH;
else if(sc.Compare("teamgame"))
cmd.flags |= GAMETYPE_TEAMGAME;
else
sc.ScriptError("Unknown gamemode: %s", sc.String);
//else I'm removing this error to allow cross port compatiblity. If it doesn't know what a gamemode is lets just ignore it.
// sc.ScriptError("Unknown gamemode: %s", sc.String);
if(sc.CheckToken('{'))
break;
sc.MustGetToken(',');