forked from EXTERNAL/bareiron
burn zombies during the day
This commit is contained in:
@@ -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
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user