Move Game.MassMover to ::MassMover

stable-5.2
Günther Brammer 2009-06-05 17:21:28 +02:00
parent 0cbfee4e4a
commit fb48b275be
6 changed files with 10 additions and 7 deletions

View File

@ -109,7 +109,6 @@ class C4Game
C4ComponentHost GameText;
C4GameScriptHost Script;
C4LangStringTable MainSysLangStringTable, ScenarioLangStringTable, ScenarioSysLangStringTable;
C4MassMoverSet MassMover;
C4ParticleSystem Particles;
C4PlayerList Players;
StdStrBuf PlayerNames;

View File

@ -62,4 +62,6 @@ class C4MassMoverSet
void Consolidate();
};
extern C4MassMoverSet MassMover;
#endif

View File

@ -437,7 +437,7 @@ void C4ControlSyncCheck::Set()
RandomCount = ::RandomCount;
AllCrewPosX = GetAllCrewPosX();
PXSCount = ::PXS.Count;
MassMoverIndex = Game.MassMover.CreatePtr;
MassMoverIndex = ::MassMover.CreatePtr;
ObjectCount = Game.Objects.ObjectCount();
ObjectEnumerationIndex = Game.ObjectEnumerationIndex;
SectShapeSum = Game.Objects.Sectors.getShapeSum();

View File

@ -167,7 +167,7 @@ bool C4GameSave::SaveLandscape()
if (!::PXS.Save(*pSaveGroup)) return false;
// MassMover (create copy, may not modify running data)
C4MassMoverSet MassMoverSet;
MassMoverSet.Copy(Game.MassMover);
MassMoverSet.Copy(::MassMover);
if (!MassMoverSet.Save(*pSaveGroup)) return false;
// Material enumeration
if (!Game.Material.SaveEnumeration(*pSaveGroup)) return false;

View File

@ -881,7 +881,7 @@ BOOL C4Landscape::CheckInstability(int32_t tx, int32_t ty)
int32_t mat=GetMat(tx,ty);
if (MatValid(mat))
if (Game.Material.Map[mat].Instable)
return Game.MassMover.Create(tx,ty);
return ::MassMover.Create(tx,ty);
return FALSE;
}

View File

@ -112,7 +112,7 @@ BOOL C4MassMover::Init(int32_t tx, int32_t ty)
// Check mat
Mat=GBackMat(tx,ty);
x=tx; y=ty;
Game.MassMover.Count++;
::MassMover.Count++;
return (Mat!=MNone);
}
@ -123,7 +123,7 @@ void C4MassMover::Cease()
rc.x=x; rc.y=y;
AddDbgRec(RCT_MMD, &rc, sizeof(rc));
#endif
Game.MassMover.Count--;
::MassMover.Count--;
Mat=MNone;
}
@ -175,7 +175,7 @@ BOOL C4MassMover::Execute()
::Landscape.InsertMaterial(omat, tx, ty + 1);
// Create new mover at target
Game.MassMover.Create(tx,ty,!Rnd3());
::MassMover.Create(tx,ty,!Rnd3());
return TRUE;
}
@ -280,3 +280,5 @@ void C4MassMoverSet::Copy(C4MassMoverSet &rSet)
CreatePtr=rSet.CreatePtr;
for (int32_t cnt=0; cnt<C4MassMoverChunk; cnt++) Set[cnt]=rSet.Set[cnt];
}
C4MassMoverSet MassMover;