MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / updateFromPacket

Method updateFromPacket

source/entities/GameEntity.cpp:592–611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

590}
591
592void GameEntity::updateFromPacket(ODPacket& is)
593{
594 uint32_t nbEffects;
595 OD_ASSERT_TRUE(is >> nbEffects);
596 // We copy the list of effects currently on this entity. That will allow to
597 // check if the effect is already on it and only display the effect if it is not
598 std::vector<EntityParticleEffect*> currentEffects = mEntityParticleEffects;
599 while(nbEffects > 0)
600 {
601 --nbEffects;
602
603 EntityParticleEffect* effect = EntityParticleEffect::importParticleEffectFromPacketIfNotInList(currentEffects, is);
604 if(effect == nullptr)
605 continue;
606
607 effect->mParticleSystem = RenderManager::getSingleton().rrEntityAddParticleEffect(this,
608 effect->mName, effect->mScript);
609 mEntityParticleEffects.push_back(effect);
610 }
611}
612
613void GameEntity::notifyFightPlayer(Tile* tile)
614{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected