mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-07 08:21:04 +00:00
- Fixed: SBARINFO used GetSpecies instead of GetClass to check weapon types.
- Added a few missing NULL pointer checks to SBARINFO code. SVN r1344 (trunk)
This commit is contained in:
parent
6a321fd8f5
commit
7fde758e26
2 changed files with 9 additions and 7 deletions
|
@ -1,4 +1,6 @@
|
||||||
January 1, 2009 (Changes by Graf Zahl)
|
January 1, 2009 (Changes by Graf Zahl)
|
||||||
|
- Fixed: SBARINFO used GetSpecies instead of GetClass to check weapon types.
|
||||||
|
- Added a few missing NULL pointer checks to SBARINFO code.
|
||||||
- Changed pickup sounds of local player to unpaused to resolve problems with
|
- Changed pickup sounds of local player to unpaused to resolve problems with
|
||||||
the time freezer and make them behave better.
|
the time freezer and make them behave better.
|
||||||
- Fixed: When sounds are paused not all newly started sounds should actually
|
- Fixed: When sounds are paused not all newly started sounds should actually
|
||||||
|
|
|
@ -1256,30 +1256,30 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
const PClass *weapon2 = PClass::FindClass(cmd.string[1]);
|
const PClass *weapon2 = PClass::FindClass(cmd.string[1]);
|
||||||
if(weapon2 != NULL)
|
if(weapon2 != NULL)
|
||||||
{
|
{
|
||||||
if((cmd.flags & SBARINFOEVENT_NOT) && (weapon1 != CPlayer->ReadyWeapon->GetSpecies() && weapon2 != CPlayer->ReadyWeapon->GetSpecies()))
|
if((cmd.flags & SBARINFOEVENT_NOT) && (weapon1 != CPlayer->ReadyWeapon->GetClass() && weapon2 != CPlayer->ReadyWeapon->GetClass()))
|
||||||
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
||||||
else if(!(cmd.flags & SBARINFOEVENT_NOT) && (weapon1 == CPlayer->ReadyWeapon->GetSpecies() || weapon2 == CPlayer->ReadyWeapon->GetSpecies()))
|
else if(!(cmd.flags & SBARINFOEVENT_NOT) && (weapon1 == CPlayer->ReadyWeapon->GetClass() || weapon2 == CPlayer->ReadyWeapon->GetClass()))
|
||||||
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!(cmd.flags & SBARINFOEVENT_NOT) && weapon1 == CPlayer->ReadyWeapon->GetSpecies())
|
if(!(cmd.flags & SBARINFOEVENT_NOT) && weapon1 == CPlayer->ReadyWeapon->GetClass())
|
||||||
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
||||||
else if((cmd.flags & SBARINFOEVENT_NOT) && weapon1 != CPlayer->ReadyWeapon->GetSpecies())
|
else if((cmd.flags & SBARINFOEVENT_NOT) && weapon1 != CPlayer->ReadyWeapon->GetClass())
|
||||||
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SBARINFO_USESAMMO:
|
case SBARINFO_USESAMMO:
|
||||||
if ((CPlayer->ReadyWeapon->AmmoType1 != NULL || CPlayer->ReadyWeapon->AmmoType2 != NULL) ^
|
if ((CPlayer->ReadyWeapon != NULL && (CPlayer->ReadyWeapon->AmmoType1 != NULL || CPlayer->ReadyWeapon->AmmoType2 != NULL)) ^
|
||||||
!!(cmd.flags & SBARINFOEVENT_NOT))
|
!!(cmd.flags & SBARINFOEVENT_NOT))
|
||||||
{
|
{
|
||||||
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SBARINFO_USESSECONDARYAMMO:
|
case SBARINFO_USESSECONDARYAMMO:
|
||||||
if((CPlayer->ReadyWeapon->AmmoType2 != NULL && CPlayer->ReadyWeapon->AmmoType2 != CPlayer->ReadyWeapon->AmmoType1 && !(cmd.flags & SBARINFOEVENT_NOT)) ||
|
if((CPlayer->ReadyWeapon != NULL && CPlayer->ReadyWeapon->AmmoType2 != NULL && CPlayer->ReadyWeapon->AmmoType2 != CPlayer->ReadyWeapon->AmmoType1 && !(cmd.flags & SBARINFOEVENT_NOT)) ||
|
||||||
(CPlayer->ReadyWeapon->AmmoType2 == NULL && cmd.flags & SBARINFOEVENT_NOT))
|
((CPlayer->ReadyWeapon == NULL || CPlayer->ReadyWeapon->AmmoType2 == NULL) && cmd.flags & SBARINFOEVENT_NOT))
|
||||||
{
|
{
|
||||||
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue