2025-07-18 00:09 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000639Spring engineGeneralpublic2007-09-20 19:06
Reportertombom 
Assigned ToKloot 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000639: Patch to add reclaimTime tag
DescriptionThis patch (should) add a reclaimTime tag for features. This allows you to define how long it takes to reclaim a feature. Default is feature metal+energy.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon reclaimtime.patch (1,815 bytes) 2007-09-20 10:32 -
    Index: rts/Sim/Misc/Feature.cpp
    ===================================================================
    --- rts/Sim/Misc/Feature.cpp	(revision 4411)
    +++ rts/Sim/Misc/Feature.cpp	(working copy)
    @@ -280,9 +280,9 @@
     			return true;
     		}
     
    -		const float part = (100 - amount) * 0.02f / max(10.0f, (def->metal + def->energy));
    -
    -		if (luaRules && !luaRules->AllowFeatureBuildStep(builder, this, part)) {
    +        float part = ((100 - amount) * 0.02f / max(10.0f, (def->reclaimTime)));
    +        
    +        if (luaRules && !luaRules->AllowFeatureBuildStep(builder, this, part)) {
     			return false;
     		}
     
    Index: rts/Sim/Misc/FeatureDef.h
    ===================================================================
    --- rts/Sim/Misc/FeatureDef.h	(revision 4411)
    +++ rts/Sim/Misc/FeatureDef.h	(working copy)
    @@ -18,7 +18,7 @@
     		upright(false), drawType(0), modelType(0),
     		destructable(false), reclaimable(true), blocking(false),
     		burnable(false), floating(false), geoThermal(false), noSelect(false),
    -		xsize(0), ysize(0) {}
    +		xsize(0), ysize(0), reclaimTime(0) {}
     
     	S3DOModel* LoadModel(int team) const;
     
    @@ -31,6 +31,7 @@
     	float metal;
     	float energy;
     	float maxHealth;
    +    float reclaimTime;
     
     	/// used to see if the object can be overrun
     	float mass;
    Index: rts/Sim/Misc/FeatureHandler.cpp
    ===================================================================
    --- rts/Sim/Misc/FeatureHandler.cpp	(revision 4411)
    +++ rts/Sim/Misc/FeatureHandler.cpp	(working copy)
    @@ -201,6 +201,7 @@
     	fd->metal     = fdTable.GetFloat("metal",  0.0f);
     	fd->energy    = fdTable.GetFloat("energy", 0.0f);
     	fd->maxHealth = fdTable.GetFloat("damage", 0.0f);
    +	fd->reclaimTime = fdTable.GetFloat("reclaimTime", (fd->metal + fd->energy));
     
     	fd->drawType = DRAWTYPE_3DO;
     	fd->modelname = fdTable.GetString("object", "");
    
    patch file icon reclaimtime.patch (1,815 bytes) 2007-09-20 10:32 +
  • patch file icon reclaimtimev2.patch (2,362 bytes) 2007-09-20 10:54 -
    Index: Lua/LuaFeatureDefs.cpp
    ===================================================================
    --- Lua/LuaFeatureDefs.cpp	(revision 4411)
    +++ Lua/LuaFeatureDefs.cpp	(working copy)
    @@ -458,6 +458,7 @@
     	ADD_FLOAT("metal",     fd.metal);
     	ADD_FLOAT("energy",    fd.energy);
     	ADD_FLOAT("maxHealth", fd.maxHealth);
    +	ADD_FLOAT("reclaimTime", fd.reclaimTime);
     
     	ADD_FLOAT("mass", fd.mass);
     
    Index: Sim/Misc/Feature.cpp
    ===================================================================
    --- Sim/Misc/Feature.cpp	(revision 4411)
    +++ Sim/Misc/Feature.cpp	(working copy)
    @@ -280,9 +280,9 @@
     			return true;
     		}
     
    -		const float part = (100 - amount) * 0.02f / max(10.0f, (def->metal + def->energy));
    -
    -		if (luaRules && !luaRules->AllowFeatureBuildStep(builder, this, part)) {
    +        const float part = ((100 - amount) * 0.02f / max(10.0f, (def->reclaimTime)));
    +        
    +        if (luaRules && !luaRules->AllowFeatureBuildStep(builder, this, part)) {
     			return false;
     		}
     
    Index: Sim/Misc/FeatureDef.h
    ===================================================================
    --- Sim/Misc/FeatureDef.h	(revision 4411)
    +++ Sim/Misc/FeatureDef.h	(working copy)
    @@ -18,7 +18,7 @@
     		upright(false), drawType(0), modelType(0),
     		destructable(false), reclaimable(true), blocking(false),
     		burnable(false), floating(false), geoThermal(false), noSelect(false),
    -		xsize(0), ysize(0) {}
    +		xsize(0), ysize(0), reclaimTime(0) {}
     
     	S3DOModel* LoadModel(int team) const;
     
    @@ -31,6 +31,7 @@
     	float metal;
     	float energy;
     	float maxHealth;
    +    float reclaimTime;
     
     	/// used to see if the object can be overrun
     	float mass;
    Index: Sim/Misc/FeatureHandler.cpp
    ===================================================================
    --- Sim/Misc/FeatureHandler.cpp	(revision 4411)
    +++ Sim/Misc/FeatureHandler.cpp	(working copy)
    @@ -45,6 +45,7 @@
     		CR_MEMBER(id),
     		CR_MEMBER(energy),
     		CR_MEMBER(maxHealth),
    +		CR_MEMBER(reclaimTime),
     		CR_MEMBER(mass),
     		CR_MEMBER(upright),
     		CR_MEMBER(drawType),
    @@ -201,6 +202,7 @@
     	fd->metal     = fdTable.GetFloat("metal",  0.0f);
     	fd->energy    = fdTable.GetFloat("energy", 0.0f);
     	fd->maxHealth = fdTable.GetFloat("damage", 0.0f);
    +	fd->reclaimTime = fdTable.GetFloat("reclaimTime", (fd->metal + fd->energy));
     
     	fd->drawType = DRAWTYPE_3DO;
     	fd->modelname = fdTable.GetString("object", "");
    
    patch file icon reclaimtimev2.patch (2,362 bytes) 2007-09-20 10:54 +

-Relationships
+Relationships

-Notes

~0001278

tombom (reporter)

added new version which adds member metadata + lua stuff, forgot last time

~0001282

Kloot (developer)

committed in r4413, thanks!
+Notes

-Issue History
Date Modified Username Field Change
2007-09-20 10:32 tombom New Issue
2007-09-20 10:32 tombom File Added: reclaimtime.patch
2007-09-20 10:54 tombom File Added: reclaimtimev2.patch
2007-09-20 10:55 tombom Note Added: 0001278
2007-09-20 19:06 Kloot Note Added: 0001282
2007-09-20 19:06 Kloot Status new => resolved
2007-09-20 19:06 Kloot Resolution open => fixed
2007-09-20 19:06 Kloot Assigned To => Kloot
+Issue History