AddEntityUpdate.cpp 454 B

123456789101112131415161718
  1. #include "AddEntityUpdate.h"
  2. #include "Entity.h"
  3. #include "Globals.h"
  4. #include "Registries.h"
  5. #include "StaticRegistry.h"
  6. AddEntityUpdateType::AddEntityUpdateType()
  7. : WorldUpdateType(ID)
  8. {}
  9. void AddEntityUpdateType::applyUpdate(Framework::StreamReader* zReader)
  10. {
  11. int type;
  12. zReader->lese((char*)&type, 4);
  13. Entity* entity = entityTypes[type]->loadEntity(zReader);
  14. World::INSTANCE->zDimension()->addEntity(entity);
  15. }