mirror of
https://github.com/Poikilos/mobs.git
synced 2023-10-03 07:28:50 -07:00
Also disable jumping in the other places they could jump
This commit is contained in:
parent
9afa2ec1fd
commit
4237bf2f9c
4
api.lua
4
api.lua
@ -273,7 +273,7 @@ function mobs:register_mob(name, def)
|
|||||||
self.v_start = true
|
self.v_start = true
|
||||||
self.set_velocity(self, self.walk_velocity)
|
self.set_velocity(self, self.walk_velocity)
|
||||||
else
|
else
|
||||||
if self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then
|
if self.jump == true and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:getvelocity()
|
||||||
v.y = 5
|
v.y = 5
|
||||||
self.object:setvelocity(v)
|
self.object:setvelocity(v)
|
||||||
@ -352,7 +352,7 @@ function mobs:register_mob(name, def)
|
|||||||
self.v_start = true
|
self.v_start = true
|
||||||
self.set_velocity(self, self.run_velocity)
|
self.set_velocity(self, self.run_velocity)
|
||||||
else
|
else
|
||||||
if self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then
|
if self.jump == true and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:getvelocity()
|
||||||
v.y = 5
|
v.y = 5
|
||||||
self.object:setvelocity(v)
|
self.object:setvelocity(v)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user