mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
A little code cleanup and moved debug reload to shift + alt + r
This commit is contained in:
+3
-6
@@ -3919,7 +3919,7 @@ BOOLEAN AutoReload( SOLDIERTYPE * pSoldier, bool aReloadEvenIfNotEmpty )
|
||||
StatChange(pSoldier, DEXTAMT, 5, FALSE);
|
||||
}
|
||||
|
||||
DirtyMercPanelInterface(pSoldier, DIRTYLEVEL2); // Greysa: what does this do?
|
||||
DirtyMercPanelInterface(pSoldier, DIRTYLEVEL2); // Greysa: what does this even do?
|
||||
PlayJA2Sample(Weapon[Item[pObj->usItem].ubClassIndex].ManualReloadSound, RATE_11025, SoundVolume(HIGHVOLUME, pSoldier->sGridNo), 1, SoundDir(pSoldier->sGridNo));
|
||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s unjammed %s.", pSoldier->GetName(), ItemNames[pObj->usItem]);
|
||||
// merc voice feedback?
|
||||
@@ -3962,25 +3962,22 @@ BOOLEAN AutoReload( SOLDIERTYPE * pSoldier, bool aReloadEvenIfNotEmpty )
|
||||
StatChange(pSoldier, DEXTAMT, 5, FALSE);
|
||||
}
|
||||
|
||||
DirtyMercPanelInterface(pSoldier, DIRTYLEVEL2); // Greysa: what does this do?
|
||||
DirtyMercPanelInterface(pSoldier, DIRTYLEVEL2); // Greysa: what does this do?
|
||||
PlayJA2Sample(Weapon[Item[pObj2->usItem].ubClassIndex].ManualReloadSound, RATE_11025, SoundVolume(HIGHVOLUME, pSoldier->sGridNo), 1, SoundDir(pSoldier->sGridNo));
|
||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[STR_UNJAMMED], pSoldier->GetName(), ItemNames[pObj2->usItem]);
|
||||
// merc voice feedback?
|
||||
return FALSE; //do I need this?
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[STR_FAILED_UNJAM], pSoldier->GetName(), ItemNames[pObj2->usItem]);
|
||||
return FALSE; //do I need this?
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[STR_NO_AP_NO_UNJAM], pSoldier->GetName(), ItemNames[pObj2->usItem]);
|
||||
return FALSE; //do I need this?
|
||||
}
|
||||
}
|
||||
return FALSE; // Greysa: We want to skip reloading if we attempted to unjam, regardless of outcome. Return value doesn't seem to matter as there doesn't seem to be any actual checks on the returned value
|
||||
return FALSE; // Greysa: We want to skip reloading if we attempted to unjam, regardless of outcome. Return value doesn't seem to matter as there doesn't seem to be any actual checks on the returned value. I picked FALSE as actual reload hasn't occurred
|
||||
}
|
||||
|
||||
//<SB> manual recharge
|
||||
|
||||
@@ -4303,24 +4303,21 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
|
||||
// Make auto reload with magazines from sector inventory
|
||||
case 'R':
|
||||
HandleTBReloadAll();
|
||||
|
||||
if (fAlt && gusSelectedSoldier != NOBODY ) // Greysa: Moved here from 'r' to retain all functionality during testing.
|
||||
{
|
||||
if (CHEATER_CHEAT_LEVEL())
|
||||
{
|
||||
ReloadWeapon(gusSelectedSoldier, gusSelectedSoldier->ubAttackingHand);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleTBReloadAll();
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
if( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
// Greysa: Commented out for testing purposes.
|
||||
//if( fAlt ) //reload selected merc's weapon
|
||||
//{
|
||||
// if ( CHEATER_CHEAT_LEVEL( ) )
|
||||
// {
|
||||
// ReloadWeapon( gusSelectedSoldier, gusSelectedSoldier->ubAttackingHand );
|
||||
// }
|
||||
// else
|
||||
// HandleTBReload();
|
||||
//}
|
||||
|
||||
// Remove this once testing and above commenting finished with.
|
||||
if( fAlt )
|
||||
{
|
||||
HandleTBReload();
|
||||
|
||||
Reference in New Issue
Block a user