View Issue Details

IDProjectCategoryView StatusLast Update
0003799Spring engineLuapublic2013-05-23 19:54
ReporterKingRaptor Assigned Tocleanrock  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version94.1.1+git 
Fixed 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

Activities

Kloot

2013-05-21 14:33

developer   ~0010720

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').

cleanrock

2013-05-21 16:32

reporter   ~0010723

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)));
}

KingRaptor

2013-05-22 12:10

reporter   ~0010746

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.

Google_Frog

2013-05-22 15:01

reporter   ~0010748

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.

cleanrock

2013-05-23 17:12

reporter   ~0010750

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

cleanrock

2013-05-23 19:54

reporter   ~0010751

KR test ok

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