Remove Unit::Rs

This commit is contained in:
joris 2013-04-14 10:42:37 +02:00
parent 4cf60a5607
commit b5028c1174
4 changed files with 4 additions and 19 deletions

View file

@ -355,11 +355,6 @@ public:
unsigned Boarded : 1; /// Unit is on board a transporter.
unsigned CacheLock : 1; /// Unit is on lock by unitcache operations.
/** set to random 1..100 when MakeUnit()
** used for fancy buildings
*/
unsigned Rs : 8;
unsigned TeamSelected; /// unit is selected by a team member.
CPlayer *RescuedFrom; /// The original owner of a rescued unit.
/// NULL if the unit was not rescued.

View file

@ -542,10 +542,6 @@ static int CclUnit(lua_State *l)
lua_pushvalue(l, -1);
unit->Resource.Active = LuaToNumber(l, -1);
lua_pop(l, 1);
} else if (!strcmp(value, "rs")) {
lua_rawgeti(l, 2, j + 1);
unit->Rs = LuaToNumber(l, -1);
lua_pop(l, 1);
} else if (!strcmp(value, "units-boarded-count")) {
lua_rawgeti(l, 2, j + 1);
unit->BoardCount = LuaToNumber(l, -1);

View file

@ -612,8 +612,6 @@ void CUnit::Init(const CUnitType &type)
// Has StartingResources, Use those
this->ResourcesHeld = type.StartingResources;
Rs = MyRand() % 100; // used for fancy buildings and others
Assert(Orders.empty());
Orders.push_back(COrder::NewActionStill());
@ -741,13 +739,10 @@ CUnit *MakeUnit(const CUnitType &type, CPlayer *player)
unit->AssignToPlayer(*player);
}
if (type.Building) {
//
// fancy buildings: mirror buildings (but shadows not correct)
//
if (FancyBuildings && unit->Type->NoRandomPlacing == false && unit->Rs > 50) {
unit->Frame = -unit->Frame - 1;
}
// fancy buildings: mirror buildings (but shadows not correct)
if (type.Building && FancyBuildings
&& unit->Type->NoRandomPlacing == false && (MyRand() & 1) != 0) {
unit->Frame = -unit->Frame - 1;
}
return unit;
}

View file

@ -266,7 +266,6 @@ void SaveUnit(const CUnit &unit, CFile &file)
Assert(unit.Resource.Active == 0);
Assert(unit.Resource.Assigned == 0);
}
file.printf(" \"rs\", %d,", unit.Rs);
file.printf(" \"units-boarded-count\", %d,", unit.BoardCount);
if (unit.UnitInside) {