2025-07-23 01:33 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0005278Spring engineAIpublic2016-06-13 15:52
Reporterlamer 
Assigned Tohokomoko 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version101.0+git 
Target VersionFixed in Version 
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.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0016432

abma (administrator)

is the unit within LOS?

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

~0016433

lamer (reporter)

Last edited: 2016-06-13 15:01

View 3 revisions

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

~0016434

silentwings (reporter)

Not strictly relevant, but units can have 0 LOS.

~0016435

lamer (reporter)

Last edited: 2016-06-13 15:49

View 2 revisions

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

~0016436

hokomoko (developer)

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

-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 View Revisions
2016-06-13 15:01 lamer Note Edited: 0016433 View Revisions
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 View Revisions
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
+Issue History