Attached Files |
-
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", "");
-
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", "");
|
---|