2025-07-28 00:03 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003799Spring engineLuapublic2013-05-23 19:54
ReporterKingRaptor 
Assigned Tocleanrock 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version94.1.1+git 
Target VersionFixed in Version94.1.1+git 
Summary0003799: Spring.SetProjectileTarget with position args does not work as expected
DescriptionI am calling Spring.SetProjectileTarget(projectileID, x, y, z) on a MissileLauncher's projectile. Expected behaviour is for projectile to fly towards the specified new position, but instead it continues to track existing target unit (if tracks=true) or point.

Tested with Spring 94.1.1-542-g8d17b01.
Additional InformationExample gadget: http://paste.springfiles.com/view/fec4eb73
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0010720

Kloot (developer)

If a projectile has a target object, calling SetProjectileTarget with a position argument does nothing and you should clear the projectile's target first with SetProjectileTarget(proID, -1, 'u').

~0010723

cleanrock (reporter)

Is this limitation really needed ?
How about changing LuaSyncedCtrl::SetProjectileTarget to remove the check or remove target if necessary ?

Current code:
if (wpro->GetTargetObject() == NULL) {
  wpro->SetTargetPos(float3(luaL_checkfloat(L, 2), luaL_checkfloat(L, 3), luaL_checkfloat(L, 4)));
}

~0010746

KingRaptor (reporter)

On that note, a unitID arg of -1 (or any other value outside the allowed unitID range, or a nil unitID) causes it to throw a "bad unitID" error. Have to work around it by passing it a valid but unused unitID.

~0010748

Google_Frog (reporter)

When I last checked, Spring.SetUnitTarget also throws an error (when called with two arguments) if the target unitID is invalid. So calling with -1 to clear target does not work.

~0010750

cleanrock (reporter)

Please test with http://springrts.com/dl/buildbot/default/develop/94.1.1-554-g7933d4f/

~0010751

cleanrock (reporter)

KR test ok
+Notes

-Issue History
Date Modified Username Field Change
2013-05-21 14:03 KingRaptor New Issue
2013-05-21 14:33 Kloot Note Added: 0010720
2013-05-21 16:32 cleanrock Note Added: 0010723
2013-05-22 12:10 KingRaptor Note Added: 0010746
2013-05-22 15:01 Google_Frog Note Added: 0010748
2013-05-23 16:15 cleanrock Assigned To => cleanrock
2013-05-23 16:15 cleanrock Status new => assigned
2013-05-23 16:22 cleanrock Changeset attached => spring develop 7933d4f1
2013-05-23 16:22 cleanrock Resolution open => fixed
2013-05-23 17:12 cleanrock Note Added: 0010750
2013-05-23 17:12 cleanrock Status assigned => feedback
2013-05-23 19:54 cleanrock Note Added: 0010751
2013-05-23 19:54 cleanrock Status feedback => resolved
2013-05-23 19:54 cleanrock Fixed in Version => 94.1.1+git
+Issue History