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

Fixed golem eye beam and arcane combat causing a game freeze when actor is frozen

Fixed a few rush-like talents when activated adjacent to the target



git-svn-id: http://svn.net-core.org/repos/t-engine4@4452 51575b47-30f0-44d4-a5cc-537603b46e54
parent 5eadff7e
No related branches found
No related tags found
No related merge requests found
......@@ -778,7 +778,7 @@ newTalent{
local block_actor = function(_, bx, by) return game.level.map:checkEntity(bx, by, Map.TERRAIN, "block_move", self) end
local l = self:lineFOV(x, y, block_actor)
local lx, ly, is_corner_blocked = l:step(block_actor)
local tx, ty = lx, ly
local tx, ty = self.x, self.y
while lx and ly do
if is_corner_blocked or game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
......
......@@ -193,7 +193,7 @@ newTalent{
local block_actor = function(_, bx, by) return game.level.map:checkEntity(bx, by, engine.Map.TERRAIN, "block_move", self) end
local l = self:lineFOV(x, y, block_actor)
local lx, ly, is_corner_blocked = l:step(block_actor)
local tx, ty, _ = lx, ly
local tx, ty = self.x, self.y
while lx and ly do
if is_corner_blocked or block_actor(_, lx, ly) then break end
tx, ty = lx, ly
......
......@@ -298,6 +298,7 @@ newTalent{
local tg = self:getTalentTarget(t)
local x, y = self:getTarget(tg)
if not x or not y then return nil end
if self.x == x and self.y == y then return nil end
-- We will always project the beam as far as possible
local l = self:lineFOV(x, y)
......
......@@ -232,7 +232,7 @@ newTalent{
local block_actor = function(_, bx, by) return game.level.map:checkEntity(bx, by, Map.TERRAIN, "block_move", self) end
local l = self:lineFOV(x, y, block_actor)
local lx, ly, is_corner_blocked = l:step(block_actor)
local tx, ty = lx, ly
local tx, ty = self.x, self.y
while lx and ly do
if is_corner_blocked or game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
......
......@@ -28,6 +28,8 @@ newTalent{
cooldown = 5,
tactical = { BUFF = 2 },
do_trigger = function(self, t, target)
if self.x == target.x and self.y == target.y then return nil end
if rng.percent(20 + self:getTalentLevel(t) * (1 + self:getDex(9, true))) then
local spells = {}
local fatigue = (100 + 2 * self:combatFatigue()) / 100
......
......@@ -180,7 +180,7 @@ newTalent{
local block_actor = function(_, bx, by) return game.level.map:checkEntity(bx, by, Map.TERRAIN, "block_move", self) end
local l = self:lineFOV(x, y, block_actor)
local lx, ly, is_corner_blocked = l:step(block_actor)
local tx, ty = lx, ly
local tx, ty = self.x, self.y
while lx and ly do
if is_corner_blocked or game.level.map:checkAllEntities(lx, ly, "block_move", self) then break end
tx, ty = lx, ly
......
......@@ -631,7 +631,7 @@ static int lua_fov_line_step(lua_State *L)
{
fov_line_data *line = (fov_line_data*)auxiliar_checkclass(L, "core{fovline}", 1);
bool dont_stop_at_end = lua_toboolean(L, 2);
if (!dont_stop_at_end && line->dest_t == line->t) return 0;
if (!dont_stop_at_end && line->dest_t == line->t || line->dest_t == 0) return 0;
// If there is a tie, then choose the tile closer to a cardinal direction.
// If we weren't careful, this would be the most likely place to have floating precision
......
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