mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-03-09 10:11:04 +00:00
- removed the dynamic weapon map indirection.
This commit is contained in:
parent
cb54a03d60
commit
7493956613
7 changed files with 6 additions and 9 deletions
|
@ -107,7 +107,7 @@ void addammo(short weapon, struct player_struct* p, short amount)
|
||||||
|
|
||||||
void addweapon(struct player_struct* p, short weapon)
|
void addweapon(struct player_struct* p, short weapon)
|
||||||
{
|
{
|
||||||
if (p->gotweapon[weapon] == 0)
|
if (!p->gotweapon[weapon])
|
||||||
{
|
{
|
||||||
p->gotweapon.Set(weapon);
|
p->gotweapon.Set(weapon);
|
||||||
if (weapon == SHRINKER_WEAPON)
|
if (weapon == SHRINKER_WEAPON)
|
||||||
|
|
|
@ -5882,7 +5882,7 @@ DETONATEB:
|
||||||
P_AddAmmo(pPlayer, RPG_WEAPON, 1);
|
P_AddAmmo(pPlayer, RPG_WEAPON, 1);
|
||||||
A_PlaySound(DUKE_GET, pPlayer->i);
|
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);
|
P_AddWeapon(pPlayer, HANDBOMB_WEAPON);
|
||||||
|
|
||||||
if (sprite[pSprite->owner].picnum != TILE_APLAYER)
|
if (sprite[pSprite->owner].picnum != TILE_APLAYER)
|
||||||
|
|
|
@ -879,7 +879,7 @@ static void VM_AddWeapon(DukePlayer_t * const pPlayer, int const weaponNum, int
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pPlayer->gotweapon[weaponNum]) == 0)
|
if (!pPlayer->gotweapon[weaponNum])
|
||||||
{
|
{
|
||||||
P_AddWeapon(pPlayer, weaponNum);
|
P_AddWeapon(pPlayer, weaponNum);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,6 @@ BEGIN_DUKE_NS
|
||||||
#define DVPTR(x) &x
|
#define DVPTR(x) &x
|
||||||
|
|
||||||
int16_t DynamicTileMap[MAXTILES];
|
int16_t DynamicTileMap[MAXTILES];
|
||||||
int16_t DynamicWeaponMap[MAX_WEAPONS];
|
|
||||||
|
|
||||||
struct dynitem
|
struct dynitem
|
||||||
{
|
{
|
||||||
|
|
|
@ -3592,9 +3592,7 @@ enum dukeweapon_t_alt
|
||||||
CHICKEN_WEAPON,
|
CHICKEN_WEAPON,
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int16_t DynamicWeaponMap[MAX_WEAPONS];
|
#define DYNAMICWEAPONMAP(Weaponnum) Weaponnum
|
||||||
|
|
||||||
#define DYNAMICWEAPONMAP(Weaponnum) (DynamicWeaponMap[Weaponnum])
|
|
||||||
|
|
||||||
END_DUKE_NS
|
END_DUKE_NS
|
||||||
|
|
||||||
|
|
|
@ -4703,7 +4703,7 @@ void P_AddWeapon(DukePlayer_t *pPlayer, int weaponNum)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pPlayer->gotweapon[weaponNum]) == 0)
|
if (!pPlayer->gotweapon[weaponNum])
|
||||||
{
|
{
|
||||||
pPlayer->gotweapon.Set(weaponNum);
|
pPlayer->gotweapon.Set(weaponNum);
|
||||||
|
|
||||||
|
|
|
@ -690,7 +690,7 @@ public:
|
||||||
auto ShadeForWeapon = [=](int weapon, int optweapon = -1)
|
auto ShadeForWeapon = [=](int weapon, int optweapon = -1)
|
||||||
{
|
{
|
||||||
// Headache-inducing math at play here.
|
// 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);
|
DrawWeaponNum(2, x, y, p->ammo_amount[PISTOL_WEAPON], p->max_ammo_amount[PISTOL_WEAPON], 12 - 20 * (cw == PISTOL_WEAPON), 3);
|
||||||
|
|
Loading…
Reference in a new issue