mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
fix for issue #580
This commit is contained in:
@@ -6076,7 +6076,8 @@ void ItemDescAmmoCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
gfItemAmmoDown = FALSE;
|
gfItemAmmoDown = FALSE;
|
||||||
|
|
||||||
//CHRISL: We dont' want to be able to reload guns using the ammo crate from this function
|
//CHRISL: We dont' want to be able to reload guns using the ammo crate from this function
|
||||||
if((gpItemPointer != NULL && Magazine[Item[gpItemPointer->usItem].ubClassIndex].ubMagType >= AMMO_BOX) || !EnoughPoints(gpItemDescSoldier, APBPConstants[AP_RELOAD_GUN], 0, TRUE))//dnl ch65 040913
|
//Greysa: add check for ammo item
|
||||||
|
if( gpItemPointer != NULL && ( (Item[gpItemPointer->usItem].usItemClass != IC_AMMO || Magazine[Item[gpItemPointer->usItem].ubClassIndex].ubMagType >= AMMO_BOX) ) || !EnoughPoints(gpItemDescSoldier, APBPConstants[AP_RELOAD_GUN], 0, TRUE) )//dnl ch65 040913
|
||||||
{
|
{
|
||||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||||
@@ -6099,7 +6100,8 @@ void ItemDescAmmoCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//holding an item
|
//holding an item
|
||||||
if(Magazine[Item[gpItemPointer->usItem].ubClassIndex].ubCalibre == Weapon[Item[gpItemDescObject->usItem].ubClassIndex].ubCalibre)
|
//Greysa: add check for ammo item
|
||||||
|
if( Item[gpItemPointer->usItem].usItemClass == IC_AMMO && Magazine[Item[gpItemPointer->usItem].ubClassIndex].ubCalibre == Weapon[Item[gpItemDescObject->usItem].ubClassIndex].ubCalibre )
|
||||||
{
|
{
|
||||||
ReloadGun(gpItemDescSoldier, gpItemDescObject, gpItemPointer, ubStatusIndex);
|
ReloadGun(gpItemDescSoldier, gpItemDescObject, gpItemPointer, ubStatusIndex);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -3919,7 +3919,7 @@ BOOLEAN AutoReload( SOLDIERTYPE * pSoldier, bool aReloadEvenIfNotEmpty )
|
|||||||
StatChange(pSoldier, DEXTAMT, 5, FALSE);
|
StatChange(pSoldier, DEXTAMT, 5, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DirtyMercPanelInterface(pSoldier, DIRTYLEVEL2); // Greysa: what does this even do?
|
DirtyMercPanelInterface(pSoldier, DIRTYLEVEL2);
|
||||||
PlayJA2Sample(Weapon[Item[pObj->usItem].ubClassIndex].ManualReloadSound, RATE_11025, SoundVolume(HIGHVOLUME, pSoldier->sGridNo), 1, SoundDir(pSoldier->sGridNo));
|
PlayJA2Sample(Weapon[Item[pObj->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[pObj->usItem]);
|
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[STR_UNJAMMED], pSoldier->GetName(), ItemNames[pObj->usItem]);
|
||||||
// merc voice feedback?
|
// merc voice feedback?
|
||||||
@@ -3962,7 +3962,7 @@ BOOLEAN AutoReload( SOLDIERTYPE * pSoldier, bool aReloadEvenIfNotEmpty )
|
|||||||
StatChange(pSoldier, DEXTAMT, 5, FALSE);
|
StatChange(pSoldier, DEXTAMT, 5, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DirtyMercPanelInterface(pSoldier, DIRTYLEVEL2); // Greysa: what does this do?
|
DirtyMercPanelInterface(pSoldier, DIRTYLEVEL2);
|
||||||
PlayJA2Sample(Weapon[Item[pObj2->usItem].ubClassIndex].ManualReloadSound, RATE_11025, SoundVolume(HIGHVOLUME, pSoldier->sGridNo), 1, SoundDir(pSoldier->sGridNo));
|
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]);
|
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[STR_UNJAMMED], pSoldier->GetName(), ItemNames[pObj2->usItem]);
|
||||||
// merc voice feedback?
|
// merc voice feedback?
|
||||||
|
|||||||
Reference in New Issue
Block a user