11-08-2011, 05:14 AM
(11-08-2011, 04:51 AM)Sebi Wrote: I've been looking into mobs' code.Yes
Is this function supposed to run when a player sees a mob? (it does)Code:cMonster::SpawnOn( cClientHandle* a_Target )
(11-08-2011, 04:51 AM)Sebi Wrote: It has
shouldn't it beCode:Chunk->Broadcast( Spawn );
Code:a_Target->Send( Spawn );
and also, when a mob is spawned (in cWorld.cpp) SpawnOn is called with NULL, why is it called there anyways?
Giving NULL as the parameter will spawn the entity on all clients within range ( there's an if a_Target == 0 check )
You are right that it's strange that the entity spawn is broadcasted AND sent to all clients. If this is what happens the packets are sent multiple times to the same client. Sounds like an error