2025-08-03 23:18 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001820Spring engineGeneralpublic2010-02-07 11:43
Reportertvo 
Assigned TojK 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version0.81.1.3 
Target Version0.81.2Fixed in Version 
Summary0001820: Mines explode now even when plane flies high above them
DescriptionMines still have 2d radius in which they check for enemies, but in the past they checked for physicalState != Flying. That has been removed, see this part of diff between 0.80.5.2 and 0.81.1.3:

        if (unitDef->canKamikaze) {
                if (fireState >= 2) {
- CUnit* u = helper->GetClosestEnemyUnitNoLosTest(pos, unitDef->kamikazeDist, allyteam, false, true);
- if (u && u->physicalState != CSolidObject::Flying && u->speed.dot(pos - u->pos) <= 0) {
- // self destruct when unit start moving away from mine, should maximize damage
+ CUnit* u = helper->GetClosestEnemyUnit(pos, unitDef->kamikazeDist, allyteam);
+ if (u && u->speed.dot(pos - u->pos) <= 0) {
+ //! self destruct when we start moving away from the target, this should maximize the damage
                                KillUnit(true, false, NULL);
                        }
                }

Hence, now mines can be defused by flying any kind of airplane over them.
Additional InformationUse this command to see the diff a bit better:

git diff 0.80.5.2..0.81.1.3 -- rts/Sim/Units/Unit.cpp
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0004586

hoijui (reporter)

done in commit 06de8be5d358dcc6a0a7a08db4982b2ae4b3692d:
#############
fix kamikaze units:
* do a los check
* do a sphere instead of cylinder check (don't explode on subs anymore)
* removed a check-for-flying hack (was there cause of cylinder checking)
#############

So the commit was meant to do a sphere check, but as you say, still does a cylindrical(2D) check. So the appropriate fix would be, to really use a 3D instead of 2D check then, right?

~0004587

Kloot (developer)

Last edited: 2010-02-02 22:20

CGameHelper::GetClosestEnemyUnit uses the ClosestUnit filter struct, which does a 2D check in AddUnit ((pos - u->midPos).SqLength2D()) to set the closest unit. So it's strange the commit worked for subs in the first place...

~0004598

Auswaschbar (reporter)

Added height check, remaining issues with cloaked units.

~0004605

jK (developer)

added a new unitdef tag "kamikazeUseLOS" (default false)
+Notes

-Issue History
Date Modified Username Field Change
2010-02-02 18:16 tvo New Issue
2010-02-02 18:16 tvo Additional Information Updated
2010-02-02 21:36 hoijui Note Added: 0004586
2010-02-02 22:19 Kloot Note Added: 0004587
2010-02-02 22:20 Kloot Note Edited: 0004587
2010-02-04 18:19 Auswaschbar Note Added: 0004598
2010-02-06 12:55 jK Note Added: 0004605
2010-02-06 12:55 jK Status new => resolved
2010-02-06 12:55 jK Resolution open => fixed
2010-02-06 12:55 jK Assigned To => jK
2010-02-07 11:43 tvo Target Version => 0.81.2
+Issue History