Skip to content
Snippets Groups Projects
Commit e323eac2 authored by dg's avatar dg
Browse files

minor fixes

git-svn-id: http://svn.net-core.org/repos/t-engine4@4193 51575b47-30f0-44d4-a5cc-537603b46e54
parent 250f58c0
No related branches found
No related tags found
No related merge requests found
......@@ -267,7 +267,7 @@ newTalent{
-- Remove all npcs in the fearscape
for uid, e in pairs(oldlevel.entities) do
if e ~= self and e ~= p.target then e:die() end
if e ~= self and e ~= p.target and e.die then e:die() end
end
-- Reload MOs
......
......@@ -157,7 +157,7 @@ newTalent{
local apr = 0
local crit = 0
local speed = 1
local o = self:getInven("PSIONIC_FOCUS")[1]
local o = self:getInven("PSIONIC_FOCUS") and self:getInven("PSIONIC_FOCUS")[1]
if type(o) == "boolean" then o = nil end
if not o then
return ([[Allows you to wield a weapon telekinetically, directing it with your willpower and cunning rather than crude flesh. When activated, the telekinetically-wielded weapon will attack a random melee-range target each turn.
......
......@@ -74,7 +74,7 @@ newTalent{
self:useEnergy()
self.temporary = self.temporary - 1
if self.temporary <= 0 then
game.level.map:remove(self.x, self.y, Map.TERRAIN+2)
game.level.map:remove(self.x, self.y, engine.Map.TERRAIN+2)
game.level:removeEntity(self)
game.level.map:redisplay()
end
......
......@@ -39,7 +39,7 @@ When activated it will prompt to destroy items on the floor, if there are none i
local price = math.min(o:getPrice() * self.pricemod(o), 25) * o:getNumber()
local price = math.min(o:getPrice() * self.pricemod(o), 25) * o:getNumber()
price = math.floor(price * 100) / 100 -- Make sure we get at most 2 digit precision
if price ~= price then price = 1 end -- NaN is the only value that does not equals itself, this is the way to check it since we do not have a math.isnan method
if price ~= price or not tostring(price):find("^[0-9]") then price = 1 end -- NaN is the only value that does not equals itself, this is the way to check it since we do not have a math.isnan method
who:removeObject(who:getInven("INVEN"), idx, true)
who:sortInven()
who:incMoney(price)
......
......@@ -125,7 +125,7 @@ newEntity{ define_as = "ABOMINATION_RANTHA",
local twin_take_hit = function(self, value, src)
value = mod.class.Actor.onTakeHit(self, value, src)
value = value / 2
if value > 0 then
if value > 0 and self.brother then
local o = self.brother.onTakeHit
self.brother.onTakeHit = nil
self.brother:takeHit(value, src)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment