Remove unused field "material" from CObject class in CBot

master
Piotr Dziwinski 2015-06-24 23:25:02 +02:00
parent 37e2f24fbc
commit 7814c0c7bd
3 changed files with 412 additions and 461 deletions

View File

@ -90,7 +90,6 @@ void uObject(CBotVar* botThis, void* user)
ObjectType type;
Math::Vector pos;
float value;
int iValue;
if ( object == 0 ) return;
@ -161,11 +160,6 @@ void uObject(CBotVar* botThis, void* user)
value = object->GetAbsTime();
pVar->SetValFloat(value);
// Updates the material of the object.
pVar = pVar->GetNext(); // "material"
iValue = object->GetMaterial();
pVar->SetValInt(iValue);
// Updates the type of battery.
pVar = pVar->GetNext(); // "energyCell"
power = object->GetPower();
@ -2829,25 +2823,6 @@ float CObject::GetTransparency()
}
// Management of the object matter.
ObjectMaterial CObject::GetMaterial()
{
if ( m_type == OBJECT_HUMAN )
{
return OM_HUMAN;
}
if ( m_type == OBJECT_SCRAP4 ||
m_type == OBJECT_SCRAP5 )
{
return OM_HUMAN;
}
return OM_METAL;
}
// Indicates whether the gadget is a nonessential.
void CObject::SetGadget(bool bMode)

View File

@ -53,17 +53,6 @@ const int OBJECTMAXDESELLIST = 10;
const int OBJECTMAXINFO = 10;
const int OBJECTMAXCMDLINE = 20;
enum ObjectMaterial
{
OM_METAL = 0, // metal
OM_PLASTIC = 1, // plastic
OM_HUMAN = 2, // cosmonaut
OM_ANIMAL = 3, // insect
OM_VEGETAL = 4, // plant
OM_MINERAL = 5, // stone
};
enum DriveType
{
DRIVE_OTHER = 0,
@ -305,8 +294,6 @@ public:
void SetTransparency(float value);
float GetTransparency();
ObjectMaterial GetMaterial();
void SetGadget(bool bMode);
bool GetGadget();
@ -476,7 +463,6 @@ protected:
float m_shield; // shield
float m_range; // flight range
float m_transparency; // transparency (0..1)
int m_material; // matter(0..n)
float m_aTime;
float m_shotTime; // time since last shot
bool m_bVirusMode; // virus activated/triggered

View File

@ -613,7 +613,6 @@ bool CScriptFunctions::rBusy(CBotVar* thisclass, CBotVar* var, CBotVar* result,
classVars = classVars->GetNext(); // "temperature"
classVars = classVars->GetNext(); // "altitude"
classVars = classVars->GetNext(); // "lifeTime"
classVars = classVars->GetNext(); // "material"
classVars = classVars->GetNext(); // "energyCell"
classVars = classVars->GetNext(); // "load"
classVars = classVars->GetNext(); // "id"
@ -645,7 +644,6 @@ bool CScriptFunctions::rDestroy(CBotVar* thisclass, CBotVar* var, CBotVar* resul
classVars = classVars->GetNext(); // "temperature"
classVars = classVars->GetNext(); // "altitude"
classVars = classVars->GetNext(); // "lifeTime"
classVars = classVars->GetNext(); // "material"
classVars = classVars->GetNext(); // "energyCell"
classVars = classVars->GetNext(); // "load"
classVars = classVars->GetNext(); // "id"
@ -722,7 +720,6 @@ bool CScriptFunctions::rFactory(CBotVar* thisclass, CBotVar* var, CBotVar* resul
classVars = classVars->GetNext(); // "temperature"
classVars = classVars->GetNext(); // "altitude"
classVars = classVars->GetNext(); // "lifeTime"
classVars = classVars->GetNext(); // "material"
classVars = classVars->GetNext(); // "energyCell"
classVars = classVars->GetNext(); // "load"
classVars = classVars->GetNext(); // "id"
@ -902,7 +899,6 @@ bool CScriptFunctions::rResearch(CBotVar* thisclass, CBotVar* var, CBotVar* resu
classVars = classVars->GetNext(); // "temperature"
classVars = classVars->GetNext(); // "altitude"
classVars = classVars->GetNext(); // "lifeTime"
classVars = classVars->GetNext(); // "material"
classVars = classVars->GetNext(); // "energyCell"
classVars = classVars->GetNext(); // "load"
classVars = classVars->GetNext(); // "id"
@ -982,7 +978,6 @@ bool CScriptFunctions::rTakeOff(CBotVar* thisclass, CBotVar* var, CBotVar* resul
classVars = classVars->GetNext(); // "temperature"
classVars = classVars->GetNext(); // "altitude"
classVars = classVars->GetNext(); // "lifeTime"
classVars = classVars->GetNext(); // "material"
classVars = classVars->GetNext(); // "energyCell"
classVars = classVars->GetNext(); // "load"
classVars = classVars->GetNext(); // "id"
@ -3278,7 +3273,6 @@ bool CScriptFunctions::rCameraFocus(CBotVar* var, CBotVar* result, int& exceptio
classVars = classVars->GetNext(); // "temperature"
classVars = classVars->GetNext(); // "altitude"
classVars = classVars->GetNext(); // "lifeTime"
classVars = classVars->GetNext(); // "material"
classVars = classVars->GetNext(); // "energyCell"
classVars = classVars->GetNext(); // "load"
classVars = classVars->GetNext(); // "id"
@ -3814,9 +3808,6 @@ void CScriptFunctions::Init()
CBotProgram::DefineNum("BlackArrow", 16);
CBotProgram::DefineNum("RedArrow", 17);
CBotProgram::DefineNum("Metal", OM_METAL);
CBotProgram::DefineNum("Plastic", OM_PLASTIC);
CBotProgram::DefineNum("InFront", TMA_FFRONT);
CBotProgram::DefineNum("Behind", TMA_FBACK);
CBotProgram::DefineNum("EnergyCell", TMA_POWER);
@ -3894,7 +3885,6 @@ void CScriptFunctions::Init()
bc->AddItem("temperature", CBotTypResult(CBotTypFloat), PR_READ);
bc->AddItem("altitude", CBotTypResult(CBotTypFloat), PR_READ);
bc->AddItem("lifeTime", CBotTypResult(CBotTypFloat), PR_READ);
bc->AddItem("material", CBotTypResult(CBotTypInt), PR_READ);
bc->AddItem("energyCell", CBotTypResult(CBotTypPointer, "object"), PR_READ);
bc->AddItem("load", CBotTypResult(CBotTypPointer, "object"), PR_READ);
bc->AddItem("id", CBotTypResult(CBotTypInt), PR_READ);