burn zombies during the day

This commit is contained in:
p2r3
2025-08-28 02:48:46 +03:00
parent ba7d48c3e3
commit 975e5bb6cd
2 changed files with 6 additions and 1 deletions

View File

@@ -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

View File

@@ -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) {