2025-07-27 20:48 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000687Spring engineGeneralpublic2012-06-27 02:29
Reporterrattle 
Assigned Toabma 
PrioritynormalSeverityfeatureReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000687: CanSelfDestruct=0/1
DescriptionDefaults to 1.

Tested, seems to work.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon CanSelfDestruct.patch (1,775 bytes) 2007-11-19 01:38 -
    Index: CommandAI/CommandAI.cpp
    ===================================================================
    --- CommandAI/CommandAI.cpp	(revision 4832)
    +++ CommandAI/CommandAI.cpp	(working copy)
    @@ -554,18 +554,21 @@
     
     	switch (c.id) {
     		case CMD_SELFD: {
    -			if (!(c.options & SHIFT_KEY) || commandQue.empty()) {
    -				if (owner->selfDCountdown != 0) {
    -					owner->selfDCountdown = 0;
    -				} else {
    -					owner->selfDCountdown = owner->unitDef->selfDCountdown*2+1;
    +			if (owner->unitDef->canSelfDestruct)
    +			{
    +				if (!(c.options & SHIFT_KEY) || commandQue.empty()) {
    +					if (owner->selfDCountdown != 0) {
    +						owner->selfDCountdown = 0;
    +					} else {
    +						owner->selfDCountdown = owner->unitDef->selfDCountdown*2+1;
    +					}
     				}
    -			}
    -			else {
    -			if (commandQue.back().id == CMD_SELFD) {
    -				commandQue.pop_back();
    -				} else {
    -					commandQue.push_back(c);
    +				else {
    +					if (commandQue.back().id == CMD_SELFD) {
    +						commandQue.pop_back();
    +					} else {
    +						commandQue.push_back(c);
    +					}
     				}
     			}
     			return;
    Index: UnitDef.h
    ===================================================================
    --- UnitDef.h	(revision 4832)
    +++ UnitDef.h	(working copy)
    @@ -227,6 +227,7 @@
     	std::string iconType;
     
     	int selfDCountdown;
    +	bool canSelfDestruct;
     
     	bool canSubmerge;
     	bool canfly;
    Index: UnitDefHandler.cpp
    ===================================================================
    --- UnitDefHandler.cpp	(revision 4832)
    +++ UnitDefHandler.cpp	(working copy)
    @@ -290,6 +290,7 @@
     	}
     
     	ud.selfDCountdown = udTable.GetInt("selfDestructCountdown", 5);
    +	ud.canSelfDestruct = udTable.GetBool("canSelfDestruct", 1);
     
     	ud.speed    = udTable.GetFloat("maxVelocity",  0.0f) * 30.0f;
     	ud.maxAcc   = udTable.GetFloat("acceleration", 0.5f);
    
    patch file icon CanSelfDestruct.patch (1,775 bytes) 2007-11-19 01:38 +

-Relationships
+Relationships

-Notes
There are no notes attached to this issue.
+Notes

-Issue History
Date Modified Username Field Change
2007-11-19 01:38 rattle New Issue
2007-11-19 01:38 rattle File Added: CanSelfDestruct.patch
2007-11-19 05:11 trepan Status new => resolved
2007-11-19 05:11 trepan Resolution open => fixed
2012-06-27 02:27 abma Status resolved => assigned
2012-06-27 02:27 abma Assigned To => abma
2012-06-27 02:29 abma Status assigned => resolved
+Issue History