11-25-2012, 12:47 AM
ok - in contructor there is no reference to cWorld - but in initialize.
i've now tried:
int x = a_ChunkX+10;
int z = a_ChunkZ+10;
int y = cChunkDef::GetHeight(a_HeightMap, x, z)+2;
cMonster * Monster = new cPig();
Monster->SetPosX(x);
Monster->SetPosY(y);
Monster->SetPosZ(z);
a_Entities.push_back( Monster );
it works except setting the position of the Monster (SetPosX) - when i add those then there is an assert
MCServer: source/Entity.cpp:105: void cEntity::MoveToCorrectChunk(bool): Assertion `0' failed.
Abgebrochen (Speicherabzug geschrieben)
how to i set the position of the entity without cWorld ?
i've now tried:
int x = a_ChunkX+10;
int z = a_ChunkZ+10;
int y = cChunkDef::GetHeight(a_HeightMap, x, z)+2;
cMonster * Monster = new cPig();
Monster->SetPosX(x);
Monster->SetPosY(y);
Monster->SetPosZ(z);
a_Entities.push_back( Monster );
it works except setting the position of the Monster (SetPosX) - when i add those then there is an assert
MCServer: source/Entity.cpp:105: void cEntity::MoveToCorrectChunk(bool): Assertion `0' failed.
Abgebrochen (Speicherabzug geschrieben)
how to i set the position of the entity without cWorld ?