2025-07-21 21:04 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000263Spring engineGeneralpublic2007-01-29 04:49
ReporterTheBlasphemer 
Assigned ToILMTitan 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000263: After switching back and forth from FPS mode, D-Gun enabled
DescriptionRight, try this:
In a just started game, build a light laser tower with your commander. Before the building is finished, switch to FPS mode on the commander (select it and press 'C'). Then switch back, and your commander will, for no apparent reason, D-Gun the just built laser-tower :S
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon Unit.patch (1,136 bytes) 2007-01-26 22:07 -
    Index: Unit.cpp
    ===================================================================
    --- Unit.cpp	(revision 3321)
    +++ Unit.cpp	(working copy)
    @@ -941,23 +941,31 @@
     	return true;
     }
     
    +
     bool CUnit::AttackUnit(CUnit *unit,bool dgun)
     {
    -	bool r=false;
    -	haveDGunRequest=dgun;
    -	userAttackGround=false;
    -	commandShotCount=0;
    +	bool r = false;
    +	haveDGunRequest = dgun;
    +	userAttackGround = false;
    +	commandShotCount = 0;
     	SetUserTarget(unit);
    +
     	std::vector<CWeapon*>::iterator wi;
    -	for(wi=weapons.begin();wi!=weapons.end();++wi){
    -		(*wi)->haveUserTarget=false;
    -		if(dgun || !unitDef->canDGun || !(*wi)->weaponDef->manualfire)
    -			if((*wi)->AttackUnit(unit,true))
    -				r=true;
    +	for (wi = weapons.begin(); wi != weapons.end(); ++wi) {
    +		// set weapon targetType to none in case we exited
    +		// first-person mode while targetting something
    +		(*wi)->haveUserTarget = false;
    +		(*wi)->targetType = Target_None;
    +
    +		if (dgun || !unitDef->canDGun || !(*wi)->weaponDef->manualfire)
    +			if ((*wi)->AttackUnit(unit, true))
    +				r = true;
     	}
    +
     	return r;
     }
     
    +
     bool CUnit::AttackGround(const float3 &pos, bool dgun)
     {
     	bool r=false;
    
    patch file icon Unit.patch (1,136 bytes) 2007-01-26 22:07 +

-Relationships
has duplicate 0000060closedtvo When leaving 1st person mode in commander, commander D-Guns 
+Relationships

-Notes

~0000311

TheBlasphemer (reporter)

Note: Seems that you must be facing towards the building too... nevertheless pretty odd ;)

~0000326

duochaos (reporter)

Yes, this has happened to me after building an orcron, i then lost the match <<. Anyway, this bug is quite annoying and i hope that it can get fixed.

~0000623

malric (reporter)

Still reproducebla in spring 0.74b3

~0000628

Kloot (developer)

Last edited: 2007-01-26 22:07

This happens whenever you leave direct-control mode while a unit/structure is targetted, causing CWeapon::Update() to think it should fire (since targetType != Target_None, etc).

Edit: patch uploaded.

~0000646

ILMTitan (reporter)

Revision 3354; Committed. Thank you.
+Notes

-Issue History
Date Modified Username Field Change
2006-08-04 03:07 TheBlasphemer New Issue
2006-08-04 03:15 TheBlasphemer Note Added: 0000311
2006-08-09 09:11 duochaos Note Added: 0000326
2006-09-23 13:55 tvo Relationship added has duplicate 0000060
2007-01-26 02:58 malric Note Added: 0000623
2007-01-26 20:44 Kloot Note Added: 0000628
2007-01-26 22:07 Kloot File Added: Unit.patch
2007-01-26 22:07 Kloot Note Edited: 0000628
2007-01-29 04:49 ILMTitan Status new => resolved
2007-01-29 04:49 ILMTitan Resolution open => fixed
2007-01-29 04:49 ILMTitan Assigned To => ILMTitan
2007-01-29 04:49 ILMTitan Note Added: 0000646
+Issue History