Skip to content

Commit

Permalink
Fixed example code letting extra weapons get equipped while they were…
Browse files Browse the repository at this point in the history
… already out
  • Loading branch information
AltimorTASDK committed Dec 10, 2013
1 parent 9ccc4cf commit 3189cec
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions TribesAscendSDK/TestMod.d
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,12 @@ extern(C) HookType TribesGame_TrPlayerController_SwitchToCallIn(TrPlayerControll

if (invManager)
{
TrDevice device = invManager.GetDeviceByEquipPoint(TrObject.TR_EQUIP_POINT.EQP_LaserTarget);

if (cast(TrDevice)(pawn.WeaponVar) != device) //Make sure it's not already equipped
{
if (T == 1)
invManager.SwitchWeaponByEquipPoint(CUSTOM_EQUIP_POINT.EQP_Tertiary);
else if (T == 2)
invManager.SwitchWeaponByEquipPoint(CUSTOM_EQUIP_POINT.EQP_Quaternary);
else if (T == 3)
invManager.SwitchWeaponByEquipPoint(CUSTOM_EQUIP_POINT.EQP_Quinary);
}
if (T == 1 && cast(TrDevice)(pawn.WeaponVar) != invManager.GetDeviceByEquipPoint(CUSTOM_EQUIP_POINT.EQP_Tertiary))
invManager.SwitchWeaponByEquipPoint(CUSTOM_EQUIP_POINT.EQP_Tertiary);
else if (T == 2 && cast(TrDevice)(pawn.WeaponVar) != invManager.GetDeviceByEquipPoint(CUSTOM_EQUIP_POINT.EQP_Quaternary))
invManager.SwitchWeaponByEquipPoint(CUSTOM_EQUIP_POINT.EQP_Quaternary);
else if (T == 3 && cast(TrDevice)(pawn.WeaponVar) != invManager.GetDeviceByEquipPoint(CUSTOM_EQUIP_POINT.EQP_Quinary))
invManager.SwitchWeaponByEquipPoint(CUSTOM_EQUIP_POINT.EQP_Quinary);
}
}

Expand Down

0 comments on commit 3189cec

Please sign in to comment.