mirror of
https://github.com/ElCeejo/creatura.git
synced 2025-03-21 15:21:24 +00:00
fix warnings
This commit is contained in:
parent
9c4c4932df
commit
b42bfa02b9
1 changed files with 2 additions and 35 deletions
37
mob_meta.lua
37
mob_meta.lua
|
@ -94,36 +94,6 @@ local mob = {
|
||||||
|
|
||||||
local mob_meta = {__index = mob}
|
local mob_meta = {__index = mob}
|
||||||
|
|
||||||
local function index_box_border(self)
|
|
||||||
local width = self.width
|
|
||||||
local pos = self.object:get_pos()
|
|
||||||
pos.y = pos.y + 0.5
|
|
||||||
local pos1 = {
|
|
||||||
x = pos.x - (width + 0.7),
|
|
||||||
y = pos.y,
|
|
||||||
z = pos.z - (width + 0.7),
|
|
||||||
}
|
|
||||||
local pos2 = {
|
|
||||||
x = pos.x + (width + 0.7),
|
|
||||||
y = pos.y,
|
|
||||||
z = pos.z + (width + 0.7),
|
|
||||||
}
|
|
||||||
local border = {}
|
|
||||||
for z = pos1.z, pos2.z do
|
|
||||||
for x = pos1.x, pos2.x do
|
|
||||||
local vec = {
|
|
||||||
x = x,
|
|
||||||
y = pos.y,
|
|
||||||
z = z
|
|
||||||
}
|
|
||||||
if not self:pos_in_box(vec, width) then
|
|
||||||
table.insert(border, vec_sub(vec, pos))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return border
|
|
||||||
end
|
|
||||||
|
|
||||||
function mob:indicate_damage()
|
function mob:indicate_damage()
|
||||||
self._original_texture_mod = self._original_texture_mod or self.object:get_texture_mod()
|
self._original_texture_mod = self._original_texture_mod or self.object:get_texture_mod()
|
||||||
self.object:set_texture_mod(self._original_texture_mod .. "^[colorize:#FF000040")
|
self.object:set_texture_mod(self._original_texture_mod .. "^[colorize:#FF000040")
|
||||||
|
@ -881,7 +851,7 @@ function mob:on_step(dtime, moveresult)
|
||||||
self:_vitals()
|
self:_vitals()
|
||||||
end
|
end
|
||||||
if self._physics then
|
if self._physics then
|
||||||
self:_physics(moveresult)
|
self:_physics()
|
||||||
end
|
end
|
||||||
self._prop_tick = prop_tick
|
self._prop_tick = prop_tick
|
||||||
if self:timer(10) then self:store_nearby_objects() end -- Reduce expensive calls
|
if self:timer(10) then self:store_nearby_objects() end -- Reduce expensive calls
|
||||||
|
@ -933,9 +903,6 @@ end
|
||||||
|
|
||||||
-- Physics
|
-- Physics
|
||||||
|
|
||||||
local moveable = creatura.is_pos_moveable
|
|
||||||
|
|
||||||
|
|
||||||
local function collision_detection(self)
|
local function collision_detection(self)
|
||||||
if not creatura.is_alive(self)
|
if not creatura.is_alive(self)
|
||||||
or self.fancy_collide == false then return end
|
or self.fancy_collide == false then return end
|
||||||
|
@ -1017,7 +984,7 @@ local function water_physics(self, pos, node)
|
||||||
self.object:set_velocity(vel)
|
self.object:set_velocity(vel)
|
||||||
end
|
end
|
||||||
|
|
||||||
function mob:_physics(moveresult)
|
function mob:_physics()
|
||||||
local pos = self.stand_pos
|
local pos = self.stand_pos
|
||||||
local node = self.stand_node
|
local node = self.stand_node
|
||||||
if not pos or not node then return end
|
if not pos or not node then return end
|
||||||
|
|
Loading…
Add table
Reference in a new issue