2019-08-23 15:34 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003329Spring engineLuapublic2017-09-24 19:12
Reportermsafwan 
Assigned ToKloot 
PrioritylowSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version91.0 
Target VersionFixed in Version91.0.1+git 
Summary0003329: Spring.SetUnitVelocity() cannot work for x,z direction
DescriptionI tried Spring.SetUnitVelocity for x,y,z axis, but only y axis work.

Currently I am using Spring.MoveCtrl.SetVelocity to do what I needed, but incase someone needed Spring.SetUnitVelocity in the future, then it could be a problem.
Steps To ReproduceWas experimenting with fake unit to imitate movement of another unit during jump & free falling.
TagsNo tags attached.
Checked infolog.txt for lua Errors
Attached Files
  • diff file icon mantis3329-fix.diff (856 bytes) 2012-12-05 21:55 -
    diff --git a/rts/Sim/MoveTypes/GroundMoveType.cpp b/rts/Sim/MoveTypes/GroundMoveType.cpp
    index d49f061..1cd749a 100644
    --- a/rts/Sim/MoveTypes/GroundMoveType.cpp
    +++ b/rts/Sim/MoveTypes/GroundMoveType.cpp
    @@ -2286,7 +2286,11 @@ void CGroundMoveType::UpdateOwnerPos(bool wantReverse)
     		const MoveDef* md = ud->moveDef;
     
     		const int    speedSign = int(!reversing) * 2 - 1;
    -		const float  speedScale = currentSpeed + deltaSpeed;
    +		// LuaSyncedCtrl::SetUnitVelocity directly assigns
    +		// to owner->speed which gets overridden below, so
    +		// need to calculate speedScale from it directly
    +		// const float  speedScale = currentSpeed + deltaSpeed;
    +		const float  speedScale = owner->speed.Length() + deltaSpeed;
     		const float3 speedVector = owner->frontdir * speedScale * speedSign;
     
     		// NOTE: don't check for structure blockage, coldet handles that
    
    diff file icon mantis3329-fix.diff (856 bytes) 2012-12-05 21:55 +

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2012-11-13 07:35 msafwan New Issue
2012-11-13 07:36 msafwan Tag Attached: callins
2012-12-05 21:55 Kloot File Added: mantis3329-fix.diff
2013-01-16 21:07 Kloot Status new => resolved
2013-01-16 21:07 Kloot Fixed in Version => 91.0.1+git
2013-01-16 21:07 Kloot Resolution open => fixed
2013-01-16 21:07 Kloot Assigned To => Kloot
2017-09-24 19:12 Kloot Tag Detached: callins
+Issue History