- re-fix of Gez's MAX_MANA patch

SVN r1633 (trunk)
This commit is contained in:
Christoph Oelckers 2009-06-04 22:05:12 +00:00
parent 5300572b88
commit cc357e5178
3 changed files with 13 additions and 4 deletions

View file

@ -50,6 +50,8 @@
CVAR (Bool, queryiwad, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
CVAR (String, defaultiwad, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
EIWADType gameiwad;
// If autoname is NULL, that's either because that game doesn't allow
// loading of external wads or because it's already caught by the
// general game-specific wads section.
@ -633,6 +635,7 @@ static EIWADType IdentifyVersion (const char *zdoom_wad)
const IWADInfo *D_FindIWAD(const char *basewad)
{
EIWADType iwadType = IdentifyVersion(basewad);
gameiwad = iwadType;
const IWADInfo *iwad_info = &IWADInfos[iwadType];
I_SetIWADInfo(iwad_info);
return iwad_info;

View file

@ -95,12 +95,18 @@ const BYTE *FManaBar::GetPixels ()
void FManaBar::SetVial (FTexture *pic, AActor *actor, const PClass *manaType)
{
int level;
int level, max;
AInventory *ammo;
ammo = actor->FindInventory (manaType);
level = ammo != NULL ? ammo->Amount : 0;
level = MIN (22*level/ammo->MaxAmount, 22);
level = 0; max = 200;
if (ammo != NULL)
{
level = ammo->Amount;
max = ammo->MaxAmount;
if (!max) max = 1;
}
level = MIN (22*level/max, 22);
if (VialPic != pic || VialLevel != level)
{
VialPic = pic;

View file

@ -1581,7 +1581,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, duration, I, Inventory)
}
else
{
I_Error("\"powerup.color\" requires an actor of type \"Powerup\"\n");
I_Error("\"powerup.duration\" requires an actor of type \"Powerup\"\n");
return;
}