This bug has been around for a while. If you quickly fire two shots at an enemy, using Quick Shot for example, it’s possible that the first shot kills the enemy, and yet the second one will still fire. This second shot won’t do anything, but still eat the AP of the user.
I reckon this has something to do with the onScheduledTargetHit method. This checks if the target is dead, and returns at that point:
if (!_info.TargetEntity.isAlive())
{
return;
}
Maybe it would be possible to refund the AP of the user at this point:
if (!_info.TargetEntity.isAlive())
{
_info.User.ActionPoints += _info.Skill.ActionPointCost
return;
}