mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 20:58:07 +03:00
inventory: set any weapon to default on pickup if unarmed (#1445)
Resolves #1443.
This commit is contained in:
parent
a1e72ac8ba
commit
c61471f275
5 changed files with 24 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
- added weapons to Lara's empty holsters on pickup (#1291)
|
||||
- added options to quiet or mute music while underwater (#528)
|
||||
- changed the turbo cheat to no longer affect the gameplay time (#1420)
|
||||
- changed weapon pickup behavior when unarmed to set any weapon as the default weapon, not just pistols (#1443)
|
||||
- fixed adjacent Midas Touch objects potentially allowing gold bar duplication in custom levels (#1415)
|
||||
- fixed the excessive pitch and playback speed correction for music files with sampling rate other than 44100 Hz (#1417, regression from 2.0)
|
||||
- fixed the ingame timer being skewed upon inventory open (#1420, regression from 4.1)
|
||||
|
|
|
@ -461,6 +461,7 @@ Not all options are turned on by default. Refer to `TR1X_ConfigTool.exe` for det
|
|||
- added a flag indicating if new game plus is unlocked to the player config which allows the player to select new game plus or not when making a new game
|
||||
- added weapons to Lara's empty holsters on pickup
|
||||
- added options to quiet or mute music while underwater
|
||||
- changed weapon pickup behavior when unarmed to set any weapon as the default weapon, not just pistols
|
||||
- fixed keys and items not working when drawing guns immediately after using them
|
||||
- fixed counting the secret in The Great Pyramid
|
||||
- fixed running out of ammo forcing Lara to equip pistols even if she doesn't carry them
|
||||
|
|
|
@ -15,6 +15,7 @@ void Gun_HitTarget(ITEM_INFO *item, GAME_VECTOR *hitpos, int16_t damage);
|
|||
void Gun_DrawFlash(LARA_GUN_TYPE weapon_type, int32_t clip);
|
||||
GAME_OBJECT_ID Gun_GetLaraAnim(LARA_GUN_TYPE gun_type);
|
||||
GAME_OBJECT_ID Gun_GetWeaponAnim(LARA_GUN_TYPE gun_type);
|
||||
LARA_GUN_TYPE Gun_GetType(GAME_OBJECT_ID object_id);
|
||||
void Gun_UpdateLaraMeshes(GAME_OBJECT_ID object_id);
|
||||
void Gun_SetLaraBackMesh(LARA_GUN_TYPE weapon_type);
|
||||
void Gun_SetLaraHandLMesh(LARA_GUN_TYPE weapon_type);
|
||||
|
|
|
@ -234,6 +234,22 @@ GAME_OBJECT_ID Gun_GetWeaponAnim(const LARA_GUN_TYPE gun_type)
|
|||
}
|
||||
}
|
||||
|
||||
LARA_GUN_TYPE Gun_GetType(const GAME_OBJECT_ID object_id)
|
||||
{
|
||||
switch (object_id) {
|
||||
case O_PISTOL_ITEM:
|
||||
return LGT_PISTOLS;
|
||||
case O_MAGNUM_ITEM:
|
||||
return LGT_MAGNUMS;
|
||||
case O_UZI_ITEM:
|
||||
return LGT_UZIS;
|
||||
case O_SHOTGUN_ITEM:
|
||||
return LGT_SHOTGUN;
|
||||
default:
|
||||
return LGT_UNARMED;
|
||||
}
|
||||
}
|
||||
|
||||
void Gun_DrawFlash(LARA_GUN_TYPE weapon_type, int32_t clip)
|
||||
{
|
||||
int32_t light;
|
||||
|
|
|
@ -14,6 +14,11 @@ bool Inv_AddItem(const GAME_OBJECT_ID object_id)
|
|||
{
|
||||
if (Object_IsObjectType(object_id, g_GunObjects)) {
|
||||
Gun_UpdateLaraMeshes(object_id);
|
||||
if (g_Lara.gun_type == LGT_UNARMED) {
|
||||
g_Lara.gun_type = Gun_GetType(object_id);
|
||||
g_Lara.gun_status = LGS_ARMLESS;
|
||||
Gun_InitialiseNewWeapon();
|
||||
}
|
||||
}
|
||||
|
||||
const GAME_OBJECT_ID inv_object_id = Inv_GetItemOption(object_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue