fix bug when not using holo
This commit is contained in:
@@ -25,28 +25,31 @@ int recharge_remove = 1
|
|||||||
{
|
{
|
||||||
if ( IsValid(player) && IsAlive( player ))
|
if ( IsValid(player) && IsAlive( player ))
|
||||||
{
|
{
|
||||||
Assert(player)
|
if(player.GetOffhandWeapon(1).GetWeaponClassName() == "mp_ability_holopilot"){
|
||||||
if(!player.IsPhaseShifted()){
|
Assert(player)
|
||||||
int chargeCount = player.GetOffhandWeapon(1).GetWeaponPrimaryClipCount()
|
if(!player.IsPhaseShifted()){
|
||||||
int oldchargeCount = chargeCount
|
int chargeCount = player.GetOffhandWeapon(1).GetWeaponPrimaryClipCount()
|
||||||
if(player in playerDecoyList){
|
int oldchargeCount = chargeCount
|
||||||
chargeCount -= recharge_remove
|
if(player in playerDecoyList){
|
||||||
if(chargeCount < 0)
|
chargeCount -= recharge_remove
|
||||||
chargeCount = 0
|
if(chargeCount < 0)
|
||||||
}else{
|
chargeCount = 0
|
||||||
int max = player.GetOffhandWeapon(1).GetWeaponPrimaryClipCountMax()
|
}else{
|
||||||
chargeCount += rechargeStep
|
int max = player.GetOffhandWeapon(1).GetWeaponPrimaryClipCountMax()
|
||||||
if(chargeCount > charge_size){
|
chargeCount += rechargeStep
|
||||||
chargeCount = max
|
if(chargeCount > charge_size){
|
||||||
|
chargeCount = max
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(oldchargeCount != chargeCount){
|
||||||
|
player.GetOffhandWeapon(1).SetWeaponPrimaryClipCount(chargeCount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(oldchargeCount != chargeCount){
|
|
||||||
player.GetOffhandWeapon(1).SetWeaponPrimaryClipCount(chargeCount)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wait rechargeInterval
|
wait rechargeInterval
|
||||||
|
|||||||
@@ -376,9 +376,11 @@ bool function PlayerCanUseDecoy( entity ownerPlayer ) //For holopilot and HoloPi
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ownerPlayer.GetOffhandWeapon(1).GetWeaponPrimaryClipCount()<100)
|
if(ownerPlayer.GetOffhandWeapon(1).GetWeaponClassName() == "mp_ability_holopilot" && ownerPlayer.GetOffhandWeapon(1).GetWeaponPrimaryClipCount()<100)
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
if(ownerPlayer.GetOffhandWeapon(1).GetWeaponClassName() == "mp_ability_holopilot" && ownerPlayer.GetOffhandWeapon(1).GetWeaponPrimaryClipCount()<200 && !(ownerPlayer in playerDecoyList))
|
||||||
|
return false
|
||||||
//Do we need to check isPhaseShifted here? Re-examine when it's possible to get both Phase and Decoy (maybe through burn cards?)
|
//Do we need to check isPhaseShifted here? Re-examine when it's possible to get both Phase and Decoy (maybe through burn cards?)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user