2019-10-18 03:41 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000160Spring engineGeneralpublic2006-04-21 22:15
Reporterpatmo98 
Assigned Totvo 
PrioritynormalSeverityblockReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000160: Compile error when DIRECT_CONTROL_ALLOWED is not defined
DescriptionWhen DIRECT_CONTROL_ALLOWED is NOT defined, I get the following errors.

------ Build started: Project: rts, Configuration: Debug Win32 ------
Compiling...
BeamLaser.cpp
c:\src\spring-trunk\rts\sim\weapons\beamlaser.cpp(99) : error C2039: 'directControl' : is not a member of 'CUnit'
        c:\src\spring-trunk\rts\sim\units\unit.h(44) : see declaration of 'CUnit'
Cannon.cpp
c:\src\spring-trunk\rts\sim\weapons\cannon.cpp(190) : error C2039: 'directControl' : is not a member of 'CUnit'
        c:\src\spring-trunk\rts\sim\units\unit.h(44) : see declaration of 'CUnit'
LaserCannon.cpp
c:\src\spring-trunk\rts\sim\weapons\lasercannon.cpp(88) : error C2039: 'directControl' : is not a member of 'CUnit'
        c:\src\spring-trunk\rts\sim\units\unit.h(44) : see declaration of 'CUnit'

TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon directControl.patch (1,530 bytes) 2006-04-21 17:56 -
    Index: rts/Sim/Weapons/BeamLaser.cpp
    ===================================================================
    --- rts/Sim/Weapons/BeamLaser.cpp	(revision 1190)
    +++ rts/Sim/Weapons/BeamLaser.cpp	(working copy)
    @@ -96,8 +96,10 @@
     	dir.Normalize();
     
     	float rangeMod=1.3;
    +#ifdef DIRECT_CONTROL_ALLOWED
     	if(owner->directControl)
     		rangeMod=0.95;
    +#endif
     
     	CUnit* hit;
     	float length=helper->TraceRay(weaponPos,dir,range*rangeMod,damages[0],owner,hit);
    Index: rts/Sim/Weapons/Cannon.cpp
    ===================================================================
    --- rts/Sim/Weapons/Cannon.cpp	(revision 1190)
    +++ rts/Sim/Weapons/Cannon.cpp	(working copy)
    @@ -186,8 +186,10 @@
     
     bool CCannon::AttackGround(float3 pos,bool userTarget)
     {
    +#ifdef DIRECT_CONTROL_ALLOWED
     	if(owner->directControl)		//mostly prevents firing longer than max range using fps mode
     		pos.y=ground->GetHeight(pos.x,pos.z);
    +#endif
     
     	return CWeapon::AttackGround(pos,userTarget);
     }
    Index: rts/Sim/Weapons/LaserCannon.cpp
    ===================================================================
    --- rts/Sim/Weapons/LaserCannon.cpp	(revision 1190)
    +++ rts/Sim/Weapons/LaserCannon.cpp	(working copy)
    @@ -84,8 +84,10 @@
     	dir.Normalize();
     
     	int fpsSub=0;
    +#ifdef DIRECT_CONTROL_ALLOWED
     	if(owner->directControl)
     		fpsSub=6;
    +#endif
     
     	new CLaserProjectile(weaponPos, dir*projectileSpeed, owner, weaponDef->damages, 30, weaponDef->visuals.color, weaponDef->intensity, weaponDef, (int)((weaponDef->range-fpsSub*4)/weaponDef->projectilespeed)-fpsSub);
     
    
    patch file icon directControl.patch (1,530 bytes) 2006-04-21 17:56 +

-Relationships
+Relationships

-Notes

~0000167

patmo98 (reporter)

I think the included patch fixes it, but I'm not quite sure about these sections of the code and was hoping for comments.

~0000168

tvo (reporter)

looks fine, committed
+Notes

-Issue History
Date Modified Username Field Change
2006-04-21 17:54 patmo98 New Issue
2006-04-21 17:56 patmo98 Note Added: 0000167
2006-04-21 17:56 patmo98 File Added: directControl.patch
2006-04-21 22:15 tvo Status new => assigned
2006-04-21 22:15 tvo Assigned To => tvo
2006-04-21 22:15 tvo Status assigned => resolved
2006-04-21 22:15 tvo Resolution open => fixed
2006-04-21 22:15 tvo Note Added: 0000168
+Issue History