Typo in Items.cc[message #260297]
|
Sun, 22 August 2010 19:34
|
|
public1983 |
|
Messages:125
Registered:February 2006 |
|
|
Hi,
I encountered a bug in normal guns mode introduced after Liquorice. The ammo items of mercs with tons-of-guns-weapons are not properly replaced. It seems to be a typo in items.cc marked with a comment below:
static UINT16 FindReplacementMagazine(AmmoKind const calibre, UINT8 const mag_size, UINT8 const ammo_type)
{
UINT16 default_mag = NOTHING;
for (UINT8 i = 0;; i++)
{
MAGTYPE const& mag = Magazine[i];
if (mag.ubCalibre == NOAMMO) break;
if (mag.ubCalibre != calibre) continue;
if (mag.ubMagSize == mag_size) continue; //Typo: must be != so it is == when the item is returned
if (mag.ubAmmoType == ammo_type) return MagazineClassIndexToItemType(i);
if (default_mag == NOTHING)
{ // Store this one to use if all else fails
default_mag = MagazineClassIndexToItemType(i);
}
}
return default_mag;
}
[Updated on: Sun, 22 August 2010 19:35] by Moderator Report message to a moderator
|
Sergeant
|
|
|
|
|