diff --git a/example_behaviors.lua b/example_behaviors.lua index cae9422..cd9b4f7 100644 --- a/example_behaviors.lua +++ b/example_behaviors.lua @@ -166,11 +166,11 @@ function mobkit.get_next_waypoint_fast(self,tpos,nogopos) for i=1,4 do -- scan left - height, pos2, liq = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,-i)) - if height and not liq then return height,pos2 end + height, pos2, liquidflag = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,-i)) + if height and not liquidflag then return height,pos2 end -- scan right - height, pos2, liq = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,i)) - if height and not liq then return height,pos2 end + height, pos2, liquidflag = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,i)) + if height and not liquidflag then return height,pos2 end end end end @@ -699,7 +699,7 @@ local function aqua_radar_dumb(pos,yaw,range,reverse) ffrom, fto, fstep = 1,3,1 end for i=ffrom, fto, fstep do - local ok,h = okpos(mobkit.pos_translate2d(pos,yaw+i,range)) + ok,h = okpos(mobkit.pos_translate2d(pos,yaw+i,range)) if ok then return yaw+i,h end ok,h = okpos(mobkit.pos_translate2d(pos,yaw-i,range)) if ok then return yaw-i,h end @@ -808,9 +808,9 @@ function mobkit.hq_aqua_attack(self,prty,tgtobj,speed) end local tpos = tgtobj:get_pos() - local tyaw=core.dir_to_yaw(vector.direction(pos,tpos)) + tyaw=core.dir_to_yaw(vector.direction(pos,tpos)) mobkit.turn2yaw(self,tyaw,3) - local yaw = self.object:get_yaw() + yaw = self.object:get_yaw() if mobkit.timer(self,1) then if not mobkit.is_in_deep(tgtobj) then return true end local vel = self.object:get_velocity() diff --git a/init.lua b/init.lua index d23b5dd..488a804 100644 --- a/init.lua +++ b/init.lua @@ -394,8 +394,8 @@ function mobkit.get_box_displace_cols(pos,box,vec,dist) end -- traverse z - local zsgn = sign(vec.z) - local xsgn = sign(xoff) + zsgn = sign(vec.z) + xsgn = sign(xoff) index=0 for z = floor(fpos.z + 0.5)+zsgn*0.5, fpos.z+vec.z, zsgn do index=index+1 @@ -684,6 +684,8 @@ function mobkit.physics(self) -- bounciness if self.springiness and self.springiness > 0 then + + local colinfo = self.colinfo if colinfo and colinfo.collides then for _,c in ipairs(colinfo.collisions) do