View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001929 | Spring engine | Lua | public | 2010-05-17 14:43 | 2010-08-09 23:17 |
| Reporter | zwzsg | Assigned To | Kloot | ||
| Priority | normal | Severity | minor | Reproducibility | random |
| Status | resolved | Resolution | fixed | ||
| Product Version | 0.81.2.1 | ||||
| Fixed in Version | 0.82.0+git | ||||
| Summary | 0001929: GetUnitNearestEnemy sometimes return the unit itself | ||||
| Description | I had written a synced gadget that spawned a Dino unit belonging to Gaia, and then ran: local target=Spring.GetUnitNearestEnemy(DinoID,nil,false) (I wanted closest enemy, map-wide, even if out of los.) I was testing it by speccing a KAIK 2v2. I noticed that Spring.GetUnitNearestEnemy sometimes returned the DinoID itself, instead of the ID of an enemy unit. It's not that a terrible bug because it's easy to rewrite a custom non buggy implementation of GetUnitNearestEnemy in Lua, nevertheless, I lost a few hours trying to debug my gadget until I found out the bug lied in GetUnitNearestEnemy, so to avoid that to other Lua coders, I guess it ought to be reported. I don't recall having that bug when I was playing a team instead of speccing AIs, maybe this plays a role? Also, maybe that I used a Gaia unit played a part? | ||||
| Tags | No tags attached. | ||||
| Checked infolog.txt for Errors | |||||
|
|
Possibly Gaia isn't allied to itself? (Yeah, it's actually possible [in certain parts of the code] for an allyteam to not be allied to itself.) |
|
|
May also have been the result of the bug fixed by http://github.com/spring/spring/commit/284731c07e70d0372aaa34cb8a5d076416651037 . |
|
|
Z, if possible, please test with spring master, or wait for the RC. |
|
|
Indeed 0.81.2.1 gaia was not allied with itself. In the third RC (0.82.1) gaia is now allied with itself, and Spring.GetUnitNearestEnemy doesn't return its first argument. So, fixed. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2010-05-17 14:43 | zwzsg | New Issue | |
| 2010-06-11 00:00 | tvo | Note Added: 0004969 | |
| 2010-06-11 02:00 | Kloot | Note Added: 0004970 | |
| 2010-06-11 08:55 | hoijui | Note Added: 0004971 | |
| 2010-06-11 08:55 | hoijui | Status | new => feedback |
| 2010-08-09 23:14 | zwzsg | Note Added: 0005229 | |
| 2010-08-09 23:17 | Kloot | Status | feedback => resolved |
| 2010-08-09 23:17 | Kloot | Fixed in Version | => 0.82.0+git |
| 2010-08-09 23:17 | Kloot | Resolution | open => fixed |
| 2010-08-09 23:17 | Kloot | Assigned To | => Kloot |