omg 💣
This commit is contained in:
		| @@ -7,7 +7,7 @@ Bullet::Bullet(Vector3f pos, Vector3f dir, uint64_t tid): m_startpos(pos), m_cur | ||||
|  | ||||
| Bullet::~Bullet() {} | ||||
|  | ||||
| bool Bullet::Update(World* world, float elapsedtime, int perframe, std::unordered_map<uint64_t, Player*> mapPlayer) { | ||||
| bool Bullet::Update(World* world, float elapsedtime, int perframe, std::unordered_map<uint64_t, Player*> mapPlayer, netprot::ChunkMod** chunkmod) { | ||||
| 	int max = 100 / perframe; | ||||
| 	float damage = 0.057f; | ||||
| 	for (int x = 0; x < max; ++x) { | ||||
| @@ -23,6 +23,15 @@ bool Bullet::Update(World* world, float elapsedtime, int perframe, std::unordere | ||||
| 		if (!world->ChunkAt(m_currentpos)) | ||||
| 			return true; | ||||
| 		else if (world->BlockAt(m_currentpos) != BTYPE_AIR) { | ||||
| 			if (chunkmod) { | ||||
| 				using namespace netprot; | ||||
| 				ChunkMod* cmod = *chunkmod; | ||||
| 				cmod = new ChunkMod(); | ||||
| 				cmod->old_b_type = world->BlockAt(m_currentpos); | ||||
| 				cmod->b_type = BTYPE_AIR; | ||||
| 				cmod->pos = m_currentpos; | ||||
| 			} | ||||
|  | ||||
| 			world->ChangeBlockAtPosition(BTYPE_AIR, m_currentpos); | ||||
| 			return true; | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user