Skip to content

Commit

Permalink
Fixed jDoom: "Using diffrent weapon ammo bug" (see here http://source…
Browse files Browse the repository at this point in the history
  • Loading branch information
danij committed May 5, 2009
1 parent 2431524 commit d513bc6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
19 changes: 8 additions & 11 deletions doomsday/plugins/jdoom/src/d_items.c
Expand Up @@ -189,7 +189,6 @@ void P_InitWeaponInfo(void)

int i;
int pclass = PCLASS_PLAYER;
ammotype_t k;
char buf[80];
char* data;

Expand All @@ -199,17 +198,15 @@ void P_InitWeaponInfo(void)
sprintf(buf, WPINF "%i|Type", i);
if(Def_Get(DD_DEF_VALUE, buf, &data))
{
// Set the right types of ammo.
if(!stricmp(data, "noammo"))
{
for(k = 0; k < NUM_AMMO_TYPES; ++k)
{
weaponInfo[i][pclass].mode[0].ammoType[k] = false;
weaponInfo[i][pclass].mode[0].perShot[k] = 0;
}
}
else
memset(weaponInfo[i][pclass].mode[0].ammoType, 0,
sizeof(int) * NUM_AMMO_TYPES);
memset(weaponInfo[i][pclass].mode[0].perShot, 0,
sizeof(int) * NUM_AMMO_TYPES);

if(stricmp(data, "noammo"))
{
ammotype_t k;

for(k = 0; k < NUM_AMMO_TYPES; ++k)
{
if(!stricmp(data, ammoTypeNames[k]))
Expand Down
18 changes: 8 additions & 10 deletions doomsday/plugins/jdoom64/src/d_items.c
Expand Up @@ -213,17 +213,15 @@ void P_InitWeaponInfo(void)
sprintf(buf, WPINF "%i|Type", i);
if(Def_Get(DD_DEF_VALUE, buf, &data))
{
// Set the right types of ammo.
if(!stricmp(data, "noammo"))
{
for(k = 0; k < NUM_AMMO_TYPES; ++k)
{
weaponInfo[i][pclass].mode[0].ammoType[k] = false;
weaponInfo[i][pclass].mode[0].perShot[k] = 0;
}
}
else
memset(weaponInfo[i][pclass].mode[0].ammoType, 0,
sizeof(int) * NUM_AMMO_TYPES);
memset(weaponInfo[i][pclass].mode[0].perShot, 0,
sizeof(int) * NUM_AMMO_TYPES);

if(stricmp(data, "noammo"))
{
ammotype_t k;

for(k = 0; k < NUM_AMMO_TYPES; ++k)
{
if(!stricmp(data, ammoTypeNames[k]))
Expand Down

0 comments on commit d513bc6

Please sign in to comment.