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

Fix a bug when reloading while an archery projectile is in flight

git-svn-id: http://svn.net-core.org/repos/t-engine4@3268 51575b47-30f0-44d4-a5cc-537603b46e54
parent d68bb090
No related branches found
No related tags found
No related merge requests found
......@@ -108,6 +108,7 @@ end
--- Archery projectile code
local function archery_projectile(tx, ty, tg, self)
local DamageType = require "engine.DamageType"
local weapon, ammo = tg.archery.weapon, tg.archery.ammo
local talent = self:getTalentFromId(tg.talent_id)
......@@ -117,7 +118,7 @@ local function archery_projectile(tx, ty, tg, self)
end
if not target then return end
local damtype = tg.archery.damtype or ammo.damtype or engine.DamageType.PHYSICAL
local damtype = tg.archery.damtype or ammo.damtype or DamageType.PHYSICAL
local mult = tg.archery.mult or 1
-- Does the blow connect? yes .. complex :/
......@@ -151,7 +152,7 @@ local function archery_projectile(tx, ty, tg, self)
print("[ATTACK ARCHERY] after mult", dam)
if crit then game.logSeen(self, "%s performs a critical strike!", self.name:capitalize()) end
engine.DamageType:get(damtype).projector(self, target.x, target.y, damtype, math.max(0, dam))
DamageType:get(damtype).projector(self, target.x, target.y, damtype, math.max(0, dam))
game.level.map:particleEmitter(target.x, target.y, 1, "archery")
hitted = true
......
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