diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2017-12-29 13:11:10 +0100 |
---|---|---|
committer | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-01-13 03:39:33 +0100 |
commit | 968206877c2ee1cf220abdafb39a876c16afb0fa (patch) | |
tree | 6c265e41f2f2e2e7eee4465c1dc15fa18aa9f759 /src/World.cpp | |
parent | Implemented new event system (diff) | |
download | AltCraft-968206877c2ee1cf220abdafb39a876c16afb0fa.tar AltCraft-968206877c2ee1cf220abdafb39a876c16afb0fa.tar.gz AltCraft-968206877c2ee1cf220abdafb39a876c16afb0fa.tar.bz2 AltCraft-968206877c2ee1cf220abdafb39a876c16afb0fa.tar.lz AltCraft-968206877c2ee1cf220abdafb39a876c16afb0fa.tar.xz AltCraft-968206877c2ee1cf220abdafb39a876c16afb0fa.tar.zst AltCraft-968206877c2ee1cf220abdafb39a876c16afb0fa.zip |
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/World.cpp b/src/World.cpp index c6f3fc8..9df8889 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -26,7 +26,7 @@ void World::ParseChunkData(std::shared_ptr<PacketChunkData> packet) { using std::swap; swap(*sections.at(chunkPosition).get(), section); } - EventAgregator::PushEvent(EventType::ChunkChanged, ChunkChangedData{ chunkPosition }); + PUSH_EVENT("ChunkChanged", chunkPosition); } } } @@ -272,7 +272,7 @@ void World::ParseChunkData(std::shared_ptr<PacketBlockChange> packet) { SetBlockId(packet->Position, BlockId{(unsigned short) (packet->BlockId >> 4),(unsigned char) (packet->BlockId & 0xF) }); Vector sectionPos(std::floor(packet->Position.x / 16.0), std::floor(packet->Position.y / 16.0), std::floor(packet->Position.z / 16.0)); - EventAgregator::PushEvent(EventType::ChunkChanged, ChunkChangedData{ sectionPos }); + PUSH_EVENT("ChunkChanged", sectionPos); } void World::ParseChunkData(std::shared_ptr<PacketMultiBlockChange> packet) { @@ -290,7 +290,7 @@ void World::ParseChunkData(std::shared_ptr<PacketMultiBlockChange> packet) { } for (auto& sectionPos : changedSections) - EventAgregator::PushEvent(EventType::ChunkChanged, ChunkChangedData{ sectionPos }); + PUSH_EVENT("ChunkChanged", sectionPos); } void World::ParseChunkData(std::shared_ptr<PacketUnloadChunk> packet) { @@ -300,7 +300,7 @@ void World::ParseChunkData(std::shared_ptr<PacketUnloadChunk> packet) { toRemove.push_back(it); } for (auto& it : toRemove) { - EventAgregator::PushEvent(EventType::ChunkDeleted, ChunkDeletedData{ it->first }); + PUSH_EVENT("ChunkDeleted", it->first); sections.erase(it); } UpdateSectionsList(); |