View Issue Details

IDProjectCategoryView StatusLast Update
0005278Spring engineAIpublic2016-06-13 15:52
Reporterlamer Assigned Tohokomoko  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version101.0+git 
Summary0005278: Unit::GetPos returns different values with and without cheats
DescriptionUnit::GetPos returns different values with and without cheats.
Yet i can't tell which behaviour is better: with midPos offset (so i don't need to apply it everytime inside AI) or without.
Steps To ReproduceWith own unit execute
Unit* u = ...;
AIFloat3 pos1 = u->GetPos();
callback->GetCheats->SetEnabled(true);
AIFloat3 pos2 = u->GetPos();
if (pos1 != pos2) fail miserably;
Additional InformationWithout cheats: CAICallback::GetUnitPos - position without midPos offset.
With cheats: CAICheats::GetUnitPos - position with midPos offset applied.
TagsNo tags attached.
Attached Files
midPos.jpg (Attachment missing)
Checked infolog.txt for Errors

Activities

abma

2016-06-13 14:54

administrator   ~0016432

is the unit within LOS?

outside of LOS i guess its the radar wobble...

lamer

2016-06-13 14:57

reporter   ~0016433

Last edited: 2016-06-13 15:01

own unit -> within los

Unit::pos and Unit::midPos are different things. For some reason Unit::pos accounts for midPosOffset and i don't have to apply offset inside AI to that value to get center of the unit. And with Unit::midPos AI has to apply midPosOffset to get center of the unit.
Can't understand logic...

silentwings

2016-06-13 15:08

reporter   ~0016434

Not strictly relevant, but units can have 0 LOS.

lamer

2016-06-13 15:17

reporter   ~0016435

Last edited: 2016-06-13 15:49

The difference is not some random value, it's constant midPosOffset for own in los unit (but only for units that have midPosOffset).

Going to make more descriptive example (ZK + factoryamph unit).

Replace CppTestAI.cpp with this:
http://paste.springfiles.com/view/c5322841

hokomoko

2016-06-13 15:52

developer   ~0016436

Fix 3a55a470c90c0ed9d23ff1987fcd8796784687a0 committed to develop branch: fix 0005278, repo: spring changeset id: 7124

Issue History

Date Modified Username Field Change
2016-06-13 14:46 lamer New Issue
2016-06-13 14:54 abma Note Added: 0016432
2016-06-13 14:57 lamer Note Added: 0016433
2016-06-13 15:00 lamer Note Edited: 0016433
2016-06-13 15:01 lamer Note Edited: 0016433
2016-06-13 15:08 silentwings Note Added: 0016434
2016-06-13 15:17 lamer Note Added: 0016435
2016-06-13 15:41 lamer File Added: midPos.jpg
2016-06-13 15:43 hokomoko Assigned To => hokomoko
2016-06-13 15:43 hokomoko Status new => assigned
2016-06-13 15:49 lamer Note Edited: 0016435
2016-06-13 15:52 hokomoko Changeset attached => spring develop 3a55a470
2016-06-13 15:52 hokomoko Note Added: 0016436
2016-06-13 15:52 hokomoko Status assigned => resolved
2016-06-13 15:52 hokomoko Resolution open => fixed