From 975e5bb6cde062cea046056be741a1f6b97210d9 Mon Sep 17 00:00:00 2001 From: p2r3 Date: Thu, 28 Aug 2025 02:48:46 +0300 Subject: [PATCH] burn zombies during the day --- src/main.c | 2 +- src/procedures.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index e7d0e35..35d83f2 100644 --- a/src/main.c +++ b/src/main.c @@ -330,7 +330,7 @@ void handlePacket (int client_fd, int length, int packet_id, int state) { if (mob_y != 255) { // Spawn passive mobs above ground during the day, // or hostiles underground and during the night - if (world_time < 13000 && mob_y > 48) { + if ((world_time < 13000 || world_time > 23460) && mob_y > 48) { uint32_t mob_choice = (r >> 12) & 3; if (mob_choice == 0) spawnMob(25, mob_x, mob_y, mob_z, 4); // Chicken else if (mob_choice == 1) spawnMob(28, mob_x, mob_y, mob_z, 10); // Cow diff --git a/src/procedures.c b/src/procedures.c index f0dd8f6..ccb4ae1 100644 --- a/src/procedures.c +++ b/src/procedures.c @@ -1088,6 +1088,11 @@ void handleServerTick (int64_t time_since_last_tick) { mob_data[i].type == 106 // Sheep ); + // Burn hostile mobs if above ground during sunlight + if (!passive && (world_time < 13000 || world_time > 23460) && mob_data[i].y > 48) { + hurtEntity(65536 + i, -1, D_on_fire, 2); + } + uint32_t r = fast_rand(); if ((unsigned int)TICKS_PER_SECOND >= 1) {