mirror of
				https://github.com/sys4-fr/server-nalc.git
				synced 2025-10-31 04:25:32 +01:00 
			
		
		
		
	[mobs/api] Put back calc_velocity
This commit is contained in:
		| @@ -357,6 +357,17 @@ do_jump = function(self) | ||||
| 	end | ||||
| end | ||||
|  | ||||
| function calc_velocity(pos1, pos2, old_vel, power) | ||||
| 	local vel = vector.direction(pos1, pos2) | ||||
| 	vel = vector.normalize(vel) | ||||
| 	vel = vector.multiply(vel, power) | ||||
| 	local dist = vector.distance(pos1, pos2) | ||||
| 	dist = math.max(dist, 1) | ||||
| 	vel = vector.divide(vel, dist) | ||||
| 	vel = vector.add(vel, old_vel) | ||||
| 	return vel | ||||
| end | ||||
|  | ||||
| -- blast damage to entities nearby (modified from TNT mod) | ||||
| function entity_physics(pos, radius, self) --/MFF (Crabman|06/23/2015)add self to use punch function | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user