mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-01 01:08:01 +03:00
Ammo struct to better represent Ammo
This commit is contained in:
parent
2a2c52674f
commit
d45db30cd9
6 changed files with 105 additions and 50 deletions
|
@ -126,7 +126,7 @@ void LaraCheatGetStuff() // (F) (D)
|
||||||
Lara.Weapons[WEAPON_REVOLVER].SelectedAmmo = WEAPON_AMMO1;
|
Lara.Weapons[WEAPON_REVOLVER].SelectedAmmo = WEAPON_AMMO1;
|
||||||
Lara.Weapons[WEAPON_REVOLVER].HasLasersight = false;
|
Lara.Weapons[WEAPON_REVOLVER].HasLasersight = false;
|
||||||
Lara.Weapons[WEAPON_REVOLVER].HasSilencer = false;
|
Lara.Weapons[WEAPON_REVOLVER].HasSilencer = false;
|
||||||
Lara.Weapons[WEAPON_REVOLVER].Ammo[WEAPON_AMMO1] = -1;
|
Lara.Weapons[WEAPON_REVOLVER].Ammo[WEAPON_AMMO1].isInfinite = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects[ID_UZI_ITEM].loaded)
|
if (Objects[ID_UZI_ITEM].loaded)
|
||||||
|
@ -135,7 +135,7 @@ void LaraCheatGetStuff() // (F) (D)
|
||||||
Lara.Weapons[WEAPON_UZI].SelectedAmmo = WEAPON_AMMO1;
|
Lara.Weapons[WEAPON_UZI].SelectedAmmo = WEAPON_AMMO1;
|
||||||
Lara.Weapons[WEAPON_UZI].HasLasersight = false;
|
Lara.Weapons[WEAPON_UZI].HasLasersight = false;
|
||||||
Lara.Weapons[WEAPON_UZI].HasSilencer = false;
|
Lara.Weapons[WEAPON_UZI].HasSilencer = false;
|
||||||
Lara.Weapons[WEAPON_UZI].Ammo[WEAPON_AMMO1] = -1;
|
Lara.Weapons[WEAPON_UZI].Ammo[WEAPON_AMMO1].isInfinite = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects[ID_SHOTGUN_ITEM].loaded)
|
if (Objects[ID_SHOTGUN_ITEM].loaded)
|
||||||
|
@ -144,7 +144,7 @@ void LaraCheatGetStuff() // (F) (D)
|
||||||
Lara.Weapons[WEAPON_SHOTGUN].SelectedAmmo = WEAPON_AMMO1;
|
Lara.Weapons[WEAPON_SHOTGUN].SelectedAmmo = WEAPON_AMMO1;
|
||||||
Lara.Weapons[WEAPON_SHOTGUN].HasLasersight = false;
|
Lara.Weapons[WEAPON_SHOTGUN].HasLasersight = false;
|
||||||
Lara.Weapons[WEAPON_SHOTGUN].HasSilencer = false;
|
Lara.Weapons[WEAPON_SHOTGUN].HasSilencer = false;
|
||||||
Lara.Weapons[WEAPON_SHOTGUN].Ammo[WEAPON_AMMO1] = -1;
|
Lara.Weapons[WEAPON_SHOTGUN].Ammo[WEAPON_AMMO1].isInfinite = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects[ID_HARPOON_ITEM].loaded)
|
if (Objects[ID_HARPOON_ITEM].loaded)
|
||||||
|
@ -153,7 +153,7 @@ void LaraCheatGetStuff() // (F) (D)
|
||||||
Lara.Weapons[WEAPON_HARPOON_GUN].SelectedAmmo = WEAPON_AMMO1;
|
Lara.Weapons[WEAPON_HARPOON_GUN].SelectedAmmo = WEAPON_AMMO1;
|
||||||
Lara.Weapons[WEAPON_HARPOON_GUN].HasLasersight = false;
|
Lara.Weapons[WEAPON_HARPOON_GUN].HasLasersight = false;
|
||||||
Lara.Weapons[WEAPON_HARPOON_GUN].HasSilencer = false;
|
Lara.Weapons[WEAPON_HARPOON_GUN].HasSilencer = false;
|
||||||
Lara.Weapons[WEAPON_HARPOON_GUN].Ammo[WEAPON_AMMO1] = -1;
|
Lara.Weapons[WEAPON_HARPOON_GUN].Ammo[WEAPON_AMMO1].isInfinite = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects[ID_GRENADE_GUN_ITEM].loaded)
|
if (Objects[ID_GRENADE_GUN_ITEM].loaded)
|
||||||
|
@ -161,9 +161,9 @@ void LaraCheatGetStuff() // (F) (D)
|
||||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Present = true;
|
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Present = true;
|
||||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].SelectedAmmo = WEAPON_AMMO1;
|
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].SelectedAmmo = WEAPON_AMMO1;
|
||||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].HasSilencer = false;
|
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].HasSilencer = false;
|
||||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Ammo[WEAPON_AMMO1] = -1;
|
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Ammo[WEAPON_AMMO1].isInfinite = true;
|
||||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Ammo[WEAPON_AMMO2] = -1;
|
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Ammo[WEAPON_AMMO2].isInfinite = true;
|
||||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Ammo[WEAPON_AMMO3] = -1;
|
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Ammo[WEAPON_AMMO3].isInfinite = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects[ID_ROCKET_LAUNCHER_ITEM].loaded)
|
if (Objects[ID_ROCKET_LAUNCHER_ITEM].loaded)
|
||||||
|
@ -172,7 +172,7 @@ void LaraCheatGetStuff() // (F) (D)
|
||||||
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].SelectedAmmo = WEAPON_AMMO1;
|
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].SelectedAmmo = WEAPON_AMMO1;
|
||||||
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].HasLasersight = false;
|
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].HasLasersight = false;
|
||||||
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].HasSilencer = false;
|
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].HasSilencer = false;
|
||||||
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].Ammo[WEAPON_AMMO1] = -1;
|
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].Ammo[WEAPON_AMMO1].isInfinite = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects[ID_HK_ITEM].loaded)
|
if (Objects[ID_HK_ITEM].loaded)
|
||||||
|
@ -181,7 +181,7 @@ void LaraCheatGetStuff() // (F) (D)
|
||||||
Lara.Weapons[WEAPON_HK].SelectedAmmo = WEAPON_AMMO1;
|
Lara.Weapons[WEAPON_HK].SelectedAmmo = WEAPON_AMMO1;
|
||||||
Lara.Weapons[WEAPON_HK].HasLasersight = false;
|
Lara.Weapons[WEAPON_HK].HasLasersight = false;
|
||||||
Lara.Weapons[WEAPON_HK].HasSilencer = false;
|
Lara.Weapons[WEAPON_HK].HasSilencer = false;
|
||||||
Lara.Weapons[WEAPON_HK].Ammo[WEAPON_AMMO1] = -1;
|
Lara.Weapons[WEAPON_HK].Ammo[WEAPON_AMMO1].isInfinite = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Objects[ID_CROSSBOW_ITEM].loaded)
|
if (Objects[ID_CROSSBOW_ITEM].loaded)
|
||||||
|
@ -190,9 +190,9 @@ void LaraCheatGetStuff() // (F) (D)
|
||||||
Lara.Weapons[WEAPON_CROSSBOW].SelectedAmmo = WEAPON_AMMO1;
|
Lara.Weapons[WEAPON_CROSSBOW].SelectedAmmo = WEAPON_AMMO1;
|
||||||
Lara.Weapons[WEAPON_CROSSBOW].HasLasersight = false;
|
Lara.Weapons[WEAPON_CROSSBOW].HasLasersight = false;
|
||||||
Lara.Weapons[WEAPON_CROSSBOW].HasSilencer = false;
|
Lara.Weapons[WEAPON_CROSSBOW].HasSilencer = false;
|
||||||
Lara.Weapons[WEAPON_CROSSBOW].Ammo[WEAPON_AMMO1] = -1;
|
Lara.Weapons[WEAPON_CROSSBOW].Ammo[WEAPON_AMMO1].isInfinite = true;
|
||||||
Lara.Weapons[WEAPON_CROSSBOW].Ammo[WEAPON_AMMO2] = -1;
|
Lara.Weapons[WEAPON_CROSSBOW].Ammo[WEAPON_AMMO2].isInfinite = true;
|
||||||
Lara.Weapons[WEAPON_CROSSBOW].Ammo[WEAPON_AMMO3] = -1;
|
Lara.Weapons[WEAPON_CROSSBOW].Ammo[WEAPON_AMMO3].isInfinite = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Inventory.LoadObjects(false);
|
g_Inventory.LoadObjects(false);
|
||||||
|
|
|
@ -258,7 +258,7 @@ bool MonksAttackLara;
|
||||||
ITEM_INFO* LastTargets[8];
|
ITEM_INFO* LastTargets[8];
|
||||||
ITEM_INFO* TargetList[8];
|
ITEM_INFO* TargetList[8];
|
||||||
|
|
||||||
int WeaponObject(int weaponType) // (F) (D)
|
GAME_OBJECT_ID WeaponObject(int weaponType) // (F) (D)
|
||||||
{
|
{
|
||||||
switch (weaponType)
|
switch (weaponType)
|
||||||
{
|
{
|
||||||
|
@ -522,7 +522,7 @@ void LaraGun() // (F) (D)
|
||||||
|
|
||||||
if (TrInput & IN_ACTION)
|
if (TrInput & IN_ACTION)
|
||||||
{
|
{
|
||||||
if (!*GetAmmo(Lara.gunType))
|
if (!GetAmmo(Lara.gunType))
|
||||||
{
|
{
|
||||||
Lara.requestGunType = Objects[ID_PISTOLS_ITEM].loaded ? WEAPON_PISTOLS : WEAPON_NONE;
|
Lara.requestGunType = Objects[ID_PISTOLS_ITEM].loaded ? WEAPON_PISTOLS : WEAPON_NONE;
|
||||||
return;
|
return;
|
||||||
|
@ -594,9 +594,8 @@ void LaraGun() // (F) (D)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
short* GetAmmo(int weaponType)
|
Ammo& GetAmmo(int weaponType){
|
||||||
{
|
return Lara.Weapons[weaponType].Ammo[Lara.Weapons[weaponType].SelectedAmmo];
|
||||||
return &Lara.Weapons[weaponType].Ammo[Lara.Weapons[weaponType].SelectedAmmo];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitialiseNewWeapon()
|
void InitialiseNewWeapon()
|
||||||
|
@ -651,8 +650,7 @@ void InitialiseNewWeapon()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int WeaponObjectMesh(int weaponType)
|
GAME_OBJECT_ID WeaponObjectMesh(int weaponType) {
|
||||||
{
|
|
||||||
switch (weaponType)
|
switch (weaponType)
|
||||||
{
|
{
|
||||||
case WEAPON_REVOLVER:
|
case WEAPON_REVOLVER:
|
||||||
|
@ -724,11 +722,11 @@ void HitTarget(ITEM_INFO* item, GAME_VECTOR* hitPos, int damage, int flag)
|
||||||
|
|
||||||
FireWeaponType FireWeapon(int weaponType, ITEM_INFO* target, ITEM_INFO* src, short* angles) // (F) (D)
|
FireWeaponType FireWeapon(int weaponType, ITEM_INFO* target, ITEM_INFO* src, short* angles) // (F) (D)
|
||||||
{
|
{
|
||||||
short* ammo = GetAmmo(weaponType);
|
Ammo& ammo = GetAmmo(weaponType);
|
||||||
if (*ammo == 0)
|
if (ammo.count == 0 && !ammo.isInfinite)
|
||||||
return FW_NOAMMO;
|
return FW_NOAMMO;
|
||||||
if (*ammo != -1)
|
if (!ammo.isInfinite)
|
||||||
*ammo--;
|
ammo--;
|
||||||
|
|
||||||
WEAPON_INFO* weapon = &Weapons[weaponType];
|
WEAPON_INFO* weapon = &Weapons[weaponType];
|
||||||
int r;
|
int r;
|
||||||
|
|
|
@ -36,11 +36,11 @@ constexpr auto WSTATE_UW_UNAIM = 7;
|
||||||
extern WEAPON_INFO Weapons[static_cast<int>(LARA_WEAPON_TYPE::NUM_WEAPONS)];
|
extern WEAPON_INFO Weapons[static_cast<int>(LARA_WEAPON_TYPE::NUM_WEAPONS)];
|
||||||
|
|
||||||
void SmashItem(short itemNum);
|
void SmashItem(short itemNum);
|
||||||
int WeaponObject(int weaponType);
|
GAME_OBJECT_ID WeaponObject(int weaponType);
|
||||||
void LaraGun();
|
void LaraGun();
|
||||||
short* GetAmmo(int weaponType);
|
Ammo& GetAmmo(int weaponType);
|
||||||
void InitialiseNewWeapon();
|
void InitialiseNewWeapon();
|
||||||
int WeaponObjectMesh(int weaponType);
|
GAME_OBJECT_ID WeaponObjectMesh(int weaponType);
|
||||||
void AimWeapon(WEAPON_INFO* winfo, LARA_ARM* arm);
|
void AimWeapon(WEAPON_INFO* winfo, LARA_ARM* arm);
|
||||||
void HitTarget(ITEM_INFO* item, GAME_VECTOR* hitPos, int damage, int flag);
|
void HitTarget(ITEM_INFO* item, GAME_VECTOR* hitPos, int damage, int flag);
|
||||||
FireWeaponType FireWeapon(int weaponType, ITEM_INFO* target, ITEM_INFO* src, short* angles);
|
FireWeaponType FireWeapon(int weaponType, ITEM_INFO* target, ITEM_INFO* src, short* angles);
|
||||||
|
|
|
@ -35,8 +35,8 @@ extern GameFlow* g_GameFlow;
|
||||||
|
|
||||||
void FireHarpoon()
|
void FireHarpoon()
|
||||||
{
|
{
|
||||||
short* ammos = GetAmmo(WEAPON_CROSSBOW);
|
Ammo& ammos = GetAmmo(WEAPON_CROSSBOW);
|
||||||
if (*ammos != 0)
|
if (ammos.count != 0)
|
||||||
{
|
{
|
||||||
Lara.hasFired = true;
|
Lara.hasFired = true;
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ void FireHarpoon()
|
||||||
short itemNumber = CreateItem();
|
short itemNumber = CreateItem();
|
||||||
if (itemNumber != NO_ITEM)
|
if (itemNumber != NO_ITEM)
|
||||||
{
|
{
|
||||||
if (*ammos != -1)
|
if (!ammos.isInfinite)
|
||||||
(*ammos)--;
|
(ammos)--;
|
||||||
|
|
||||||
GAME_VECTOR pos;
|
GAME_VECTOR pos;
|
||||||
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
ITEM_INFO* item = &g_Level.Items[itemNumber];
|
||||||
|
@ -292,8 +292,8 @@ void FireGrenade()
|
||||||
int y = 0;
|
int y = 0;
|
||||||
int z = 0;
|
int z = 0;
|
||||||
|
|
||||||
short* ammo = GetAmmo(WEAPON_GRENADE_LAUNCHER);
|
Ammo& ammo = GetAmmo(WEAPON_GRENADE_LAUNCHER);
|
||||||
if (*ammo != 0)
|
if (ammo != 0)
|
||||||
{
|
{
|
||||||
Lara.hasFired = true;
|
Lara.hasFired = true;
|
||||||
|
|
||||||
|
@ -365,8 +365,8 @@ void FireGrenade()
|
||||||
|
|
||||||
AddActiveItem(itemNumber);
|
AddActiveItem(itemNumber);
|
||||||
|
|
||||||
if (*ammo != -1)
|
if (!ammo.isInfinite)
|
||||||
(*ammo)--;
|
(ammo)--;
|
||||||
|
|
||||||
item->itemFlags[0] = Lara.Weapons[WEAPON_GRENADE_LAUNCHER].SelectedAmmo;
|
item->itemFlags[0] = Lara.Weapons[WEAPON_GRENADE_LAUNCHER].SelectedAmmo;
|
||||||
|
|
||||||
|
@ -1516,8 +1516,8 @@ void RifleHandler(int weaponType)
|
||||||
|
|
||||||
void FireCrossbow(PHD_3DPOS* pos)
|
void FireCrossbow(PHD_3DPOS* pos)
|
||||||
{
|
{
|
||||||
short* ammos = GetAmmo(WEAPON_CROSSBOW);
|
Ammo& ammos = GetAmmo(WEAPON_CROSSBOW);
|
||||||
if (*ammos != 0)
|
if (ammos)
|
||||||
{
|
{
|
||||||
Lara.hasFired = true;
|
Lara.hasFired = true;
|
||||||
|
|
||||||
|
@ -1542,8 +1542,8 @@ void FireCrossbow(PHD_3DPOS* pos)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (*ammos != -1)
|
if (!ammos.isInfinite)
|
||||||
(*ammos)--;
|
(ammos)--;
|
||||||
|
|
||||||
PHD_VECTOR jointPos;
|
PHD_VECTOR jointPos;
|
||||||
jointPos.x = 0;
|
jointPos.x = 0;
|
||||||
|
@ -1600,9 +1600,8 @@ void FireCrossbow(PHD_3DPOS* pos)
|
||||||
|
|
||||||
void FireRocket()
|
void FireRocket()
|
||||||
{
|
{
|
||||||
short* ammos = GetAmmo(WEAPON_ROCKET_LAUNCHER);
|
Ammo& ammos = GetAmmo(WEAPON_ROCKET_LAUNCHER);
|
||||||
if (*ammos != 0)
|
if (ammos) {
|
||||||
{
|
|
||||||
Lara.hasFired = true;
|
Lara.hasFired = true;
|
||||||
|
|
||||||
short itemNumber = CreateItem();
|
short itemNumber = CreateItem();
|
||||||
|
@ -1612,8 +1611,8 @@ void FireRocket()
|
||||||
item->objectNumber = ID_ROCKET;
|
item->objectNumber = ID_ROCKET;
|
||||||
item->roomNumber = LaraItem->roomNumber;
|
item->roomNumber = LaraItem->roomNumber;
|
||||||
|
|
||||||
if (*ammos != -1)
|
if (!ammos.isInfinite)
|
||||||
(*ammos)--;
|
(ammos)--;
|
||||||
|
|
||||||
PHD_VECTOR jointPos;
|
PHD_VECTOR jointPos;
|
||||||
jointPos.x = 0;
|
jointPos.x = 0;
|
||||||
|
|
|
@ -827,11 +827,69 @@ struct HolsterInfo {
|
||||||
HOLSTER_SLOT rightHolster;
|
HOLSTER_SLOT rightHolster;
|
||||||
HOLSTER_SLOT backHolster;
|
HOLSTER_SLOT backHolster;
|
||||||
};
|
};
|
||||||
|
struct Ammo {
|
||||||
|
unsigned short count;
|
||||||
|
bool isInfinite;
|
||||||
|
|
||||||
|
Ammo operator --() {
|
||||||
|
Ammo tmp;
|
||||||
|
tmp.isInfinite = this->isInfinite;
|
||||||
|
tmp.count = static_cast<unsigned int>(--this->count);
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ammo operator --(int) {
|
||||||
|
Ammo tmp;
|
||||||
|
tmp.isInfinite = this->isInfinite;
|
||||||
|
tmp.count = --this->count;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ammo operator ++() {
|
||||||
|
Ammo tmp;
|
||||||
|
tmp.isInfinite = this->isInfinite;
|
||||||
|
tmp.count = ++this->count;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ammo operator ++(int) {
|
||||||
|
Ammo tmp;
|
||||||
|
tmp.isInfinite = this->isInfinite;
|
||||||
|
tmp.count = ++this->count;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ammo& operator =(unsigned val) {
|
||||||
|
this->count = static_cast<unsigned short>(val);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ammo& operator +(unsigned val) {
|
||||||
|
int tmp = this->count + val;
|
||||||
|
this->count = static_cast<unsigned short>(tmp);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ammo& operator +=(unsigned val) {
|
||||||
|
int tmp = this->count + val;
|
||||||
|
this->count = static_cast<unsigned short>(tmp);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ammo& operator -=(unsigned val) {
|
||||||
|
int tmp = this->count - val;
|
||||||
|
this->count = static_cast<unsigned short>(tmp);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator bool() {
|
||||||
|
return isInfinite || (count > 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
typedef struct CarriedWeaponInfo
|
typedef struct CarriedWeaponInfo
|
||||||
{
|
{
|
||||||
bool Present;
|
bool Present;
|
||||||
short Ammo[MAX_AMMOTYPE];
|
Ammo Ammo[MAX_AMMOTYPE];
|
||||||
int SelectedAmmo; // WeaponAmmoType_enum
|
int SelectedAmmo; // WeaponAmmoType_enum
|
||||||
bool HasLasersight;
|
bool HasLasersight;
|
||||||
bool HasSilencer;
|
bool HasSilencer;
|
||||||
|
|
|
@ -1315,9 +1315,9 @@ void BinocularCamera(ITEM_INFO* item)
|
||||||
if (LaserSight)
|
if (LaserSight)
|
||||||
{
|
{
|
||||||
int firing = 0;
|
int firing = 0;
|
||||||
short* ammo = GetAmmo(Lara.gunType);
|
Ammo& ammo = GetAmmo(Lara.gunType);
|
||||||
|
|
||||||
if (!(InputBusy & IN_ACTION) || WeaponDelay || !*ammo)
|
if (!(InputBusy & IN_ACTION) || WeaponDelay || !ammo)
|
||||||
{
|
{
|
||||||
if (!(InputBusy & IN_ACTION))
|
if (!(InputBusy & IN_ACTION))
|
||||||
{
|
{
|
||||||
|
@ -1334,8 +1334,8 @@ void BinocularCamera(ITEM_INFO* item)
|
||||||
firing = 1;
|
firing = 1;
|
||||||
WeaponDelay = 16;
|
WeaponDelay = 16;
|
||||||
Savegame.Game.AmmoUsed++;
|
Savegame.Game.AmmoUsed++;
|
||||||
if (*ammo != -1)
|
if (!ammo.isInfinite)
|
||||||
(*ammo)--;
|
(ammo)--;
|
||||||
}
|
}
|
||||||
else if (Lara.gunType == WEAPON_CROSSBOW)
|
else if (Lara.gunType == WEAPON_CROSSBOW)
|
||||||
{
|
{
|
||||||
|
@ -1426,8 +1426,8 @@ void BinocularCamera(ITEM_INFO* item)
|
||||||
Camera.bounce = -16 - (GetRandomControl() & 0x1F);
|
Camera.bounce = -16 - (GetRandomControl() & 0x1F);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*ammo != -1)
|
if (!ammo.isInfinite)
|
||||||
(*ammo)--;
|
(ammo)--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue