Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
2.6 kB
4
Indexable
Never
if (p_->plantingTree == 18 && pInfo(peer)->hand == 9770) {
				string name_ = pInfo(peer)->world;
				vector<World>::iterator p = find_if(worlds.begin(), worlds.end(), [name_](const World& a) { return a.name == name_; });
				if (p != worlds.end()) {
					World* world_ = &worlds[p - worlds.begin()];
					WorldBlock* block_ = &world_->blocks[p_->punchX + (p_->punchY * 100)];
					if (block_->fg == 0 and block_->bg == 0) break;
				}
				if (p_->punchY == pInfo(peer)->y / 32) {
					if (pInfo(peer)->state == 16) {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
						edit_tile(peer, p_->punchX - 1, p_->punchY, p_->plantingTree);
					}
					else {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
						edit_tile(peer, p_->punchX + 1, p_->punchY, p_->plantingTree);
					}
				}
				else if (p_->punchX == pInfo(peer)->x / 32) {
					if (p_->punchY > pInfo(peer)->y / 32) {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
						edit_tile(peer, p_->punchX, p_->punchY + 1, p_->plantingTree);
					}
					else if (p_->punchY < pInfo(peer)->y / 32) {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
						edit_tile(peer, p_->punchX, p_->punchY - 1, p_->plantingTree);
					}
					else {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
					}
				}
				else if (p_->punchY < pInfo(peer)->y / 32) {
					if (pInfo(peer)->state == 16) {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
						edit_tile(peer, p_->punchX - 1, p_->punchY - 1, p_->plantingTree);
					}
					else {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
						edit_tile(peer, p_->punchX + 1, p_->punchY - 1, p_->plantingTree);
					}
				}
				else if (p_->punchY < pInfo(peer)->y / 32) {
					if (pInfo(peer)->state == 16) {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
						edit_tile(peer, p_->punchX - 1, p_->punchY - 1, p_->plantingTree);
					}
					else {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
						edit_tile(peer, p_->punchX + 1, p_->punchY - 1, p_->plantingTree);
					}
				}
				else if (p_->punchY > pInfo(peer)->y / 32) {
					if (pInfo(peer)->state == 16) {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
						edit_tile(peer, p_->punchX - 1, p_->punchY + 1, p_->plantingTree);
					}
					else {
						edit_tile(peer, p_->punchX, p_->punchY, p_->plantingTree);
						edit_tile(peer, p_->punchX + 1, p_->punchY + 1, p_->plantingTree);
					}
				}
}