Skip to content
Permalink
Browse files

close PR #132 and #336

  • Loading branch information
rt
rt committed Sep 25, 2017
1 parent 8a74b03 commit 4c0e647fb8fb986d79d0b1db36acc6ac73fcad7b
Showing with 11 additions and 20 deletions.
  1. +4 −0 doc/changelog.txt
  2. +6 −19 rts/Sim/Weapons/BeamLaser.cpp
  3. +1 −1 rts/Sim/Weapons/Weapon.cpp
@@ -3,6 +3,10 @@ Spring changelog
(numbers in brackets normally mean the mantis ticket ID)

-- 105.0 --------------------------------------------------------
Sim:
- remove undocumented BeamLaser range modifier (30% extra for mobile units)
- remove legacy (COB) hack allowing units with onlyForward weapons to fire regardless of AimWeapon status

Misc:
- make LuaVFSDownload rescan archives in main thread, when a download finishes instead of starts

@@ -137,12 +137,8 @@ void CBeamLaser::UpdatePosAndMuzzlePos()

float CBeamLaser::GetPredictedImpactTime(float3 p) const
{
if (!weaponDef->beamburst) {
return salvoSize / 2;
} else {
// beamburst tracks the target during the burst so there's no need to lead
return 0;
}
// beamburst tracks the target during the burst so there's no need to lead
return (salvoSize * 0.5f * (1 - weaponDef->beamburst));
}

void CBeamLaser::UpdateSweep()
@@ -265,15 +261,7 @@ void CBeamLaser::FireImpl(const bool scriptCall)
void CBeamLaser::FireInternal(float3 curDir)
{
float actualRange = range;
float rangeMod = 1.0f;

if (!owner->unitDef->IsImmobileUnit()) {
// help units fire while chasing
rangeMod = 1.3f;
}
if (owner->UnderFirstPersonControl()) {
rangeMod = 0.95f;
}
float rangeMod = 1.0f - (0.05f * owner->UnderFirstPersonControl());

bool tryAgain = true;
bool doDamage = true;
@@ -387,12 +375,11 @@ void CBeamLaser::FireInternal(float3 curDir)
if (!doDamage)
return;

if (hitUnit != NULL) {
if (hitUnit != nullptr) {
hitUnit->SetLastHitPiece(hitColQuery.GetHitPiece(), gs->frameNum);

if (weaponDef->targetBorder > 0.0f) {
actualRange += (hitUnit->radius * weaponDef->targetBorder);
}
// FIXME? still assumes spherical CV's
actualRange += (hitUnit->radius * weaponDef->targetBorder * (weaponDef->targetBorder > 0.0f));
}

if (curLength < maxLength) {
@@ -310,7 +310,7 @@ void CWeapon::UpdateAim()
// this should not need to be here, but many legacy scripts do not
// seem to define Aim*Ary in COB for units with onlyForward weapons
// (so angleGood is never set to true) -- REMOVE AFTER 90.0
angleGood |= (onlyForward && targetAngleConstraint);
// angleGood |= (onlyForward && targetAngleConstraint);

// reaim weapon when needed
ReAimWeapon();

0 comments on commit 4c0e647

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