summaryrefslogtreecommitdiff
path: root/api.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-03-17 13:06:36 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2017-03-17 13:06:36 +0000
commit80a86b658c4cab24d289b558236fe6d632ae532a (patch)
tree41ff18517a87260838d9b2887c00de4dfb1d056a /api.lua
parent1205ec36a68cb498a8eb489e03de7030e9e92a61 (diff)
Separated dogshoot timers for different shoot/fight timings
Diffstat (limited to 'api.lua')
-rw-r--r--api.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/api.lua b/api.lua
index adad4b9..22343e9 100644
--- a/api.lua
+++ b/api.lua
@@ -1266,7 +1266,10 @@ local dogswitch = function(self, dtime)
self.dogshoot_count = self.dogshoot_count + dtime
- if self.dogshoot_count > self.dogshoot_count_max then
+ if (self.dogshoot_switch == 1
+ and self.dogshoot_count > self.dogshoot_count_max)
+ or (self.dogshoot_switch == 2
+ and self.dogshoot_count > self.dogshoot_count2_max) then
self.dogshoot_count = 0
@@ -2389,6 +2392,7 @@ minetest.register_entity(name, {
dogshoot_switch = def.dogshoot_switch,
dogshoot_count = 0,
dogshoot_count_max = def.dogshoot_count_max or 5,
+ dogshoot_count2_max = def.dogshoot_count2_max,
attack_animals = def.attack_animals or false,
specific_attack = def.specific_attack,