From 3e7c745b440ebae1aea991ca63e7358246beb055 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Wed, 8 May 2013 16:49:09 +0000
Subject: [PATCH] Fixed archery

git-svn-id: http://svn.net-core.org/repos/t-engine4@6701 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/interface/Archery.lua     | 4 ++--
 game/modules/tome/data/general/objects/bows.lua   | 1 +
 game/modules/tome/data/general/objects/slings.lua | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/game/modules/tome/class/interface/Archery.lua b/game/modules/tome/class/interface/Archery.lua
index 4683fee426..4724888671 100644
--- a/game/modules/tome/class/interface/Archery.lua
+++ b/game/modules/tome/class/interface/Archery.lua
@@ -549,8 +549,8 @@ function _M:hasArcheryWeapon(type)
 			return nil, "bad ammo"
 		end
 	end
-	if type and weapon.subtype ~= type then return nil, "bad type" end
-	if type and offweapon and offweapon.subtype ~= type then return nil, "bad type" end
+	if type and weapon.archery_kind ~= type then return nil, "bad type" end
+	if type and offweapon and offweapon.archery_kind ~= type then return nil, "bad type" end
 	return weapon, ammo, offweapon
 end
 
diff --git a/game/modules/tome/data/general/objects/bows.lua b/game/modules/tome/data/general/objects/bows.lua
index 67ad11440f..dc0ef8639a 100644
--- a/game/modules/tome/data/general/objects/bows.lua
+++ b/game/modules/tome/data/general/objects/bows.lua
@@ -30,6 +30,7 @@ newEntity{
 	rarity = 7,
 	combat = { talented = "bow", sound = "actions/arrow", sound_miss = "actions/arrow",},
 	require = { talent = { Talents.T_SHOOT }, },
+	archery_kind = "bow",
 	archery = "bow",
 	proj_image = resolvers.image_material("arrow", "wood"),
 	desc = [[Longbows are used to shoot arrows at your foes.]],
diff --git a/game/modules/tome/data/general/objects/slings.lua b/game/modules/tome/data/general/objects/slings.lua
index 11125f69dc..d56a027a10 100644
--- a/game/modules/tome/data/general/objects/slings.lua
+++ b/game/modules/tome/data/general/objects/slings.lua
@@ -28,6 +28,7 @@ newEntity{
 	encumber = 4,
 	rarity = 7,
 	combat = { talented = "sling", sound = "actions/sling", sound_miss = "actions/sling", },
+	archery_kind = "sling",
 	archery = "sling",
 	require = { talent = { Talents.T_SHOOT }, },
 	proj_image = resolvers.image_material("shot_s", "metal"),
-- 
GitLab