Mobs spawning
#30
ok, a little bit to myself - missing pieces in code:

cChunkSender::SendChunk
// TODO: Send entity spawn packets


cChunkSender::Entity
// Nothing needed yet, perhaps in the future when we save entities into chunks we'd like to send them upon load, too Wink

WSSAnvil:

virtual void Entity(cEntity * a_Entity) override
{
// TODO: Add entity into NBT:
}


void cWSSAnvil::LoadEntitiesFromNBT(cEntityList & a_Entitites, const cParsedNBT & a_NBT, int a_TagIdx)
{
// TODO: Load the entities
}


cChunk::SetAllData
m_Entities.splice(m_Entities.end(), a_Entities);

I tried to follow the path how a Entity shoud be created.
First in the FinishingGen or WSSAnvil there shoud be created an Entity (or loaded)
Then it is added to a_Entities which goes finally to cChunk::SetAllData.

Within ChunkSender there ar missing Entities functions (TODO) maybe therefore never an Entity get initialized or broadcasted to the Client ?
Where in the Way up the functions should an Entity be initialized ? When generating/loading or within Chunk::SetAllData or within ChunkSender ?

within world.cpp a mob is generated:
[.. generating mob .. ]
Monster->Initialize(this);
Monster->TeleportTo(a_PosX, a_PosY, a_PosZ);
BroadcastSpawn(*Monster);

so i think Bradcastspawn should be called in ChunkSender ?
Reply
Thanks given by:


Messages In This Thread
Mobs spawning - by steven2612 - 11-19-2012, 11:56 AM
RE: Mobs spawning - by xoft - 11-19-2012, 04:33 PM
RE: Mobs spawning - by steven2612 - 11-19-2012, 11:40 PM
RE: Mobs spawning - by xoft - 11-20-2012, 12:38 AM
RE: Mobs spawning - by steven2612 - 11-20-2012, 01:06 AM
RE: Mobs spawning - by xoft - 11-20-2012, 01:23 AM
RE: Mobs spawning - by steven2612 - 11-20-2012, 01:26 AM
RE: Mobs spawning - by xoft - 11-20-2012, 02:31 AM
RE: Mobs spawning - by steven2612 - 11-20-2012, 11:20 AM
RE: Mobs spawning - by xoft - 11-20-2012, 07:15 PM
RE: Mobs spawning - by steven2612 - 11-20-2012, 08:24 PM
RE: Mobs spawning - by ThuGie - 11-20-2012, 08:59 PM
RE: Mobs spawning - by steven2612 - 11-20-2012, 09:02 PM
RE: Mobs spawning - by FakeTruth - 11-20-2012, 09:03 PM
RE: Mobs spawning - by steven2612 - 11-22-2012, 10:54 PM
RE: Mobs spawning - by xoft - 11-22-2012, 11:52 PM
RE: Mobs spawning - by steven2612 - 11-23-2012, 12:03 AM
RE: Mobs spawning - by xoft - 11-23-2012, 12:25 AM
RE: Mobs spawning - by steven2612 - 11-23-2012, 12:56 AM
RE: Mobs spawning - by steven2612 - 11-24-2012, 11:20 PM
RE: Mobs spawning - by xoft - 11-24-2012, 11:27 PM
RE: Mobs spawning - by FakeTruth - 11-25-2012, 12:00 AM
RE: Mobs spawning - by steven2612 - 11-24-2012, 11:41 PM
RE: Mobs spawning - by steven2612 - 11-25-2012, 12:47 AM
RE: Mobs spawning - by xoft - 11-25-2012, 06:55 AM
RE: Mobs spawning - by steven2612 - 11-25-2012, 08:26 AM
RE: Mobs spawning - by steven2612 - 11-25-2012, 01:49 PM
RE: Mobs spawning - by xoft - 11-25-2012, 06:46 PM
RE: Mobs spawning - by steven2612 - 11-25-2012, 10:45 PM
RE: Mobs spawning - by steven2612 - 12-02-2012, 09:54 AM



Users browsing this thread: 1 Guest(s)