- Fixed: The global WeaponSection string was never freed. It has been replaced
with an FString now. - Fixed: The music strings in the default level info were never freed and caused memory leaks when used repeatedly. - Fixed: The intermusic string in the level info was never freed. - Fixed: The default fire obituary should only be printed if the damage came from the environment. If it comes from a monster the monster specific obituary should be used instead. - Added custom damage types from the floating point test release. - Changed Pain Elemental's massacre check. Now A_PainDie checks for the damage type and doesn't spawn anything if it is NAME_Massacre. A_PainDie can also be used by other actors so a more generalized approach is needed than hard coding it into the Pain Elemental. - Converted a few of Doom's monsters to DECORATE because I couldn't test the first version of the custom state code with the corpses inheriting from them. - Added custom states from last year's floating point test release and fixed some bugs I found in that code. Unfortunately it wasn't all salvageable and it was easier to recreate some parts from scratch. SVN r368 (trunk)
This commit is contained in:
parent
3b2c2efcb1
commit
063c85b157
118 changed files with 2103 additions and 1818 deletions
|
|
@ -52,10 +52,6 @@ void AWeapon::Serialize (FArchive &arc)
|
|||
<< ProjectileType << AltProjectileType
|
||||
<< SelectionOrder
|
||||
<< MoveCombatDist
|
||||
<< UpState << DownState << ReadyState
|
||||
<< AtkState << HoldAtkState
|
||||
<< AltAtkState << AltHoldAtkState
|
||||
<< FlashState << AltFlashState
|
||||
<< Ammo1 << Ammo2 << SisterWeapon
|
||||
<< bAltFire;
|
||||
}
|
||||
|
|
@ -70,6 +66,7 @@ void AWeapon::Serialize (FArchive &arc)
|
|||
|
||||
bool AWeapon::TryPickup (AActor *toucher)
|
||||
{
|
||||
FState * ReadyState = FindState(NAME_Ready);
|
||||
if (ReadyState != NULL &&
|
||||
ReadyState->GetFrame() < sprites[ReadyState->sprite.index].numframes)
|
||||
{
|
||||
|
|
@ -394,7 +391,7 @@ bool AWeapon::CheckAmmo (int fireMode, bool autoSwitch, bool requireAmmo)
|
|||
{
|
||||
enoughmask = 1 << altFire;
|
||||
}
|
||||
if (altFire && AltAtkState == NULL)
|
||||
if (altFire && FindState(NAME_AltFire) == NULL)
|
||||
{ // If this weapon has no alternate fire, then there is never enough ammo for it
|
||||
enough &= 1;
|
||||
}
|
||||
|
|
@ -472,7 +469,7 @@ void AWeapon::PostMorphWeapon ()
|
|||
Owner->player->PendingWeapon = WP_NOCHANGE;
|
||||
Owner->player->ReadyWeapon = this;
|
||||
Owner->player->psprites[ps_weapon].sy = WEAPONBOTTOM;
|
||||
P_SetPsprite (Owner->player, ps_weapon, UpState);
|
||||
P_SetPsprite (Owner->player, ps_weapon, GetUpState());
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
@ -487,7 +484,7 @@ void AWeapon::EndPowerup ()
|
|||
{
|
||||
if (SisterWeapon != NULL && WeaponFlags&WIF_POWERED_UP)
|
||||
{
|
||||
if (ReadyState != SisterWeapon->ReadyState)
|
||||
if (GetReadyState() != SisterWeapon->GetReadyState())
|
||||
{
|
||||
Owner->player->PendingWeapon = SisterWeapon;
|
||||
}
|
||||
|
|
@ -506,7 +503,7 @@ void AWeapon::EndPowerup ()
|
|||
|
||||
FState *AWeapon::GetUpState ()
|
||||
{
|
||||
return UpState;
|
||||
return FindState(NAME_Select);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
@ -517,7 +514,7 @@ FState *AWeapon::GetUpState ()
|
|||
|
||||
FState *AWeapon::GetDownState ()
|
||||
{
|
||||
return DownState;
|
||||
return FindState(NAME_Deselect);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
@ -528,7 +525,7 @@ FState *AWeapon::GetDownState ()
|
|||
|
||||
FState *AWeapon::GetReadyState ()
|
||||
{
|
||||
return ReadyState;
|
||||
return FindState(NAME_Ready);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
@ -537,20 +534,28 @@ FState *AWeapon::GetReadyState ()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
FState *AWeapon::GetAtkState ()
|
||||
FState *AWeapon::GetAtkState (bool hold)
|
||||
{
|
||||
return AtkState;
|
||||
FState * state=NULL;
|
||||
|
||||
if (hold) state = FindState(NAME_Hold);
|
||||
if (state == NULL) state = FindState(NAME_Fire);
|
||||
return state;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AWeapon :: GetHoldAtkState
|
||||
// AWeapon :: GetAtkState
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
FState *AWeapon::GetHoldAtkState ()
|
||||
FState *AWeapon::GetAltAtkState (bool hold)
|
||||
{
|
||||
return HoldAtkState;
|
||||
FState * state=NULL;
|
||||
|
||||
if (hold) state = FindState(NAME_AltHold);
|
||||
if (state == NULL) state = FindState(NAME_AltFire);
|
||||
return state;
|
||||
}
|
||||
|
||||
/* Weapon slots ***********************************************************/
|
||||
|
|
@ -792,7 +797,7 @@ CCMD (setslot)
|
|||
{
|
||||
int slot, i;
|
||||
|
||||
if (ParsingKeyConf && !WeaponSection)
|
||||
if (ParsingKeyConf && WeaponSection.IsEmpty())
|
||||
{
|
||||
Printf ("You need to use weaponsection before using setslot\n");
|
||||
return;
|
||||
|
|
@ -861,7 +866,7 @@ CCMD (weaponsection)
|
|||
{
|
||||
argv[1][32] = 0;
|
||||
}
|
||||
ReplaceString (&WeaponSection, argv[1]);
|
||||
WeaponSection = argv[1];
|
||||
|
||||
// If the ini already has definitions for this section, load them
|
||||
char fullSection[32*3];
|
||||
|
|
@ -888,7 +893,7 @@ CCMD (weaponsection)
|
|||
tackOn = fullSection + 4;
|
||||
}
|
||||
|
||||
sprintf (tackOn, ".%s.WeaponSlots", WeaponSection);
|
||||
sprintf (tackOn, ".%s.WeaponSlots", WeaponSection.GetChars());
|
||||
if (GameConfig->SetSection (fullSection))
|
||||
{
|
||||
LocalWeapons.RestoreSlots (*GameConfig);
|
||||
|
|
@ -907,7 +912,7 @@ CCMD (addslotdefault)
|
|||
return;
|
||||
}
|
||||
|
||||
if (ParsingKeyConf && !WeaponSection)
|
||||
if (ParsingKeyConf && WeaponSection.IsEmpty())
|
||||
{
|
||||
Printf ("You need to use weaponsection before using addslotdefault\n");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue