BlockRemovedUpdate.cpp 465 B

123456789101112131415161718
  1. #include "BlockRemovedUpdate.h"
  2. #include "Globals.h"
  3. #include "Game.h"
  4. BlockRemovedUpdateType::BlockRemovedUpdateType()
  5. : WorldUpdateType(ID)
  6. {}
  7. void BlockRemovedUpdateType::applyUpdate(Framework::StreamReader* zReader)
  8. {
  9. Framework::Vec3<int> pos;
  10. zReader->lese((char*)&pos.x, 4);
  11. zReader->lese((char*)&pos.y, 4);
  12. zReader->lese((char*)&pos.z, 4);
  13. Block* b = currentGame->zBlockAt(pos);
  14. if (b)
  15. currentGame->zDimension()->removeBlock(b);
  16. }