2025-08-03 02:17 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000525Spring engineGeneralpublic2009-05-12 17:06
Reporterimbaczek 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000525: [patch] weapons aim and shoot at cloaked and stealth flying units
Descriptionwhen developing my orbital barrage unit, I found that even if a plane has cloak and stealth, units shoot at it. this patch remedies that, but I guess not in an elegant way.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • diff file icon stop_shooting_at_cloaked_units.diff (463 bytes) 2007-04-13 11:59 -
    Index: Weapon.cpp
    ===================================================================
    --- Weapon.cpp	(revision 3610)
    +++ Weapon.cpp	(working copy)
    @@ -173,6 +173,11 @@
     		relWeaponPos=owner->localmodel->GetPiecePos(args[0]);
     	}
     
    +	if(targetType == Target_Unit && targetUnit && targetUnit->isCloaked) {
    +		HoldFire();
    +		return;
    +	}
    +
     	if(targetType==Target_Unit){
     		if(lastErrorVectorUpdate<gs->frameNum-16){
     			float3 newErrorVector(gs->randVector());
    
    diff file icon stop_shooting_at_cloaked_units.diff (463 bytes) 2007-04-13 11:59 +

-Relationships
+Relationships

-Notes

~0000886

ILMTitan (reporter)

This would mean that cloaked units detected by radar would not be shot at, right. That is contrary to previous behavior, and I believe undesirable.

~0000887

KDR_11k (reporter)

If it has both cloak and stealth it would presumably not be spotted by the radar. However, preventing units from shooting at radar spotted targets is undesirable, yes.

~0000888

imbaczek (reporter)

Yeah, didn't thought of that. But still, units shooting at something they don't see in any way is quite a bug, I've been trying to fight it in CWeapon::SlowUpdate, but in vain. Weapons seem to acquire targets somewhere else.

~0000889

KDR_11k (reporter)

I think that's just the units not losing a target immediately when they lose detection because that would be really annoying.

~0000986

tvo (reporter)

I tested and have seen the same behaviour as KDR_11k. The current behaviour is preferable to needing to force fire IMHO.

Maybe the problem is more with a wrong check for stealth, not a wrong check for cloak? (Once I killed radar in my test the unit immediately stopped shooting because the radar dot disappeared.)

~0000987

imbaczek (reporter)

that was a long time ago and I really don't remember the details, but the problem was that the unit being shot at started cloaked and invisible - it was created by a LuaRules script.

I don't know if my hacked nanoblobs still work (a lot has changed since I last touched them), but you can try: http://spring.clan-sy.com/phpbb/viewtopic.php?t=10055

~0003433

zerver (reporter)

I just tested and it seems that air with cloak+stealth will not get shot at. Consider closing the issue.
+Notes

-Issue History
Date Modified Username Field Change
2007-04-13 11:59 imbaczek New Issue
2007-04-13 11:59 imbaczek File Added: stop_shooting_at_cloaked_units.diff
2007-04-14 05:54 ILMTitan Note Added: 0000886
2007-04-14 10:13 KDR_11k Note Added: 0000887
2007-04-15 23:08 imbaczek Note Added: 0000888
2007-04-16 13:41 KDR_11k Note Added: 0000889
2007-06-26 21:52 tvo Note Added: 0000986
2007-06-26 23:29 imbaczek Note Added: 0000987
2009-05-10 02:32 zerver Note Added: 0003433
2009-05-12 17:06 imbaczek Status new => closed
2009-05-12 17:06 imbaczek Resolution open => fixed
+Issue History