Skip to content
Permalink
Browse files

Fix #4824, #4826

  • Loading branch information
ashdnazg committed Jun 20, 2015
1 parent 8fef450 commit e9eca7c5bbce2aad375ba5f7a61956698b3d0c89
Showing with 3 additions and 5 deletions.
  1. +2 −4 rts/Sim/Units/Scripts/UnitScript.cpp
  2. +1 −1 rts/Sim/Weapons/Weapon.h
@@ -646,11 +646,9 @@ void CUnitScript::EmitSfx(int sfxType, int piece)
CWeapon* w = unit->weapons[index];
const SWeaponTarget origTarget = w->GetCurrentTarget();
const float3 origWeaponMuzzlePos = w->weaponMuzzlePos;

w->SetAttackTarget(SWeaponTarget(pos + dir));
w->weaponMuzzlePos = pos;
if (w->Attack(SWeaponTarget(pos + dir))) {
w->Fire(true);
}
w->Fire(true);
w->weaponMuzzlePos = origWeaponMuzzlePos;
bool origRestored = w->Attack(origTarget);
assert(origRestored);
@@ -32,6 +32,7 @@ class CWeapon : public CObject

public:
bool Attack(const SWeaponTarget& newTarget);
void SetAttackTarget(const SWeaponTarget& newTarget); //< does not any checks etc. !
void DropCurrentTarget();

bool HaveTarget() const { return (currentTarget.type != Target_None); }
@@ -104,7 +105,6 @@ class CWeapon : public CObject
void ReAimWeapon();
void HoldIfTargetInvalid();

void SetAttackTarget(const SWeaponTarget& newTarget); //< does not any checks etc. !
bool TryTarget(const float3 tgtPos, const SWeaponTarget& trg) const;

public:

0 comments on commit e9eca7c

Please sign in to comment.
You can’t perform that action at this time.