If set to 1, the weapon will ignore commands to attack the ground. Other weapons on the unit are unaffected. The unit will not move into range if a shorter ranged weapon can attack the ground (this is the behaviour I (read: we at S44) desire).
Contents of the .diff:
Code: Select all
Index: Weapon.cpp
===================================================================
--- Weapon.cpp (revision 3357)
+++ Weapon.cpp (working copy)
@@ -16,6 +16,7 @@
#include "WeaponDefHandler.h"
#include "Sim/Projectiles/WeaponProjectile.h"
#include "Sim/Misc/InterceptHandler.h"
+//#include "Sim/Misc/CategoryHandler.h"
#include "Sim/Units/CommandAI/CommandAI.h"
#include "Map/Ground.h"
#include "Game/Camera.h"
@@ -342,7 +343,7 @@
{
if((!userTarget && weaponDef->noAutoTarget))
return false;
- if(weaponDef->interceptor || weaponDef->onlyTargetCategory!=0xffffffff)
+ if(weaponDef->interceptor || weaponDef->onlyTargetCategory!=0xffffffff || weaponDef->noGroundAttack)
return false;
if(!weaponDef->waterweapon && pos.y<1)
Index: WeaponDefHandler.cpp
===================================================================
--- WeaponDefHandler.cpp (revision 3357)
+++ WeaponDefHandler.cpp (working copy)
@@ -247,6 +247,7 @@
sunparser->GetDef(weaponDefs[id].energycost, "0", weaponname + "\\energypershot");
sunparser->GetDef(weaponDefs[id].selfExplode, "0", weaponname + "\\burnblow");
sunparser->GetDef(weaponDefs[id].sweepFire, "0", weaponname + "\\sweepfire");
+ sunparser->GetDef(weaponDefs[id].noGroundAttack, "0", weaponname + "\\nogroundattack");
weaponDefs[id].fireStarter=atof(sunparser->SGetValueDef("0", weaponname + "\\firestarter").c_str())*0.01f;
weaponDefs[id].paralyzer=!!atoi(sunparser->SGetValueDef("0", weaponname + "\\paralyzer").c_str());
if(weaponDefs[id].paralyzer)
Index: WeaponDefHandler.h
===================================================================
--- WeaponDefHandler.h (revision 3357)
+++ WeaponDefHandler.h (working copy)
@@ -172,6 +172,8 @@
CExplosionGenerator *explosionGenerator; // can be zero for default explosions
bool sweepFire;
+
+ bool noGroundAttack;
};
class CExplosionGeneratorHandler;
http://flozi.pwp.blueyonder.co.uk/sprin ... ttack.diff
My first bit of Spring code, yay.