mirror of
				https://gitlab.com/rautars/weather_pack.git
				synced 2025-11-04 10:15:31 +01:00 
			
		
		
		
	minor code cleanup
This commit is contained in:
		@@ -28,7 +28,7 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
-- creating manually parctiles instead of particles spawner because of easier to control
 | 
					-- creating manually parctiles instead of particles spawner because of easier to control
 | 
				
			||||||
-- spawn position.
 | 
					-- spawn position.
 | 
				
			||||||
rain.add_rain_particles = function(player, dtime)
 | 
					rain.add_rain_particles = function(player)
 | 
				
			||||||
  rain.last_rp_count = 0
 | 
					  rain.last_rp_count = 0
 | 
				
			||||||
  for i=rain.particles_count, 1,-1 do
 | 
					  for i=rain.particles_count, 1,-1 do
 | 
				
			||||||
    local random_pos_x, random_pos_y, random_pos_z = weather.get_random_pos_by_player_look_dir(player)
 | 
					    local random_pos_x, random_pos_y, random_pos_z = weather.get_random_pos_by_player_look_dir(player)
 | 
				
			||||||
@@ -141,7 +141,7 @@ rain.make_weather = function()
 | 
				
			|||||||
      return false
 | 
					      return false
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    rain.add_player(player)
 | 
					    rain.add_player(player)
 | 
				
			||||||
    rain.add_rain_particles(player, dtime)
 | 
					    rain.add_rain_particles(player)
 | 
				
			||||||
    rain.update_sound(player)
 | 
					    rain.update_sound(player)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@ snow = {}
 | 
				
			|||||||
snow.particles_count = 25
 | 
					snow.particles_count = 25
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- calculates coordinates and draw particles for snow weather 
 | 
					-- calculates coordinates and draw particles for snow weather 
 | 
				
			||||||
snow.add_rain_particles = function(player, dtime)
 | 
					snow.add_rain_particles = function(player)
 | 
				
			||||||
  rain.last_rp_count = 0
 | 
					  rain.last_rp_count = 0
 | 
				
			||||||
  for i=snow.particles_count, 1,-1 do
 | 
					  for i=snow.particles_count, 1,-1 do
 | 
				
			||||||
    local random_pos_x, random_pos_y, random_pos_z = weather.get_random_pos_by_player_look_dir(player)
 | 
					    local random_pos_x, random_pos_y, random_pos_z = weather.get_random_pos_by_player_look_dir(player)
 | 
				
			||||||
@@ -47,7 +47,7 @@ minetest.register_globalstep(function(dtime)
 | 
				
			|||||||
    if (weather.is_underwater(player)) then 
 | 
					    if (weather.is_underwater(player)) then 
 | 
				
			||||||
      return false
 | 
					      return false
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
    snow.add_rain_particles(player, dtime)
 | 
					    snow.add_rain_particles(player)
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end)
 | 
					end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user