- removed the dynamic weapon map indirection.

This commit is contained in:
Christoph Oelckers 2020-05-05 18:38:40 +02:00
parent cb54a03d60
commit 7493956613
7 changed files with 6 additions and 9 deletions

View file

@ -107,7 +107,7 @@ void addammo(short weapon, struct player_struct* p, short amount)
void addweapon(struct player_struct* p, short weapon)
{
if (p->gotweapon[weapon] == 0)
if (!p->gotweapon[weapon])
{
p->gotweapon.Set(weapon);
if (weapon == SHRINKER_WEAPON)

View file

@ -5882,7 +5882,7 @@ DETONATEB:
P_AddAmmo(pPlayer, RPG_WEAPON, 1);
A_PlaySound(DUKE_GET, pPlayer->i);
if ((pPlayer->gotweapon[HANDBOMB_WEAPON]) == 0 || pSprite->owner == pPlayer->i)
if (!pPlayer->gotweapon[HANDBOMB_WEAPON] || pSprite->owner == pPlayer->i)
P_AddWeapon(pPlayer, HANDBOMB_WEAPON);
if (sprite[pSprite->owner].picnum != TILE_APLAYER)

View file

@ -879,7 +879,7 @@ static void VM_AddWeapon(DukePlayer_t * const pPlayer, int const weaponNum, int
return;
}
if ((pPlayer->gotweapon[weaponNum]) == 0)
if (!pPlayer->gotweapon[weaponNum])
{
P_AddWeapon(pPlayer, weaponNum);
}

View file

@ -33,7 +33,6 @@ BEGIN_DUKE_NS
#define DVPTR(x) &x
int16_t DynamicTileMap[MAXTILES];
int16_t DynamicWeaponMap[MAX_WEAPONS];
struct dynitem
{

View file

@ -3592,9 +3592,7 @@ enum dukeweapon_t_alt
CHICKEN_WEAPON,
};
extern int16_t DynamicWeaponMap[MAX_WEAPONS];
#define DYNAMICWEAPONMAP(Weaponnum) (DynamicWeaponMap[Weaponnum])
#define DYNAMICWEAPONMAP(Weaponnum) Weaponnum
END_DUKE_NS

View file

@ -4703,7 +4703,7 @@ void P_AddWeapon(DukePlayer_t *pPlayer, int weaponNum)
return;
}
if ((pPlayer->gotweapon[weaponNum]) == 0)
if (!pPlayer->gotweapon[weaponNum])
{
pPlayer->gotweapon.Set(weaponNum);

View file

@ -690,7 +690,7 @@ public:
auto ShadeForWeapon = [=](int weapon, int optweapon = -1)
{
// Headache-inducing math at play here.
return (((!p->ammo_amount[weapon]) | ((p->gotweapon[weapon]) == 0)) * 9) + 12 - 18 * ((cw == weapon) || (optweapon != -1 && cw == optweapon));
return (((!p->ammo_amount[weapon]) | (!p->gotweapon[weapon])) * 9) + 12 - 18 * ((cw == weapon) || (optweapon != -1 && cw == optweapon));
};
DrawWeaponNum(2, x, y, p->ammo_amount[PISTOL_WEAPON], p->max_ammo_amount[PISTOL_WEAPON], 12 - 20 * (cw == PISTOL_WEAPON), 3);